From fd36113966af1df5900e9ef9749ae1f2ff1b0145 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 26 Aug 2023 23:42:14 +0200 Subject: Add two tests for wmemmove --- tests/Makefile | 2 ++ tests/test_wmemmove_dynamic_write.c | 14 ++++++++++++++ tests/test_wmemmove_static_write.c | 14 ++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 tests/test_wmemmove_dynamic_write.c create mode 100644 tests/test_wmemmove_static_write.c diff --git a/tests/Makefile b/tests/Makefile index 1c73c7e..ced53f6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -102,6 +102,8 @@ TARGETS= \ test_vsnprintf_static \ test_vsprintf \ test_write_dynamic \ + test_wmemmove_dynamic_write \ + test_wmemmove_static_write \ test_write_static \ .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 @@ +#include "common.h" + +#include + +int main(int argc, char** argv) { + wchar_t buffer[2] = {0}; + wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + + CHK_FAIL_START + wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", argc); + CHK_FAIL_END + + return ret; +} 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 @@ +#include "common.h" + +#include + +int main(int argc, char** argv) { + wchar_t buffer[2] = {0}; + wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + + CHK_FAIL_START + wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337); + CHK_FAIL_END + + return ret; +} -- cgit v1.3