Author: pschweitzer Date: Sun Oct 25 07:42:34 2015 New Revision: 69681
URL: http://svn.reactos.org/svn/reactos?rev=69681&view=rev Log: [CRT_APITEST] Add more tests
CORE-10390
Modified: trunk/rostests/apitests/crt/mbstowcs.c trunk/rostests/apitests/crt/wcstombs.c
Modified: trunk/rostests/apitests/crt/mbstowcs.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/mbstowcs.c?re... ============================================================================== --- trunk/rostests/apitests/crt/mbstowcs.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/mbstowcs.c [iso-8859-1] Sun Oct 25 07:42:34 2015 @@ -12,14 +12,26 @@ #include <specstrings.h>
#define StrROS "ReactOS" - +#define LStrROS L"ReactOS"
START_TEST(mbstowcs) { size_t len; + wchar_t out[ARRAYSIZE(LStrROS)];
- len = mbstowcs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0])); + len = mbstowcs(NULL, StrROS, 0); ok(len == 7, "Got len = %u, excepting 7\n", len); - len = mbstowcs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]) - 1); + len = mbstowcs(NULL, StrROS, 0); ok(len == 7, "Got len = %u, excepting 7\n", len); + len = mbstowcs(NULL, StrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + len = mbstowcs(NULL, StrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + len = mbstowcs(out, StrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + ok_wstr(out, LStrROS); + memset(out, 0, sizeof(out)); + len = mbstowcs(out, StrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + ok_wstr(out, LStrROS); }
Modified: trunk/rostests/apitests/crt/wcstombs.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/wcstombs.c?re... ============================================================================== --- trunk/rostests/apitests/crt/wcstombs.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/wcstombs.c [iso-8859-1] Sun Oct 25 07:42:34 2015 @@ -11,15 +11,27 @@ #include <stdlib.h> #include <specstrings.h>
-#define StrROS L"ReactOS" - +#define LStrROS L"ReactOS" +#define StrROS "ReactOS"
START_TEST(wcstombs) { size_t len; + char out[ARRAYSIZE(StrROS)];
- len = wcstombs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0])); + len = wcstombs(NULL, LStrROS, 0); ok(len == 7, "Got len = %u, excepting 7\n", len); - len = wcstombs(NULL, StrROS, sizeof(StrROS) / sizeof(StrROS[0]) - 1); + len = wcstombs(NULL, LStrROS, 0); ok(len == 7, "Got len = %u, excepting 7\n", len); + len = wcstombs(NULL, LStrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + len = wcstombs(NULL, LStrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + len = wcstombs(out, LStrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + ok_str(out, StrROS); + memset(out, 0, sizeof(out)); + len = wcstombs(out, LStrROS, ARRAYSIZE(out)); + ok(len == 7, "Got len = %u, excepting 7\n", len); + ok_str(out, StrROS); }