MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / test_bitmap_initializer_body

Function test_bitmap_initializer_body

deps/jemalloc/test/unit/bitmap.c:95–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 NB(16384) \
94
95static void
96test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) {
97 bitmap_info_t binfo_dyn;
98 bitmap_info_init(&binfo_dyn, nbits);
99
100 assert_zu_eq(bitmap_size(binfo), bitmap_size(&binfo_dyn),
101 "Unexpected difference between static and dynamic initialization, "
102 "nbits=%zu", nbits);
103 assert_zu_eq(binfo->nbits, binfo_dyn.nbits,
104 "Unexpected difference between static and dynamic initialization, "
105 "nbits=%zu", nbits);
106#ifdef BITMAP_USE_TREE
107 assert_u_eq(binfo->nlevels, binfo_dyn.nlevels,
108 "Unexpected difference between static and dynamic initialization, "
109 "nbits=%zu", nbits);
110 {
111 unsigned i;
112
113 for (i = 0; i < binfo->nlevels; i++) {
114 assert_zu_eq(binfo->levels[i].group_offset,
115 binfo_dyn.levels[i].group_offset,
116 "Unexpected difference between static and dynamic "
117 "initialization, nbits=%zu, level=%u", nbits, i);
118 }
119 }
120#else
121 assert_zu_eq(binfo->ngroups, binfo_dyn.ngroups,
122 "Unexpected difference between static and dynamic initialization");
123#endif
124}
125
126TEST_BEGIN(test_bitmap_initializer) {
127#define NB(nbits) { \

Callers

nothing calls this directly

Calls 2

bitmap_info_initFunction · 0.50
bitmap_sizeFunction · 0.50

Tested by

no test coverage detected