Module: wine Branch: master Commit: 5df297206debc1256bfa479488e1941fce108cc5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5df297206debc1256bfa479488... Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Aug 15 09:19:24 2016 +0000 reg/tests: Add more Unicode tests for 'reg import'. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/reg.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index a275db9..bd25a94 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -913,6 +913,45 @@ static void test_import(void) todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); /* 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); ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */, "got exit code %d, expected 1\n", r); @@ -953,6 +992,30 @@ static void test_import(void) 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 */, "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)