summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/str.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/str.c b/tests/str.c
index de5f576..03284d6 100644
--- a/tests/str.c
+++ b/tests/str.c
@@ -346,6 +346,13 @@ static bool str_test_error_prone_str_c(void)
AL_TEST_TRUE(al_str_eq(&global_string, &al_str_c("yeeee")));
#endif
+ wstr w = al_wstr_c(L"Ayo");
+ wstr wr = al_wstr_cr(L"Ayo");
+ AL_TEST_EQ(w.length, al_wcsnlen(L"Ayo", sizeof(L"Ayo") / sizeof(wchar_t)), u32);
+ AL_TEST_EQ(wr.length, 3, u32);
+ AL_TEST_EQ(w.alloc, 0, u32);
+ AL_TEST_EQ(al_memcmp(w.data, L"Ayo", sizeof(L"Ayo")), 0, s32);
+
// This is expected to cause a compile error.
#if 0
char *d = al_malloc(26);
@@ -369,6 +376,9 @@ static bool str_test_error_prone_str_c(void)
AL_TEST_EQ(wss.length, (u32)wcslen(ws), u32);
al_free(wd);
+
+ str sss = al_str_c(true ? "true" : "never");
+ wstr www = al_wstr_c(true ? L"false" : L"always");
#endif
AL_TEST_END();