Hugh McMaster : reg/tests: Add some tests for strings containing the characters backslash zero.

Alexandre Julliard julliard at winehq.org
Tue Mar 9 14:55:18 CST 2021


Module: wine
Branch: master
Commit: c5b7f04eea2d88ce8b2192168d0cb9dba340551f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c5b7f04eea2d88ce8b2192168d0cb9dba340551f

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Mar  8 23:32:01 2021 +1100

reg/tests: Add some tests for strings containing the characters backslash zero.

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

---

 programs/reg/tests/add.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c
index c91d9d9b9b8..17c89b4b692 100644
--- a/programs/reg/tests/add.c
+++ b/programs/reg/tests/add.c
@@ -318,6 +318,18 @@ static void test_add(void)
     ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
     verify_reg(hkey, "test3", REG_SZ, "", 1, 0);
 
+    run_reg_exe("reg add HKCU\\" KEY_BASE " /v string\\04 /t REG_SZ /d \"Value\" /f", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+    verify_reg(hkey, "string\\04", REG_SZ, "Value", 6, 0);
+
+    run_reg_exe("reg add HKCU\\" KEY_BASE " /v string5 /t REG_SZ /d \"foo\\0bar\" /f", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+    verify_reg(hkey, "string5", REG_SZ, "foo\\0bar", 9, 0);
+
+    run_reg_exe("reg add HKCU\\" KEY_BASE " /v \\0 /t REG_SZ /d \"Value\" /f", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+    verify_reg(hkey, "\\0", REG_SZ, "Value", 6, 0);
+
     /* REG_EXPAND_SZ */
     run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand0 /t REG_EXpand_sz /d \"dead%PATH%beef\" /f", &r);
     ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);




More information about the wine-cvs mailing list