Add a few tests to show mbstowcs/wcstombs behavior will NULL ptr.
CORE-10390
svn path=/trunk/; revision=69680
# longjmp.c
# malloc.c
# mblen.c
-# mbstowcs.c
+ mbstowcs.c
# mbtowc.c
# memchr.c
# memcmp.c
# wcstod.c
# wcstok.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstoul.c
# wcsxfrm.c
# wctomb.c
--- /dev/null
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PURPOSE: Test for mbstowcs
+ */
+
+#include <apitest.h>
+
+#define WIN32_NO_STATUS
+#include <stdio.h>
+#include <stdlib.h>
+#include <specstrings.h>
+
+#define StrROS "ReactOS"
+
+
+START_TEST(mbstowcs)
+{
+ size_t len;
+
+ len = mbstowcs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]));
+ ok(len == 7, "Got len = %u, excepting 7\n", len);
+ len = mbstowcs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]) - 1);
+ ok(len == 7, "Got len = %u, excepting 7\n", len);
+}
# mbsdup_dbg
# mbsrtowcs
# mbsrtowcs_s
-# mbstowcs.c
+ mbstowcs.c
# mbstowcs_s Not exported in 2k3 Sp1
# mbtowc.c
# memchr.c
# wcstok.c
# wcstok_s.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstombs_s.c Not exported in 2k3 Sp1
# wcstoul.c
# wcsxfrm.c
# isxdigit.c
# labs.c
# log.c
-# mbstowcs.c
+ mbstowcs.c
# memchr.c
# memcmp.c
# memcpy == memmove
# wcsstr.c
# wcstok.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstoul.c
)
#endif
extern void func__vsnprintf(void);
extern void func__vsnwprintf(void);
+extern void func_mbstowcs(void);
extern void func_sprintf(void);
extern void func_strcpy(void);
+extern void func_wcstombs(void);
const struct test winetest_testlist[] =
{
{ "_vsnprintf", func__vsnprintf },
{ "_vsnwprintf", func__vsnwprintf },
+ { "mbstowcs", func_mbstowcs },
{ "sprintf", func_sprintf },
{ "strcpy", func_strcpy },
+ { "wcstombs", func_wcstombs },
#if defined(TEST_CRTDLL) || defined(TEST_MSVCRT) || defined(TEST_STATIC_CRT)
// ...
#endif
--- /dev/null
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PURPOSE: Test for wcstombs
+ */
+
+#include <apitest.h>
+
+#define WIN32_NO_STATUS
+#include <stdio.h>
+#include <stdlib.h>
+#include <specstrings.h>
+
+#define StrROS L"ReactOS"
+
+
+START_TEST(wcstombs)
+{
+ size_t len;
+
+ len = wcstombs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]));
+ ok(len == 7, "Got len = %u, excepting 7\n", len);
+ len = wcstombs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]) - 1);
+ ok(len == 7, "Got len = %u, excepting 7\n", len);
+}