Hugh McMaster : reg/tests: Add tests for key name and value name concatenation.
Alexandre Julliard
julliard at winehq.org
Thu May 18 15:27:50 CDT 2017
Module: wine
Branch: master
Commit: c5f0de7748df03bc391fd7a8f2d078aa655789f6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c5f0de7748df03bc391fd7a8f2d078aa655789f6
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Wed May 17 08:12:48 2017 +0000
reg/tests: Add tests for key name and value name concatenation.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/reg/tests/reg.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c
index c26a8c1..86ff7b5 100644
--- a/programs/reg/tests/reg.c
+++ b/programs/reg/tests/reg.c
@@ -1381,6 +1381,34 @@ static void test_import(void)
dword = 0x00000008;
todo_wine verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
+ /* Test key name and value name concatenation */
+ test_import_str("REGEDIT4\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "\\\n"
+ "Subkey1]\n", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ err = RegOpenKeyExA(hkey, "Subkey1", 0, KEY_READ, &subkey);
+ todo_wine ok(err == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", err);
+
+ test_import_str("REGEDIT4\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "\n"
+ "\\Subkey2]\n", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ err = RegOpenKeyExA(hkey, "Subkey2", 0, KEY_READ, &subkey);
+ todo_wine ok(err == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", err);
+
+ test_import_str("REGEDIT4\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
+ "\"Wine\\\n"
+ "42a\"=\"Value 1\"\n"
+ "\"Wine42b\"=\"Value 2\"\n"
+ "\"Wine\n"
+ "\\42c\"=\"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, "Wine42a");
+ todo_wine verify_reg(hkey, "Wine42b", REG_SZ, "Value 2", 8, 0);
+ todo_wine verify_reg_nonexist(hkey, "Wine42c");
+
+ /* Test import with subkeys */
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey\"1]\n"
"\"Wine\\\\31\"=\"Test value\"\n\n", &r);
@@ -1980,6 +2008,34 @@ static void test_import(void)
dword = 0x00000008;
todo_wine verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
+ /* Test key name and value name concatenation */
+ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "\\\n"
+ "Subkey1]\n", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ err = RegOpenKeyExA(hkey, "Subkey1", 0, KEY_READ, &subkey);
+ todo_wine ok(err == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", err);
+
+ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "\n"
+ "\\Subkey2]\n", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ err = RegOpenKeyExA(hkey, "Subkey2", 0, KEY_READ, &subkey);
+ todo_wine ok(err == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", err);
+
+ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
+ "\"Wine\\\n"
+ "42a\"=\"Value 1\"\n"
+ "\"Wine42b\"=\"Value 2\"\n"
+ "\"Wine\n"
+ "\\42c\"=\"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, "Wine42a");
+ todo_wine verify_reg(hkey, "Wine42b", REG_SZ, "Value 2", 8, 0);
+ todo_wine verify_reg_nonexist(hkey, "Wine42c");
+
+ /* Test import with subkeys */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey\"1]\n"
"\"Wine\\\\31\"=\"Test value\"\n\n", &r);
More information about the wine-cvs
mailing list