MCPcopy Create free account
hub / github.com/F-Stack/f-stack / checkConsistency

Function checkConsistency

app/redis-6.2.6/src/intset.c:378–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378static void checkConsistency(intset *is) {
379 for (uint32_t i = 0; i < (intrev32ifbe(is->length)-1); i++) {
380 uint32_t encoding = intrev32ifbe(is->encoding);
381
382 if (encoding == INTSET_ENC_INT16) {
383 int16_t *i16 = (int16_t*)is->contents;
384 assert(i16[i] < i16[i+1]);
385 } else if (encoding == INTSET_ENC_INT32) {
386 int32_t *i32 = (int32_t*)is->contents;
387 assert(i32[i] < i32[i+1]);
388 } else {
389 int64_t *i64 = (int64_t*)is->contents;
390 assert(i64[i] < i64[i+1]);
391 }
392 }
393}
394
395#define UNUSED(x) (void)(x)
396int intsetTest(int argc, char **argv, int accurate) {

Callers 1

intsetTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected