aboutsummaryrefslogtreecommitdiff
path: root/test/identifier.c
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-11-13 16:28:13 -0500
committernodist <kevin.comas.git@gmail.com>2026-11-13 16:28:13 -0500
commitc3d23d3091c23978b12c140e6cfd964eff1d3986 (patch)
tree3342a73aea427fa19d2b0936a98e37fbe479c85d /test/identifier.c
parent75c8828d804f45cf8f44af73bfe87e0f3eaf9a9e (diff)
rewriteHEADmain
Diffstat (limited to 'test/identifier.c')
-rw-r--r--test/identifier.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/test/identifier.c b/test/identifier.c
deleted file mode 100644
index abbcdac..0000000
--- a/test/identifier.c
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#include "kpl_test.h"
-
-KPL_TEST(c_string_to_identifier) {
- const char *string = "aA0_t4_12w0abcdefghijklmnop456789Z";
- kpl_identifier identifier;
- KPL_ASSERT(kpl_identifier_encode(&identifier, string, strlen(string)), "should encode");
- char buffer[100] = {};
- const int32_t offset = 10;
- kpl_identifier_decode(&identifier, buffer + offset);
- KPL_ASSERT(strcmp(string, buffer + offset) == 0, "should decode to same string");
-}
-
-KPL_TEST(identifier_compare) {
- const char *string_a = "abc123456789", *string_b = "abc123456789", *string_c = "abd123456789";
- kpl_identifier identifier_a, identifier_b, identifier_c;
- KPL_ASSERT(kpl_identifier_encode(&identifier_a, string_a, strlen(string_a)), "should encode");
- KPL_ASSERT(kpl_identifier_encode(&identifier_b, string_b, strlen(string_b)), "should encode");
- KPL_ASSERT(kpl_identifier_encode(&identifier_c, string_c, strlen(string_c)), "should encode");
- KPL_ASSERT(kpl_identifier_compare(&identifier_a, &identifier_b) == 0, "should be 0");
- int32_t compare_value = strcmp(string_b, string_c);
- KPL_ASSERT(kpl_identifier_compare(&identifier_b, &identifier_c) == compare_value, "should equal strcmp");
- KPL_ASSERT(kpl_identifier_equal(&identifier_a, &identifier_b), "should be equal");
-}