Blender V5.3
BLI_ghash_test.cc File Reference
#include "testing/testing.h"
#include "BLI_ghash.hh"
#include "BLI_rand_c.hh"
#include "BLI_utildefines.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define GHASH_INTERNAL_API
#define TESTCASE_SIZE   10000
#define PRINTF_GHASH_STATS(_gh)

Functions

static void blender::init_keys (uint keys[TESTCASE_SIZE], const int seed)
 blender::TEST (ghash, InsertLookup)
 blender::TEST (ghash, InsertRemove)
 blender::TEST (ghash, InsertRemoveShrink)
 blender::TEST (ghash, Copy)
 blender::TEST (ghash, Pop)

Macro Definition Documentation

◆ GHASH_INTERNAL_API

#define GHASH_INTERNAL_API

Definition at line 7 of file BLI_ghash_test.cc.

◆ PRINTF_GHASH_STATS

#define PRINTF_GHASH_STATS ( _gh)
Value:
{ \
double q, lf, var, pempty, poverloaded; \
int bigb; \
q = BLI_ghash_calc_quality_ex((_gh), &lf, &var, &pempty, &poverloaded, &bigb); \
printf( \
"GHash stats (%d entries):\n\t" \
"Quality (the lower the better): %f\n\tVariance (the lower the better): %f\n\tLoad: " \
"%f\n\t" \
"Empty buckets: %.2f%%\n\tOverloaded buckets: %.2f%% (biggest bucket: %d)\n", \
BLI_ghash_len(_gh), \
q, \
var, \
lf, \
pempty * 100.0, \
poverloaded * 100.0, \
bigb); \
} \
void(0)

Definition at line 18 of file BLI_ghash_test.cc.

◆ TESTCASE_SIZE

#define TESTCASE_SIZE   10000