Hugh McMaster : reg/tests: Test the importing of hex values with no data.

Alexandre Julliard julliard at winehq.org
Thu Oct 5 14:59:35 CDT 2017


Module: wine
Branch: master
Commit: 4a6fb941e5934e7f696b27962de7f446ac1df635
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4a6fb941e5934e7f696b27962de7f446ac1df635

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Thu Oct  5 11:53:23 2017 +0000

reg/tests: Test the importing of hex values with no data.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/reg/tests/reg.c | 43 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c
index 7a70ebf..e93062b 100644
--- a/programs/reg/tests/reg.c
+++ b/programs/reg/tests/reg.c
@@ -78,8 +78,11 @@ static void verify_reg_(unsigned line, HKEY hkey, const char* value,
         lok(type == exp_type, "got wrong type %d, expected %d\n", type, exp_type);
     todo_wine_if (todo & TODO_REG_SIZE)
         lok(size == exp_size, "got wrong size %d, expected %d\n", size, exp_size);
-    todo_wine_if (todo & TODO_REG_DATA)
-        lok(memcmp(data, exp_data, size) == 0, "got wrong data\n");
+    if (exp_data)
+    {
+        todo_wine_if (todo & TODO_REG_DATA)
+            lok(memcmp(data, exp_data, size) == 0, "got wrong data\n");
+    }
 }
 
 #define verify_reg_nonexist(k,v) verify_reg_nonexist_(__LINE__,k,v)
@@ -2343,6 +2346,24 @@ static void test_import(void)
     verify_reg(hkey, "Wine67c", REG_EXPAND_SZ, "%PATH%", 7, 0);
     verify_reg(hkey, "Wine67d", REG_EXPAND_SZ, "%PATH%", 7, 0);
 
+    test_import_str("REGEDIT4\n\n"
+                    "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
+                    "\"Wine68a\"=hex(1):\n"
+                    "\"Wine68b\"=hex(2):\n"
+                    "\"Wine68c\"=hex(3):\n"
+                    "\"Wine68d\"=hex(4):\n"
+                    "\"Wine68e\"=hex(7):\n"
+                    "\"Wine68f\"=hex(100):\n"
+                    "\"Wine68g\"=hex(abcd):\n\n", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+    verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0);
+    verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE);
+    verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0);
+    verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0);
+    verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE);
+    verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0);
+    verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0);
+
     err = RegCloseKey(hkey);
     ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
 
@@ -3823,6 +3844,24 @@ static void test_unicode_import(void)
     verify_reg(hkey, "Wine67c", REG_EXPAND_SZ, "%PATH%", 7, 0);
     verify_reg(hkey, "Wine67d", REG_EXPAND_SZ, "%PATH%", 7, 0);
 
+    test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
+                     "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
+                     "\"Wine68a\"=hex(1):\n"
+                     "\"Wine68b\"=hex(2):\n"
+                     "\"Wine68c\"=hex(3):\n"
+                     "\"Wine68d\"=hex(4):\n"
+                     "\"Wine68e\"=hex(7):\n"
+                     "\"Wine68f\"=hex(100):\n"
+                     "\"Wine68g\"=hex(abcd):\n\n", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+    verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0);
+    verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE);
+    verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0);
+    verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0);
+    verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE);
+    verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0);
+    verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0);
+
     err = RegCloseKey(hkey);
     ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
 




More information about the wine-cvs mailing list