regedit/tests: Add tests to determine the effects of backslashes in hex data.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-06-23 11:16:58 +00:00 committed by Alexandre Julliard
parent fdb452f8de
commit a76ce84fce
1 changed files with 35 additions and 0 deletions

View File

@ -480,6 +480,12 @@ static void test_basic_import(void)
"\"Wine15\"=hex(2):25,50,41,54,48,25,00,\n\n"); "\"Wine15\"=hex(2):25,50,41,54,48,25,00,\n\n");
verify_reg(hkey, "Wine15", REG_EXPAND_SZ, "%PATH%", 7, 0); verify_reg(hkey, "Wine15", REG_EXPAND_SZ, "%PATH%", 7, 0);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine16\"=hex(2):\\\n"
" 25,48,4f,4d,45,25,00\n\n");
verify_reg(hkey, "Wine16", REG_EXPAND_SZ, "%HOME%", 7, 0);
RegCloseKey(hkey); RegCloseKey(hkey);
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
@ -823,6 +829,35 @@ static void test_invalid_import(void)
verify_reg_nonexist(hkey, "Wine22a"); verify_reg_nonexist(hkey, "Wine22a");
verify_reg_nonexist(hkey, "Wine22b"); verify_reg_nonexist(hkey, "Wine22b");
/* Test the effect of backslashes in hex data */
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine23a\"=hex(2):25,48\\,4f,4d,45,25,00\n"
"\"Wine23b\"=hex(2):25,48,\\4f,4d,45,25,00\n"
"\"Wine23c\"=hex(2):25,48\\ ,4f,4d,45,25,00\n"
"\"Wine23d\"=hex(2):25,48,\\ 4f,4d,45,25,00\n"
"\"Wine23e\"=hex(2):\\25,48,4f,4d,45,25,00\n"
"\"Wine23f\"=hex(2):\\ 25,48,4f,4d,45,25,00\n"
"\"Wine23g\"=hex(2):25,48,4\\f,4d,45,25,00\n"
"\"Wine23h\"=hex(2):25,48,4\\\n"
" f,4d,45,25,00\n"
"\"Wine23i\"=hex(2):25,50,\\,41,54,48,25,00\n"
"\"Wine23j\"=hex(2):25,48,4f,4d,45,25,5c,\\\\\n"
" 25,50,41,54,48,25,00\n"
"\"Wine23k\"=hex(2):,\\\n"
" 25,48,4f,4d,45,25,00\n\n");
verify_reg_nonexist(hkey, "Wine23a");
verify_reg_nonexist(hkey, "Wine23b");
verify_reg_nonexist(hkey, "Wine23c");
verify_reg_nonexist(hkey, "Wine23d");
verify_reg_nonexist(hkey, "Wine23e");
verify_reg_nonexist(hkey, "Wine23f");
verify_reg_nonexist(hkey, "Wine23g");
todo_wine verify_reg_nonexist(hkey, "Wine23h");
verify_reg_nonexist(hkey, "Wine23i");
verify_reg_nonexist(hkey, "Wine23j");
verify_reg_nonexist(hkey, "Wine23k");
RegCloseKey(hkey); RegCloseKey(hkey);
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);