Hugh McMaster : reg/tests: Test line concatenation with comments, new lines and comma variations before a new default registry value.
Module: wine Branch: master Commit: 72ecfe55074b826632722e9b695a324e67a20cee URL: http://source.winehq.org/git/wine.git/?a=commit;h=72ecfe55074b826632722e9b69... Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Tue Jun 27 09:06:12 2017 +0000 reg/tests: Test line concatenation with comments, new lines and comma variations before a new default registry value. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/reg.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 2 deletions(-) diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 0d69d44..49d810f 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -892,7 +892,7 @@ static void test_import(void) "[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); + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ|KEY_SET_VALUE, &hkey); todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); test_import_str("REGEDIT3\n\n" @@ -1953,6 +1953,54 @@ static void test_import(void) todo_wine verify_reg_nonexist(hkey, "Wine57i"); todo_wine verify_reg(hkey, "Wine57j", REG_EXPAND_SZ, "%PATH%", 7, 0); + err = RegDeleteValueW(hkey, NULL); + todo_wine ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %u\n", err); + + test_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58a\"=hex(2):4c,69,6e,65,20,\\\n" + "@=\"Default value 1\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58a"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58b\"=hex(2):4c,69,6e,65,20,\\\n" + ";comment\n" + "@=\"Default value 2\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58b"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58c\"=hex(2):4c,69,6e,65,20,\\\n" + "#comment\n" + "@=\"Default value 3\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58c"); + todo_wine verify_reg(hkey, NULL, REG_SZ, "Default value 3", 16, 0); + + err = RegDeleteValueW(hkey, NULL); + todo_wine ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %u\n", err); + + test_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58d\"=hex(2):4c,69,6e,65,20,\\\n\n" + "@=\"Default value 4\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58d"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58e\"=hex(2):4c,69,6e,65,20\\\n" + "@=\"Default value 5\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58e"); + todo_wine verify_reg(hkey, NULL, REG_SZ, "Default value 5", 16, 0); + err = RegCloseKey(hkey); todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); @@ -2002,7 +2050,7 @@ static void test_unicode_import(void) "[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); + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ|KEY_SET_VALUE, &hkey); todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); test_import_wstr("\xef\xbb\xbfREGEDIT3\n\n" @@ -3091,6 +3139,54 @@ static void test_unicode_import(void) todo_wine verify_reg_nonexist(hkey, "Wine57i"); todo_wine verify_reg(hkey, "Wine57j", REG_EXPAND_SZ, "%PATH%", 7, 0); + err = RegDeleteValueW(hkey, NULL); + todo_wine ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %u\n", err); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58a\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n" + "@=\"Default value 1\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58a"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58b\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n" + ";comment\n" + "@=\"Default value 2\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58b"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58c\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n" + "#comment\n" + "@=\"Default value 3\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58c"); + todo_wine verify_reg(hkey, NULL, REG_SZ, "Default value 3", 16, 0); + + err = RegDeleteValueW(hkey, NULL); + todo_wine ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %u\n", err); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58d\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n\n" + "@=\"Default value 4\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58d"); + todo_wine verify_reg_nonexist(hkey, NULL); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine58e\"=hex(2):4c,00,69,00,6e,00,65,00,20,00\\\n" + "@=\"Default value 5\"\n\n", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_reg_nonexist(hkey, "Wine58e"); + todo_wine verify_reg(hkey, NULL, REG_SZ, "Default value 5", 16, 0); + err = RegCloseKey(hkey); todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
participants (1)
-
Alexandre Julliard