test/string_tests.c

changeset 283
c3b6ff227481
parent 272
2def28b65328
child 306
90b6d69bb499
--- a/test/string_tests.c	Wed May 02 20:55:23 2018 +0200
+++ b/test/string_tests.c	Wed May 02 21:45:52 2018 +0200
@@ -28,6 +28,19 @@
 
 #include "string_tests.h"
 
+UCX_TEST(test_sstr_macros) {
+    sstr_t hello = ST("Hello");
+    sstr_t world = S("World");
+    
+    char buf[20];
+    snprintf(buf, sizeof(buf), "%" PRIsstr ", %" PRIsstr "!", SFMT(hello), SFMT(world));
+    
+    UCX_TEST_BEGIN
+    const char* cmp = "Hello, World!";
+    UCX_TEST_ASSERT(!strcmp(cmp, buf), "Something weird happened.");
+    UCX_TEST_END
+}
+
 UCX_TEST(test_sstr) {
     sstr_t s1 = sstr((char*)"1234");
     sstr_t s2 = sstrn((char*)"ab", 2);

mercurial