Commit 5df29720 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg/tests: Add more Unicode tests for 'reg import'.

parent 596ca595
...@@ -913,6 +913,45 @@ static void test_import(void) ...@@ -913,6 +913,45 @@ static void test_import(void)
todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
/* Test file contents - Unicode */ /* Test file contents - Unicode */
test_import_wstr("REGEDIT\n", &r);
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
"got exit code %d, expected 1\n", r);
test_import_wstr("REGEDIT4\n", &r);
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
"got exit code %d, expected 1\n", r);
test_import_wstr("\xef\xbb\xbfREGEDIT\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey);
todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode1\"=\"Value1\"\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode1", REG_SZ, "Value1", 7, 0);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode2\"=\"Value2\"\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode2", REG_SZ, "Value2", 7, 0);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode3\"=\"Value3\"\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode3", REG_SZ, "Value3", 7, 0);
test_import_wstr("Windows Registry Editor Version 4.00\n", &r); test_import_wstr("Windows Registry Editor Version 4.00\n", &r);
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */, ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
"got exit code %d, expected 1\n", r); "got exit code %d, expected 1\n", r);
...@@ -953,6 +992,30 @@ static void test_import(void) ...@@ -953,6 +992,30 @@ static void test_import(void)
test_import_wstr("\xef\xbb\xbf\nWindows Registry Editor Version 5.00\n", &r); test_import_wstr("\xef\xbb\xbf\nWindows Registry Editor Version 5.00\n", &r);
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */, ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
"got exit code %d, expected 1\n", r); "got exit code %d, expected 1\n", r);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode4\"=\"Value4\"\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode4", REG_SZ, "Value4", 7, 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode5\"=\"Value5\"\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode5", REG_SZ, "Value5", 7, 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Unicode6\"=\"Value6\"\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg(hkey, "Unicode6", REG_SZ, "Value6", 7, 0);
err = RegCloseKey(hkey);
todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
} }
START_TEST(reg) START_TEST(reg)
......
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