Commit 9e82e50e authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

kernel32/tests: Fix crash on NT4 and higher.

parent f8f4c4ef
...@@ -860,13 +860,16 @@ static void test_WritePrivateProfileString(void) ...@@ -860,13 +860,16 @@ static void test_WritePrivateProfileString(void)
ok(check_file_data(path, data), "File doesn't match\n"); ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path); DeleteFileA(path);
/* empty lpAppName */ if (0)
{
/* empty lpAppName, crashes on NT4 and higher */
data = "[]\r\n" data = "[]\r\n"
"key=string\r\n"; "key=string\r\n";
ret = WritePrivateProfileStringA("", "key", "string", path); ret = WritePrivateProfileStringA("", "key", "string", path);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret); ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
ok(check_file_data(path, data), "File doesn't match\n"); ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path); DeleteFileA(path);
}
/* NULL lpKeyName */ /* NULL lpKeyName */
data = ""; data = "";
...@@ -878,7 +881,9 @@ static void test_WritePrivateProfileString(void) ...@@ -878,7 +881,9 @@ static void test_WritePrivateProfileString(void)
} }
DeleteFileA(path); DeleteFileA(path);
/* empty lpKeyName */ if (0)
{
/* empty lpKeyName, crashes on NT4 and higher */
data = "[App]\r\n" data = "[App]\r\n"
"=string\r\n"; "=string\r\n";
ret = WritePrivateProfileStringA("App", "", "string", path); ret = WritePrivateProfileStringA("App", "", "string", path);
...@@ -888,6 +893,7 @@ static void test_WritePrivateProfileString(void) ...@@ -888,6 +893,7 @@ static void test_WritePrivateProfileString(void)
ok(check_file_data(path, data), "File doesn't match\n"); ok(check_file_data(path, data), "File doesn't match\n");
} }
DeleteFileA(path); DeleteFileA(path);
}
/* NULL lpString */ /* NULL lpString */
data = ""; data = "";
...@@ -904,10 +910,7 @@ static void test_WritePrivateProfileString(void) ...@@ -904,10 +910,7 @@ static void test_WritePrivateProfileString(void)
"key=\r\n"; "key=\r\n";
ret = WritePrivateProfileStringA("App", "key", "", path); ret = WritePrivateProfileStringA("App", "key", "", path);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret); ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
todo_wine ok(check_file_data(path, data), "File doesn't match\n");
{
ok(check_file_data(path, data), "File doesn't match\n");
}
DeleteFileA(path); DeleteFileA(path);
/* empty lpFileName */ /* empty lpFileName */
......
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