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