diff options
| author | jvoisin | 2023-08-21 22:55:34 +0200 |
|---|---|---|
| committer | jvoisin | 2023-08-22 18:51:14 +0200 |
| commit | 9231e0905829f1c33abe07bed9be35298c9bdcf5 (patch) | |
| tree | e8391ca2ba46450fd75f74afbf0d6f8c81f12e29 /tests | |
| parent | bc0c8a57cb13fb110b3f9e050d67ef2d5678f85f (diff) | |
Add tests for wmemset
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 2 | ||||
| -rw-r--r-- | tests/test_wmemset_dynamic.c | 14 | ||||
| -rw-r--r-- | tests/test_wmemset_static.c | 14 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile index be379cd..1f92b36 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -37,6 +37,8 @@ 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 \ | ||
| 40 | test_memchr_dynamic_read \ | 42 | test_memchr_dynamic_read \ |
| 41 | test_memchr_static_read \ | 43 | test_memchr_static_read \ |
| 42 | test_memcpy_dynamic_read \ | 44 | test_memcpy_dynamic_read \ |
diff --git a/tests/test_wmemset_dynamic.c b/tests/test_wmemset_dynamic.c new file mode 100644 index 0000000..edcfd63 --- /dev/null +++ b/tests/test_wmemset_dynamic.c | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <wchar.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | wchar_t buffer[4] = {0}; | ||
| 7 | wmemset(buffer, L'A', 3); | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | wmemset(buffer, L'B', argc); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | return ret; | ||
| 14 | } | ||
diff --git a/tests/test_wmemset_static.c b/tests/test_wmemset_static.c new file mode 100644 index 0000000..29ea7aa --- /dev/null +++ b/tests/test_wmemset_static.c | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <wchar.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | wchar_t buffer[4] = {0}; | ||
| 7 | wmemset(buffer, L'A', 3); | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | wmemset(buffer, L'B', 16); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | return ret; | ||
| 14 | } | ||
