diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/test/test-prioq.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-prioq.c')
-rw-r--r-- | src/test/test-prioq.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c index 540863c..92c22d3 100644 --- a/src/test/test-prioq.c +++ b/src/test/test-prioq.c @@ -54,7 +54,7 @@ static int test_compare(const struct test *x, const struct test *y) { } static void test_hash(const struct test *x, struct siphash *state) { - siphash24_compress(&x->value, sizeof(x->value), state); + siphash24_compress_typesafe(x->value, state); } DEFINE_PRIVATE_HASH_OPS(test_hash_ops, struct test, test_hash, test_compare); @@ -70,10 +70,10 @@ TEST(struct) { assert_se(q = prioq_new((compare_func_t) test_compare)); assert_se(s = set_new(&test_hash_ops)); - assert_se(prioq_peek(q) == NULL); - assert_se(prioq_peek_by_index(q, 0) == NULL); - assert_se(prioq_peek_by_index(q, 1) == NULL); - assert_se(prioq_peek_by_index(q, UINT_MAX) == NULL); + ASSERT_NULL(prioq_peek(q)); + ASSERT_NULL(prioq_peek_by_index(q, 0)); + ASSERT_NULL(prioq_peek_by_index(q, 1)); + ASSERT_NULL(prioq_peek_by_index(q, UINT_MAX)); for (i = 0; i < SET_SIZE; i++) { assert_se(t = new0(struct test, 1)); @@ -87,7 +87,7 @@ TEST(struct) { for (i = 0; i < SET_SIZE; i++) assert_se(prioq_peek_by_index(q, i)); - assert_se(prioq_peek_by_index(q, SET_SIZE) == NULL); + ASSERT_NULL(prioq_peek_by_index(q, SET_SIZE)); unsigned count = 0; PRIOQ_FOREACH_ITEM(q, t) { |