combase/tests: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-09-30 23:14:48 +02:00 committed by Alexandre Julliard
parent e2ac51d89e
commit 4c4ac8a987
2 changed files with 11 additions and 14 deletions

View File

@ -60,9 +60,6 @@ static BOOL init_functions(void)
static void test_ActivationFactories(void)
{
static const WCHAR xmldocumentW[] = { 'W','i','n','d','o','w','s','.','D','a','t','a','.','X','m','l','.',
'D','o','m','.','X','m','l','D','o','c','u','m','e','n','t',0 };
static const WCHAR nonexistW[] = { 'D','o','e','s','.','N','o','t','.','E','x','i','s','t',0 };
HRESULT hr;
HSTRING str, str2;
IActivationFactory *factory = NULL;
@ -74,10 +71,11 @@ static void test_ActivationFactories(void)
return;
}
hr = pWindowsCreateString(xmldocumentW, ARRAY_SIZE(xmldocumentW) - 1, &str);
hr = pWindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
ARRAY_SIZE(L"Windows.Data.Xml.Dom.XmlDocument") - 1, &str);
ok(hr == S_OK, "got %08x\n", hr);
hr = pWindowsCreateString(nonexistW, ARRAY_SIZE(nonexistW) - 1, &str2);
hr = pWindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
ok(hr == S_OK, "got %08x\n", hr);
hr = pRoInitialize(RO_INIT_MULTITHREADED);

View File

@ -101,12 +101,11 @@ static void _check_string(int line, HSTRING str, LPCWSTR content, UINT32 length,
ok_(__FILE__, line)(memcmp(ptr, content, sizeof(*content) * length) == 0, "Incorrect string content\n");
}
static const WCHAR input_string[] = { 'a', 'b', 'c', 'd', 'e', 'f', '\0', '\0' };
static const WCHAR input_string1[] = { 'a', 'b', 'c', '\0' };
static const WCHAR input_string2[] = { 'd', 'e', 'f', '\0' };
static const WCHAR input_empty_string[] = { '\0' };
static const WCHAR input_embed_null[] = { 'a', '\0', 'c', '\0', 'e', 'f', '\0' };
static const WCHAR output_substring[] = { 'c', 'd', 'e', 'f', '\0' };
static const WCHAR input_string[] = L"abcdef\0";
static const WCHAR input_string1[] = L"abc";
static const WCHAR input_string2[] = L"def";
static const WCHAR input_embed_null[] = L"a\0c\0ef";
static const WCHAR output_substring[] = L"cdef";
static void test_create_delete(void)
{
@ -147,7 +146,7 @@ static void test_create_delete(void)
ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
/* Test an empty string */
ok(pWindowsCreateString(input_empty_string, 0, &str) == S_OK, "Failed to create string\n");
ok(pWindowsCreateString(L"", 0, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
@ -155,7 +154,7 @@ static void test_create_delete(void)
ok(str == NULL, "Empty string not a null string\n");
ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
ok(pWindowsCreateStringReference(input_empty_string, 0, &header, &str) == S_OK, "Failed to create string\n");
ok(pWindowsCreateStringReference(L"", 0, &header, &str) == S_OK, "Failed to create string\n");
ok(str == NULL, "Empty string not a null string\n");
ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
@ -230,7 +229,7 @@ static void test_string_buffer(void)
ok(ptr != NULL, "Empty string didn't return a buffer pointer\n");
ok(pWindowsPromoteStringBuffer(buf, &str) == S_OK, "Failed to promote string buffer\n");
ok(str == NULL, "Empty string isn't a null string\n");
check_string(str, input_empty_string, 0, FALSE);
check_string(str, L"", 0, FALSE);
ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n");
ok(pWindowsDeleteStringBuffer(NULL) == S_OK, "Failed to delete null string buffer\n");