aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-07 23:28:29 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit33a0828dbcbdbfbc7b3c6a41736403b8380df8ca (patch)
tree42e99da4d73b735f7a85ebb035a8e3ab11c35b02 /tests
parent27718f093689dbd3decd7021eaa97327f578c8f3 (diff)
Fix hash map bug with reorder nodes
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/main.c b/tests/main.c
index 881866e..11719a8 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -18,12 +18,15 @@ static CHECK_RESULT int test_hash_map() {
HashMap hash_map;
int value;
bool has_key;
+ unsigned char i;
return_if_error(scoped_allocator_init(&scoped_allocator));
cleanup_if_error(hash_map_init(&hash_map, &scoped_allocator, sizeof(int), hash_compare_string, amal_hash_string));
value = 34;
return_if_error(hash_map_insert(&hash_map, create_buffer_view("hello", 5), &value));
+ for(i = 0; i < 128; ++i)
+ return_if_error(hash_map_insert(&hash_map, create_buffer_view((const char*)&i, 1), &value));
return_if_error(hash_map_insert(&hash_map, create_buffer_view("hellp", 5), &value));
has_key = hash_map_get(&hash_map, create_buffer_view("hello", 5), &value);
if(!has_key) {