summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile14
-rw-r--r--tests/test_wcscat_static_write.c14
-rw-r--r--tests/test_wcscpy_static_write.c14
-rw-r--r--tests/test_wcsncat_static_write.c15
-rw-r--r--tests/test_wcsncpy_static_write.c14
5 files changed, 66 insertions, 5 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 8f17906..7f846c2 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -37,8 +37,6 @@ TARGETS= \
37 test_mbsrtowcs_static \ 37 test_mbsrtowcs_static \
38 test_mbstowcs_dynamic \ 38 test_mbstowcs_dynamic \
39 test_mbstowcs_static \ 39 test_mbstowcs_static \
40 test_wmemset_dynamic \
41 test_wmemset_static \
42 test_memchr_dynamic_read \ 40 test_memchr_dynamic_read \
43 test_memchr_static_read \ 41 test_memchr_static_read \
44 test_memcpy_dynamic_read \ 42 test_memcpy_dynamic_read \
@@ -101,11 +99,17 @@ TARGETS= \
101 test_vsnprintf_dynamic \ 99 test_vsnprintf_dynamic \
102 test_vsnprintf_static \ 100 test_vsnprintf_static \
103 test_vsprintf \ 101 test_vsprintf \
104 test_write_dynamic \ 102 test_wcscat_static_write \
105 test_wmemmove_dynamic_write \ 103 test_wcscpy_static_write \
106 test_wmemmove_static_write \ 104 test_wcsncpy_static_write \
105 test_wcsncat_static_write \
107 test_wmemcpy_dynamic_write \ 106 test_wmemcpy_dynamic_write \
108 test_wmemcpy_static_write \ 107 test_wmemcpy_static_write \
108 test_wmemmove_dynamic_write \
109 test_wmemmove_static_write \
110 test_wmemset_dynamic \
111 test_wmemset_static \
112 test_write_dynamic \
109 test_write_static \ 113 test_write_static \
110 114
111.SILENT: 115.SILENT:
diff --git a/tests/test_wcscat_static_write.c b/tests/test_wcscat_static_write.c
new file mode 100644
index 0000000..3ad6a20
--- /dev/null
+++ b/tests/test_wcscat_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[8] = {0};
7 wcscat(buffer, L"α");
8
9 CHK_FAIL_START
10 wcscat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω");
11 CHK_FAIL_END
12
13 return ret;
14}
diff --git a/tests/test_wcscpy_static_write.c b/tests/test_wcscpy_static_write.c
new file mode 100644
index 0000000..ce292db
--- /dev/null
+++ b/tests/test_wcscpy_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[8] = {0};
7 wcscpy(buffer, L"α");
8
9 CHK_FAIL_START
10 wcscpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω");
11 CHK_FAIL_END
12
13 return ret;
14}
diff --git a/tests/test_wcsncat_static_write.c b/tests/test_wcsncat_static_write.c
new file mode 100644
index 0000000..812d9fd
--- /dev/null
+++ b/tests/test_wcsncat_static_write.c
@@ -0,0 +1,15 @@
1#include "common.h"
2
3#include <wchar.h>
4
5int main(int argc, char** argv) {
6 wchar_t buffer[8] = {0};
7 wcsncat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2);
8 puts(buffer);
9
10 CHK_FAIL_START
11 wcsncat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337);
12 CHK_FAIL_END
13
14 return ret;
15}
diff --git a/tests/test_wcsncpy_static_write.c b/tests/test_wcsncpy_static_write.c
new file mode 100644
index 0000000..163d563
--- /dev/null
+++ b/tests/test_wcsncpy_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[8] = {0};
7 wcsncpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1);
8
9 CHK_FAIL_START
10 wcsncpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337);
11 CHK_FAIL_END
12
13 return ret;
14}