aboutsummaryrefslogtreecommitdiff
path: root/tests/test_string.c
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-08-23 22:07:34 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-08-27 11:46:25 +0200
commit37516080db6878bef6fb1e6c5542165f3f982792 (patch)
treed6d37921249b52b53df7166aaf67db510469f3c4 /tests/test_string.c
parentb22b59adb72371d6ca7072eca2c166f4c2534677 (diff)
code upgrade
Diffstat (limited to 'tests/test_string.c')
-rw-r--r--tests/test_string.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_string.c b/tests/test_string.c
index 8b5d0d6..297e294 100644
--- a/tests/test_string.c
+++ b/tests/test_string.c
@@ -4,7 +4,7 @@
#include <stdio.h>
i32 test_string_literal_equality() {
- t_assert(Str_equals(S("Bonjour"), S("Bonjour")));
+ t_assert_strequal(S("Bonjour"), S("Bonjour"));
return 0;
}
@@ -14,28 +14,28 @@ i32 test_string_copy() {
Str cpy = Str_copy(&perm, src.data, src.len);
- t_assert(Str_equals(src, cpy));
+ t_assert_strequal(src, cpy);
t_assert_equal(Arena_get_used(perm), 5);
return 0;
}
i32 test_fast_string() {
- byte_32 quote_mask = _mm256_set1_epi8('"');
+ bytex32 quote_mask = _mm256_set1_epi8('"');
byte *s = malloc(32 * sizeof(byte));
s = "abcdefghijklmnopqrstuvwxyzabcdef";
- byte_32 chunk = _mm256_loadu_si256((byte_32 *)s);
- byte_32 cmp = _mm256_cmpeq_epi8(chunk, quote_mask);
+ bytex32 chunk = _mm256_loadu_si256((bytex32 *)s);
+ bytex32 cmp = _mm256_cmpeq_epi8(chunk, quote_mask);
i32 mask = _mm256_movemask_epi8(cmp);
- t_assert(_mm_popcnt_u32(mask) == 0);
+ t_assert_equal(_mm_popcnt_u32(mask), 0);
s = "abcdefghijklm\"nopqrstuvwxyzabcde";
- chunk = _mm256_loadu_si256((byte_32 *)s);
+ chunk = _mm256_loadu_si256((bytex32 *)s);
cmp = _mm256_cmpeq_epi8(chunk, quote_mask);
mask = _mm256_movemask_epi8(cmp);
- t_assert(_mm_popcnt_u32(mask) == 1);
+ t_assert_equal(_mm_popcnt_u32(mask), 1);
return 0;
}