summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2023-08-26 23:42:14 +0200
committerjvoisin2023-08-26 23:42:14 +0200
commitfd36113966af1df5900e9ef9749ae1f2ff1b0145 (patch)
tree49a0dac66fa21466db042c6dcffec0d4e9e16bda
parent2c610a26730540ff917cf83dd9dc5387184001b2 (diff)
Add two tests for wmemmove
-rw-r--r--tests/Makefile2
-rw-r--r--tests/test_wmemmove_dynamic_write.c14
-rw-r--r--tests/test_wmemmove_static_write.c14
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 1c73c7e..ced53f6 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -102,6 +102,8 @@ TARGETS= \
102 test_vsnprintf_static \ 102 test_vsnprintf_static \
103 test_vsprintf \ 103 test_vsprintf \
104 test_write_dynamic \ 104 test_write_dynamic \
105 test_wmemmove_dynamic_write \
106 test_wmemmove_static_write \
105 test_write_static \ 107 test_write_static \
106 108
107.SILENT: 109.SILENT:
diff --git a/tests/test_wmemmove_dynamic_write.c b/tests/test_wmemmove_dynamic_write.c
new file mode 100644
index 0000000..0c59661
--- /dev/null
+++ b/tests/test_wmemmove_dynamic_write.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <wchar.h>
4
5int main(int argc, char** argv) {
6 wchar_t buffer[2] = {0};
7 wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2);
8
9 CHK_FAIL_START
10 wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", argc);
11 CHK_FAIL_END
12
13 return ret;
14}
diff --git a/tests/test_wmemmove_static_write.c b/tests/test_wmemmove_static_write.c
new file mode 100644
index 0000000..a82d9db
--- /dev/null
+++ b/tests/test_wmemmove_static_write.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <wchar.h>
4
5int main(int argc, char** argv) {
6 wchar_t buffer[2] = {0};
7 wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2);
8
9 CHK_FAIL_START
10 wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337);
11 CHK_FAIL_END
12
13 return ret;
14}