From 9231e0905829f1c33abe07bed9be35298c9bdcf5 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 21 Aug 2023 22:55:34 +0200 Subject: Add tests for wmemset --- tests/Makefile | 2 ++ tests/test_wmemset_dynamic.c | 14 ++++++++++++++ tests/test_wmemset_static.c | 14 ++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 tests/test_wmemset_dynamic.c create mode 100644 tests/test_wmemset_static.c diff --git a/tests/Makefile b/tests/Makefile index be379cd..1f92b36 100644 --- 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 new file mode 100644 index 0000000..edcfd63 --- /dev/null +++ b/tests/test_wmemset_dynamic.c @@ -0,0 +1,14 @@ +#include "common.h" + +#include + +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 new file mode 100644 index 0000000..29ea7aa --- /dev/null +++ b/tests/test_wmemset_static.c @@ -0,0 +1,14 @@ +#include "common.h" + +#include + +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; +} -- cgit v1.3