X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-hindex.c;h=eb63d9dafa20bd368efeef3ecb852ba186daa769;hb=5de43a606c949dbb74272d5b09627ddd5f64b06b;hp=7a3ef7212b42d0f3db16af6490410b51dd29ada5;hpb=a12945b3b8cd4d483e5e8f2a1adb6576badf1d4d;p=sliver-openvswitch.git diff --git a/tests/test-hindex.c b/tests/test-hindex.c index 7a3ef7212..eb63d9daf 100644 --- a/tests/test-hindex.c +++ b/tests/test-hindex.c @@ -137,7 +137,7 @@ print_hindex(const char *name, struct hindex *hindex) printf("%s:", name); HINDEX_FOR_EACH (e, node, hindex) { - printf(" %d(%zu)", e->value, e->node.hash & hindex->mask); + printf(" %d(%"PRIuSIZE")", e->value, e->node.hash & hindex->mask); } printf("\n"); } @@ -178,6 +178,12 @@ mod2_hash(int value) return value % 2; } +static size_t +multipart_hash(int value) +{ + return (mod4_hash(value) << 16) | (constant_hash(value) & 0xFFFF); +} + /* Tests basic hindex insertion and deletion. */ static void test_hindex_insert_delete(hash_func *hash) @@ -298,6 +304,7 @@ run_test(void (*function)(hash_func *)) mod4_hash, mod3_hash, mod2_hash, + multipart_hash, }; size_t i;