Skip to content
Snippets Groups Projects
Commit ba2bedc8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fix the hash map unit test to use correct signed vs. un-signed comparisons.

parent ead3725d
No related branches found
No related tags found
1 merge request!543Fof
...@@ -46,7 +46,7 @@ int main(int argc, char *argv[]) { ...@@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {
message("Populating hash table..."); message("Populating hash table...");
for (hashmap_key_t key = 0; key < NUM_KEYS; key++) { for (hashmap_key_t key = 0; key < NUM_KEYS; key++) {
hashmap_value_t value; hashmap_value_t value;
value.value_st = key; value.value_st = (long long)key;
hashmap_put(&m, key, value); hashmap_put(&m, key, value);
} }
...@@ -57,8 +57,9 @@ int main(int argc, char *argv[]) { ...@@ -57,8 +57,9 @@ int main(int argc, char *argv[]) {
for (hashmap_key_t key = 0; key < NUM_KEYS; key++) { for (hashmap_key_t key = 0; key < NUM_KEYS; key++) {
hashmap_value_t value = *hashmap_lookup(&m, key); hashmap_value_t value = *hashmap_lookup(&m, key);
if (value.value_st != key) if (value.value_st != (long long)key)
error("Incorrect value (%zu) found for key: %zu", value.value_st, 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); // else message("Retrieved element, Key: %zu Value: %zu", key, value);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment