Commit 0c1bb117 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

scrrun/tests: Use wide-char string literals.

parent 28d2afc0
...@@ -333,7 +333,7 @@ static void test_hash_value(void) ...@@ -333,7 +333,7 @@ static void test_hash_value(void)
L"123", L"123",
L"A", L"A",
L"a", L"a",
{ 0 } L""
}; };
static const int int_hash_tests[] = { static const int int_hash_tests[] = {
......
...@@ -44,7 +44,6 @@ static inline ULONG get_refcount(IUnknown *iface) ...@@ -44,7 +44,6 @@ static inline ULONG get_refcount(IUnknown *iface)
return IUnknown_Release(iface); return IUnknown_Release(iface);
} }
static const WCHAR crlfW[] = {'\r','\n',0};
static const char utf16bom[] = {0xff,0xfe,0}; static const char utf16bom[] = {0xff,0xfe,0};
static const WCHAR testfileW[] = L"test.txt"; static const WCHAR testfileW[] = L"test.txt";
...@@ -1572,7 +1571,7 @@ static void test_WriteLine(void) ...@@ -1572,7 +1571,7 @@ static void test_WriteLine(void)
len = MultiByteToWideChar(CP_ACP, 0, buffA, r, buffW, ARRAY_SIZE(buffW)); len = MultiByteToWideChar(CP_ACP, 0, buffA, r, buffW, ARRAY_SIZE(buffW));
buffW[len] = 0; buffW[len] = 0;
lstrcpyW(buff2W, nameW); lstrcpyW(buff2W, nameW);
lstrcatW(buff2W, crlfW); lstrcatW(buff2W, L"\r\n");
ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W)); ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W));
CloseHandle(file); CloseHandle(file);
DeleteFileW(nameW); DeleteFileW(nameW);
...@@ -1596,7 +1595,7 @@ static void test_WriteLine(void) ...@@ -1596,7 +1595,7 @@ static void test_WriteLine(void)
buff2W[0] = 0xfeff; buff2W[0] = 0xfeff;
buff2W[1] = 0; buff2W[1] = 0;
lstrcatW(buff2W, nameW); lstrcatW(buff2W, nameW);
lstrcatW(buff2W, crlfW); lstrcatW(buff2W, L"\r\n");
ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W)); ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W));
CloseHandle(file); CloseHandle(file);
DeleteFileW(nameW); DeleteFileW(nameW);
...@@ -1665,9 +1664,9 @@ static void test_ReadAll(void) ...@@ -1665,9 +1664,9 @@ static void test_ReadAll(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
lstrcpyW(buffW, nameW); lstrcpyW(buffW, nameW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
lstrcatW(buffW, secondlineW); lstrcatW(buffW, secondlineW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
str = NULL; str = NULL;
hr = ITextStream_ReadAll(stream, &str); hr = ITextStream_ReadAll(stream, &str);
ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr);
...@@ -1699,7 +1698,7 @@ static void test_ReadAll(void) ...@@ -1699,7 +1698,7 @@ static void test_ReadAll(void)
SysFreeString(str); SysFreeString(str);
lstrcpyW(buffW, secondlineW); lstrcpyW(buffW, secondlineW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
str = NULL; str = NULL;
hr = ITextStream_ReadAll(stream, &str); hr = ITextStream_ReadAll(stream, &str);
ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr);
...@@ -1810,9 +1809,9 @@ static void test_Read(void) ...@@ -1810,9 +1809,9 @@ static void test_Read(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
lstrcpyW(buffW, nameW); lstrcpyW(buffW, nameW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
lstrcatW(buffW, secondlineW); lstrcatW(buffW, secondlineW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
str = NULL; str = NULL;
hr = ITextStream_Read(stream, 500, &str); hr = ITextStream_Read(stream, 500, &str);
ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr);
...@@ -1843,7 +1842,7 @@ static void test_Read(void) ...@@ -1843,7 +1842,7 @@ static void test_Read(void)
SysFreeString(str); SysFreeString(str);
lstrcpyW(buffW, secondlineW); lstrcpyW(buffW, secondlineW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
str = NULL; str = NULL;
hr = ITextStream_Read(stream, 100, &str); hr = ITextStream_Read(stream, 100, &str);
ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr);
...@@ -1856,9 +1855,9 @@ static void test_Read(void) ...@@ -1856,9 +1855,9 @@ static void test_Read(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
lstrcpyW(buffW, nameW); lstrcpyW(buffW, nameW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
lstrcatW(buffW, secondlineW); lstrcatW(buffW, secondlineW);
lstrcatW(buffW, crlfW); lstrcatW(buffW, L"\r\n");
str = NULL; str = NULL;
hr = ITextStream_Read(stream, 500, &str); hr = ITextStream_Read(stream, 500, &str);
ok(hr == S_FALSE || broken(hr == S_OK) /* win2003 */, "got 0x%08x\n", hr); ok(hr == S_FALSE || broken(hr == S_OK) /* win2003 */, "got 0x%08x\n", hr);
...@@ -2102,14 +2101,14 @@ struct driveexists_test { ...@@ -2102,14 +2101,14 @@ struct driveexists_test {
* with the drive letter of a drive of this type. If such a drive does not exist, * with the drive letter of a drive of this type. If such a drive does not exist,
* the test will be skipped. */ * the test will be skipped. */
static const struct driveexists_test driveexiststestdata[] = { static const struct driveexists_test driveexiststestdata[] = {
{ {'N',':','\\',0}, DRIVE_NO_ROOT_DIR, VARIANT_FALSE }, { L"N:\\", DRIVE_NO_ROOT_DIR, VARIANT_FALSE },
{ {'R',':','\\',0}, DRIVE_REMOVABLE, VARIANT_TRUE }, { L"R:\\", DRIVE_REMOVABLE, VARIANT_TRUE },
{ {'F',':','\\',0}, DRIVE_FIXED, VARIANT_TRUE }, { L"F:\\", DRIVE_FIXED, VARIANT_TRUE },
{ {'F',':',0}, DRIVE_FIXED, VARIANT_TRUE }, { L"F:", DRIVE_FIXED, VARIANT_TRUE },
{ {'F','?',0}, DRIVE_FIXED, VARIANT_FALSE }, { L"F?", DRIVE_FIXED, VARIANT_FALSE },
{ {'F',0}, DRIVE_FIXED, VARIANT_TRUE }, { L"F", DRIVE_FIXED, VARIANT_TRUE },
{ {'?',0}, -1, VARIANT_FALSE }, { L"?", -1, VARIANT_FALSE },
{ { 0 } } { L"" }
}; };
static void test_DriveExists(void) static void test_DriveExists(void)
...@@ -2118,7 +2117,7 @@ static void test_DriveExists(void) ...@@ -2118,7 +2117,7 @@ static void test_DriveExists(void)
HRESULT hr; HRESULT hr;
VARIANT_BOOL ret; VARIANT_BOOL ret;
BSTR drivespec; BSTR drivespec;
WCHAR root[] = {'?',':','\\',0}; WCHAR root[] = L"?:\\";
hr = IFileSystem3_DriveExists(fs3, NULL, NULL); hr = IFileSystem3_DriveExists(fs3, NULL, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr); ok(hr == E_POINTER, "got 0x%08x\n", hr);
...@@ -2175,14 +2174,14 @@ struct getdrivename_test { ...@@ -2175,14 +2174,14 @@ struct getdrivename_test {
}; };
static const struct getdrivename_test getdrivenametestdata[] = { static const struct getdrivename_test getdrivenametestdata[] = {
{ {'C',':','\\','1','.','t','s','t',0}, {'C',':',0} }, { L"C:\\1.tst", L"C:" },
{ {'O',':','\\','1','.','t','s','t',0}, {'O',':',0} }, { L"O:\\1.tst", L"O:" },
{ {'O',':',0}, {'O',':',0} }, { L"O:", L"O:" },
{ {'o',':',0}, {'o',':',0} }, { L"o:", L"o:" },
{ {'O','O',':',0} }, { L"OO:" },
{ {':',0} }, { L":" },
{ {'O',0} }, { L"O" },
{ { 0 } } { L"" }
}; };
static void test_GetDriveName(void) static void test_GetDriveName(void)
...@@ -2225,7 +2224,7 @@ static void test_GetDrive(void) ...@@ -2225,7 +2224,7 @@ static void test_GetDrive(void)
HRESULT hr; HRESULT hr;
IDrive *drive_fixed, *drive; IDrive *drive_fixed, *drive;
BSTR dl_fixed, drivespec; BSTR dl_fixed, drivespec;
WCHAR root[] = {'?',':','\\',0}; WCHAR root[] = L"?:\\";
drive = (void*)0xdeadbeef; drive = (void*)0xdeadbeef;
hr = IFileSystem3_GetDrive(fs3, NULL, NULL); hr = IFileSystem3_GetDrive(fs3, NULL, NULL);
...@@ -2266,12 +2265,12 @@ static void test_GetDrive(void) ...@@ -2266,12 +2265,12 @@ static void test_GetDrive(void)
{ {dl_upper,':',0}, S_OK, {dl_upper,0} }, { {dl_upper,':',0}, S_OK, {dl_upper,0} },
{ {dl_upper,':','\\',0}, S_OK, {dl_upper,0} }, { {dl_upper,':','\\',0}, S_OK, {dl_upper,0} },
{ {dl_lower,':','\\',0}, S_OK, {dl_upper,0} }, { {dl_lower,':','\\',0}, S_OK, {dl_upper,0} },
{ {dl_upper,'\\',0}, E_INVALIDARG, { 0 } }, { {dl_upper,'\\',0 }, E_INVALIDARG, L""},
{ {dl_lower,'\\',0}, E_INVALIDARG, { 0 } }, { {dl_lower,'\\',0 }, E_INVALIDARG, L""},
{ {'$',':','\\',0}, E_INVALIDARG, { 0 } }, { L"$:\\", E_INVALIDARG, L"" },
{ {'\\','h','o','s','t','\\','s','h','a','r','e',0}, E_INVALIDARG, { 0 } }, { L"\\host\\share", E_INVALIDARG, L"" },
{ {'h','o','s','t','\\','s','h','a','r','e',0}, E_INVALIDARG, { 0 } }, { L"host\\share", E_INVALIDARG, L"" },
{ { 0 } }, { L"" },
}; };
struct getdrive_test *ptr = &testdata[0]; struct getdrive_test *ptr = &testdata[0];
...@@ -2349,10 +2348,10 @@ static const struct extension_test { ...@@ -2349,10 +2348,10 @@ static const struct extension_test {
WCHAR path[20]; WCHAR path[20];
WCHAR ext[10]; WCHAR ext[10];
} extension_tests[] = { } extension_tests[] = {
{ {'n','o','e','x','t',0}, {0} }, { L"noext", L"" },
{ {'n','.','o','.','e','x','t',0}, {'e','x','t',0} }, { L"n.o.ext", L"ext" },
{ {'n','.','o','.','e','X','t',0}, {'e','X','t',0} }, { L"n.o.eXt", L"eXt" },
{ { 0 } } { L"" }
}; };
static void test_GetExtensionName(void) static void test_GetExtensionName(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment