aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMosder <git@mosder.eu>2026-09-28 13:27:35 +0200
committerMosder <git@mosder.eu>2026-09-28 13:27:35 +0200
commit7a1f842b91af4f916501eaea991b897e3db4c502 (patch)
treec2e9c5180a45585ff9e61158a4395ca066050a01 /tests
parentb79ccf95459e7edb303dabfe3a26e624bd9d8679 (diff)
refactor: prefixed compat functions (and added a macro to libc implementations - if they exist), so they do not take reserved names anymore
Diffstat (limited to 'tests')
-rw-r--r--tests/ds/hashmap_tests.c4
-rw-r--r--tests/string_tests.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/ds/hashmap_tests.c b/tests/ds/hashmap_tests.c
index 72965b4..bc1a145 100644
--- a/tests/ds/hashmap_tests.c
+++ b/tests/ds/hashmap_tests.c
@@ -99,7 +99,7 @@ TEST(str_key) {
E *hm = hm_new(.key = HM_STR);
char *str = "key";
- char *str2 = strdup(str);
+ char *str2 = mos_strdup(str);
hm_put(hm, str, 69);
hm_put(hm, "hey", 420);
test_assert(hm_get(hm, str2) == 69, "hm_get got value not from hm_put");
@@ -117,7 +117,7 @@ TEST(ss_key) {
E *hm = hm_new(.key = HM_SS);
char *str = "key";
- char *str2 = strdup(str);
+ char *str2 = mos_strdup(str);
StringSlice ss = ss_from_str(str);
StringSlice ss2 = ss_from_str(str2);
hm_put(hm, ss, 69);
diff --git a/tests/string_tests.c b/tests/string_tests.c
index 282927c..f1009f9 100644
--- a/tests/string_tests.c
+++ b/tests/string_tests.c
@@ -56,7 +56,7 @@ TEST(comparing) {
test_assert(ss_eq(ss, ss), "slice is not equal to itself");
test_assert(ss_eq_str(ss, ss.data), "slice is not equal to its C string");
- char *hw = strdup("hello world");
+ char *hw = mos_strdup("hello world");
StringSlice ss2 = ss_from_str(hw);
test_assert(ss_eq(ss, ss2), "slice is not equal to an equal slice");
test_assert(ss_eq_str(ss, hw), "slice is not equal to an equal string");