X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Ftdb2%2Ftest%2Frun-001-encode.c;fp=ccan%2Ftdb2%2Ftest%2Frun-001-encode.c;h=a62cb1d70998fb291e3fb8d7c9570722ea4513b8;hb=6804501c350181dea8f531142b28c620b70edbd9;hp=d1b124ef034d44274d7f19fd5576a7340743defa;hpb=32710c917e41b6a283ab73190614623c1a8e9508;p=ccan diff --git a/ccan/tdb2/test/run-001-encode.c b/ccan/tdb2/test/run-001-encode.c index d1b124ef..a62cb1d7 100644 --- a/ccan/tdb2/test/run-001-encode.c +++ b/ccan/tdb2/test/run-001-encode.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include "logging.h" @@ -27,7 +28,7 @@ int main(int argc, char *argv[]) /* We should neatly encode all values. */ for (i = 0; i < 48; i++) { - uint64_t h = 1ULL << (i < 5 ? 63 - i : 63 - 4); + uint64_t h = 1ULL << (i < 5 ? i : 4); uint64_t klen = 1ULL << (i < 16 ? i : 15); uint64_t dlen = 1ULL << i; uint64_t xlen = 1ULL << (i < 32 ? i : 31); @@ -38,7 +39,7 @@ int main(int argc, char *argv[]) ok1(rec_key_length(&rec) == klen); ok1(rec_data_length(&rec) == dlen); ok1(rec_extra_padding(&rec) == xlen); - ok1((uint64_t)rec_hash(&rec) << (64 - 5) == h); + ok1((uint64_t)rec_hash(&rec) == h); ok1(rec_zone_bits(&rec) == zbits); ok1(rec_magic(&rec) == TDB_MAGIC); }