From d5af4d7bf8f654539f504ed79ca7ed2e4f85fda7 Mon Sep 17 00:00:00 2001 From: Mosder Date: Sat, 12 Sep 2026 16:46:09 +0200 Subject: feat: added hm_size; fix: fixed MOS_HM_LOAD_FACTOR not doing anything lol --- tests/ds/hashmap_tests.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/ds/hashmap_tests.c') diff --git a/tests/ds/hashmap_tests.c b/tests/ds/hashmap_tests.c index 749564a..288bb4e 100644 --- a/tests/ds/hashmap_tests.c +++ b/tests/ds/hashmap_tests.c @@ -19,6 +19,7 @@ Test put_get() { hm_put(hm, 0.0f, 2137); test_assert(hm_get(hm, 0.0f) == 2137, "hm_put didn't update value properly"); + test_assert(hm_size(hm) == 2, "hm_size returned wrong entry count"); // a lot of puts and gets to test expansion of hashmap for (int i = 2; i < 100; i++) { @@ -30,6 +31,7 @@ Test put_get() { flag = 0; } test_assert(flag, "hm_put / hm_get failed when expansion was needed"); + test_assert(hm_size(hm) == 100, "hm_size returned wrong entry count"); hm_free(hm); } -- cgit v1.2.3