aboutsummaryrefslogtreecommitdiff
path: root/test/identifier.c
diff options
context:
space:
mode:
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");
-}