aboutsummaryrefslogtreecommitdiff
path: root/tests/ds/hashmap_tests.c
diff options
context:
space:
mode:
authorMosder <git@mosder.eu>2026-09-12 16:46:09 +0200
committerMosder <git@mosder.eu>2026-09-12 16:46:09 +0200
commitd5af4d7bf8f654539f504ed79ca7ed2e4f85fda7 (patch)
treeb0bc9c1108df33eca5d1868e05582d71081c3208 /tests/ds/hashmap_tests.c
parent0ef02ddf28c626916da9d5c7081a01ab707be8ce (diff)
feat: added hm_size; fix: fixed MOS_HM_LOAD_FACTOR not doing anything lol
Diffstat (limited to 'tests/ds/hashmap_tests.c')
-rw-r--r--tests/ds/hashmap_tests.c2
1 files changed, 2 insertions, 0 deletions
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);
}