]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: hashmap - increase number of entries for crippled hash test 1473/head
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 6 Oct 2015 12:56:33 +0000 (14:56 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Tue, 6 Oct 2015 12:56:33 +0000 (14:56 +0200)
The purpose of testing with the crippled hash function is to cover
the otherwise very unlikely codepath in bucket_calculate_dib() where
it has to fall back to recomputing the hash value.

This unlikely path was not covered by test-hashmap anymore after
57217c8f "test: hashmap - cripple the hash function by truncating the
input rather than the output".

Restore the test coverage by increasing the number of entries in the test.
The number was determined empirically by checking with lcov.

src/test/test-hashmap-plain.c

index 78f9c19f5b9e2921c4c5968ca9ef6057e8ce9361..c691f577c6034e7179bb01a7138361b20a1ee08c 100644 (file)
@@ -710,7 +710,7 @@ static void test_hashmap_many(void) {
                 unsigned n_entries;
         } tests[] = {
                 { .ops = NULL,                  .n_entries = 1 << 20 },
-                { .ops = &crippled_hashmap_ops, .n_entries = 1 << 11 },
+                { .ops = &crippled_hashmap_ops, .n_entries = 1 << 14 },
         };