From ba2bedc8611285d6e75e68acc047b0812a1cd0d6 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Thu, 23 May 2019 15:00:06 +0200 Subject: [PATCH] Fix the hash map unit test to use correct signed vs. un-signed comparisons. --- tests/testHashmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testHashmap.c b/tests/testHashmap.c index 123c5ca055..af29973231 100644 --- a/tests/testHashmap.c +++ b/tests/testHashmap.c @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) { message("Populating hash table..."); for (hashmap_key_t key = 0; key < NUM_KEYS; key++) { hashmap_value_t value; - value.value_st = key; + value.value_st = (long long)key; hashmap_put(&m, key, value); } @@ -57,8 +57,9 @@ int main(int argc, char *argv[]) { for (hashmap_key_t key = 0; key < NUM_KEYS; key++) { hashmap_value_t value = *hashmap_lookup(&m, key); - if (value.value_st != key) - error("Incorrect value (%zu) found for key: %zu", value.value_st, key); + if (value.value_st != (long long)key) + error("Incorrect value (%lld) found for key: %lld", value.value_st, + (long long)key); // else message("Retrieved element, Key: %zu Value: %zu", key, value); } -- GitLab