commit 9231e0905829f1c33abe07bed9be35298c9bdcf5
parent bc0c8a57cb13fb110b3f9e050d67ef2d5678f85f
Author: jvoisin <julien.voisin@dustri.org>
Date: Mon, 21 Aug 2023 22:55:34 +0200
Add tests for wmemset
Diffstat:
3 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
@@ -37,6 +37,8 @@ TARGETS= \
test_mbsrtowcs_static \
test_mbstowcs_dynamic \
test_mbstowcs_static \
+ test_wmemset_dynamic \
+ test_wmemset_static \
test_memchr_dynamic_read \
test_memchr_static_read \
test_memcpy_dynamic_read \
diff --git a/tests/test_wmemset_dynamic.c b/tests/test_wmemset_dynamic.c
@@ -0,0 +1,14 @@
+#include "common.h"
+
+#include <wchar.h>
+
+int main(int argc, char** argv) {
+ wchar_t buffer[4] = {0};
+ wmemset(buffer, L'A', 3);
+
+ CHK_FAIL_START
+ wmemset(buffer, L'B', argc);
+ CHK_FAIL_END
+
+ return ret;
+}
diff --git a/tests/test_wmemset_static.c b/tests/test_wmemset_static.c
@@ -0,0 +1,14 @@
+#include "common.h"
+
+#include <wchar.h>
+
+int main(int argc, char** argv) {
+ wchar_t buffer[4] = {0};
+ wmemset(buffer, L'A', 3);
+
+ CHK_FAIL_START
+ wmemset(buffer, L'B', 16);
+ CHK_FAIL_END
+
+ return ret;
+}