2015-10-24 23:18:33 +00:00
|
|
|
/*
|
|
|
|
* 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"
|
2015-10-25 07:42:34 +00:00
|
|
|
#define LStrROS L"ReactOS"
|
2015-10-24 23:18:33 +00:00
|
|
|
|
|
|
|
START_TEST(mbstowcs)
|
|
|
|
{
|
|
|
|
size_t len;
|
2015-10-25 07:42:34 +00:00
|
|
|
wchar_t out[ARRAYSIZE(LStrROS)];
|
2015-10-24 23:18:33 +00:00
|
|
|
|
2015-10-25 07:42:34 +00:00
|
|
|
len = mbstowcs(NULL, StrROS, 0);
|
|
|
|
ok(len == 7, "Got len = %u, excepting 7\n", len);
|
|
|
|
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));
|
2015-10-24 23:18:33 +00:00
|
|
|
ok(len == 7, "Got len = %u, excepting 7\n", len);
|
2015-10-25 07:42:34 +00:00
|
|
|
ok_wstr(out, LStrROS);
|
|
|
|
memset(out, 0, sizeof(out));
|
|
|
|
len = mbstowcs(out, StrROS, ARRAYSIZE(out));
|
2015-10-24 23:18:33 +00:00
|
|
|
ok(len == 7, "Got len = %u, excepting 7\n", len);
|
2015-10-25 07:42:34 +00:00
|
|
|
ok_wstr(out, LStrROS);
|
2015-10-24 23:18:33 +00:00
|
|
|
}
|