Author: pschweitzer
Date: Sat Oct 24 23:18:33 2015
New Revision: 69680
URL:
http://svn.reactos.org/svn/reactos?rev=69680&view=rev
Log:
[CRT_APITEST]
Add a few tests to show mbstowcs/wcstombs behavior will NULL ptr.
CORE-10390
Added:
trunk/rostests/apitests/crt/mbstowcs.c (with props)
trunk/rostests/apitests/crt/wcstombs.c (with props)
Modified:
trunk/rostests/apitests/crt/crtdll_crt_apitest.cmake
trunk/rostests/apitests/crt/msvcrt_crt_apitest.cmake
trunk/rostests/apitests/crt/ntdll_crt_apitest.cmake
trunk/rostests/apitests/crt/testlist.c
Modified: trunk/rostests/apitests/crt/crtdll_crt_apitest.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/crtdll_crt_a…
==============================================================================
--- trunk/rostests/apitests/crt/crtdll_crt_apitest.cmake [iso-8859-1] (original)
+++ trunk/rostests/apitests/crt/crtdll_crt_apitest.cmake [iso-8859-1] Sat Oct 24 23:18:33
2015
@@ -425,7 +425,7 @@
# longjmp.c
# malloc.c
# mblen.c
-# mbstowcs.c
+ mbstowcs.c
# mbtowc.c
# memchr.c
# memcmp.c
@@ -517,7 +517,7 @@
# wcstod.c
# wcstok.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstoul.c
# wcsxfrm.c
# wctomb.c
Added: trunk/rostests/apitests/crt/mbstowcs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/mbstowcs.c?r…
==============================================================================
--- trunk/rostests/apitests/crt/mbstowcs.c (added)
+++ trunk/rostests/apitests/crt/mbstowcs.c [iso-8859-1] Sat Oct 24 23:18:33 2015
@@ -0,0 +1,25 @@
+/*
+ * 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);
+}
Propchange: trunk/rostests/apitests/crt/mbstowcs.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/crt/msvcrt_crt_apitest.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/msvcrt_crt_a…
==============================================================================
--- trunk/rostests/apitests/crt/msvcrt_crt_apitest.cmake [iso-8859-1] (original)
+++ trunk/rostests/apitests/crt/msvcrt_crt_apitest.cmake [iso-8859-1] Sat Oct 24 23:18:33
2015
@@ -1117,7 +1117,7 @@
# mbsdup_dbg
# mbsrtowcs
# mbsrtowcs_s
-# mbstowcs.c
+ mbstowcs.c
# mbstowcs_s Not exported in 2k3 Sp1
# mbtowc.c
# memchr.c
@@ -1250,7 +1250,7 @@
# wcstok.c
# wcstok_s.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstombs_s.c Not exported in 2k3 Sp1
# wcstoul.c
# wcsxfrm.c
Modified: trunk/rostests/apitests/crt/ntdll_crt_apitest.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/ntdll_crt_ap…
==============================================================================
--- trunk/rostests/apitests/crt/ntdll_crt_apitest.cmake [iso-8859-1] (original)
+++ trunk/rostests/apitests/crt/ntdll_crt_apitest.cmake [iso-8859-1] Sat Oct 24 23:18:33
2015
@@ -71,7 +71,7 @@
# isxdigit.c
# labs.c
# log.c
-# mbstowcs.c
+ mbstowcs.c
# memchr.c
# memcmp.c
# memcpy == memmove
@@ -120,7 +120,7 @@
# wcsstr.c
# wcstok.c
# wcstol.c
-# wcstombs.c
+ wcstombs.c
# wcstoul.c
)
Modified: trunk/rostests/apitests/crt/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/testlist.c?r…
==============================================================================
--- trunk/rostests/apitests/crt/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/crt/testlist.c [iso-8859-1] Sat Oct 24 23:18:33 2015
@@ -12,15 +12,19 @@
#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
Added: trunk/rostests/apitests/crt/wcstombs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/wcstombs.c?r…
==============================================================================
--- trunk/rostests/apitests/crt/wcstombs.c (added)
+++ trunk/rostests/apitests/crt/wcstombs.c [iso-8859-1] Sat Oct 24 23:18:33 2015
@@ -0,0 +1,25 @@
+/*
+ * 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);
+}
Propchange: trunk/rostests/apitests/crt/wcstombs.c
------------------------------------------------------------------------------
svn:eol-style = native