https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5e7302ebfd8eef6878cd4…
commit 5e7302ebfd8eef6878cd41862cf24acb1baf14fb
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 21:17:19 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:34 2022 +0200
[WINESYNC] reg/tests: Add and amend tests adding a (Default) value.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 1aae492dcbb2a0a7725a9cff40edd6a355f7fc79 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/add.c | 71 +++++++++++++++++++++++++-----------
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 51 insertions(+), 22 deletions(-)
diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c
index fdd09c885bc..3ac4ca800dd 100644
--- a/modules/rostests/winetests/reg/add.c
+++ b/modules/rostests/winetests/reg/add.c
@@ -404,6 +404,16 @@ static void test_reg_none(void)
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_NONE /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ todo_wine verify_reg(hkey, NULL, REG_NONE, "\0", 2, 0);
+
+ todo_wine delete_value(hkey, NULL);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_NONE /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ verify_reg(hkey, NULL, REG_NONE, "\0", 2, 0);
+
run_reg_exe("reg add HKCU\\" KEY_BASE " /v none0 /d deadbeef /t
REG_NONE /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "none0", REG_NONE, "d\0e\0a\0d\0b\0e\0e\0f\0\0",
18, 0);
@@ -412,10 +422,6 @@ static void test_reg_none(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "none1", REG_NONE, "\0", 2, 0);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_NONE /f",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
- verify_reg(hkey, NULL, REG_NONE, "\0", 2, 0);
-
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@@ -427,6 +433,10 @@ static void test_reg_sz(void)
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_SZ /f", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ todo_wine verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
+
run_reg_exe("reg add HKCU\\" KEY_BASE " /d WineTest /f",
&r);
ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
"got exit code %d, expected 0\n", r);
@@ -501,6 +511,16 @@ static void test_reg_expand_sz(void)
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_EXPAND_SZ /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ todo_wine verify_reg(hkey, NULL, REG_EXPAND_SZ, "", 1, 0);
+
+ todo_wine delete_value(hkey, NULL);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_EXPAND_SZ /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ verify_reg(hkey, NULL, REG_EXPAND_SZ, "", 1, 0);
+
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, expected 0\n", r);
verify_reg(hkey, "expand0", REG_EXPAND_SZ, "dead%PATH%beef", 15,
0);
@@ -521,10 +541,6 @@ static void test_reg_expand_sz(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_EXPAND_SZ /f",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
- verify_reg(hkey, NULL, REG_EXPAND_SZ, "", 1, 0);
-
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@@ -538,15 +554,25 @@ static void test_reg_binary(void)
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0
/f", &r);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /f",
&r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
- verify_reg(hkey, "bin0", REG_BINARY, buffer, 0, 0);
+ todo_wine verify_reg(hkey, NULL, REG_BINARY, buffer, 0, 0);
+
+ todo_wine delete_value(hkey, NULL);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_BINARY /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ verify_reg(hkey, NULL, REG_BINARY, buffer, 0, 0);
run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /t REG_BINARY
/d deadbeef /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
dword = 0xefbeadde;
verify_reg(hkey, "", REG_BINARY, &dword, sizeof(DWORD), 0);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0
/f", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ verify_reg(hkey, "bin0", REG_BINARY, buffer, 0, 0);
+
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin1 /f /d
0xDeAdBeEf", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r);
@@ -579,10 +605,6 @@ static void test_reg_binary(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v bin6 /t REG_BINARY /f
/d", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_BINARY /f",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
- verify_reg(hkey, NULL, REG_BINARY, buffer, 0, 0);
-
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@@ -604,6 +626,9 @@ static void test_reg_dword(void)
else
win_skip("broken reg.exe detected\n");
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_DWORD /f",
&r);
+ ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit
code %u, expected 1\n", r);
+
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword0 /t REG_DWORD /f
/d", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
@@ -667,9 +692,6 @@ static void test_reg_dword(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword15 /t REG_DWORD /d
4294967296 /f", &r);
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit
code %u, expected 1\n", r);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_DWORD /f",
&r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit
code %u, expected 1\n", r);
-
/* REG_DWORD_LITTLE_ENDIAN */
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_LE /t
REG_DWORD_LITTLE_ENDIAN /d 456 /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
@@ -705,6 +727,17 @@ static void test_reg_multi_sz(void)
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ buffer[0] = 0;
+ todo_wine verify_reg(hkey, NULL, REG_MULTI_SZ, buffer, 1, 0);
+
+ todo_wine delete_value(hkey, NULL);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_MULTI_SZ /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
+ verify_reg(hkey, NULL, REG_MULTI_SZ, buffer, 1, 0);
+
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi0 /t REG_MULTI_SZ /d
\"three\\0little\\0strings\" /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
memcpy(buffer, "three\0little\0strings\0", 22);
@@ -786,10 +819,6 @@ static void test_reg_multi_sz(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0",
16, 0);
- run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_MULTI_SZ /f",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
- verify_reg(hkey, NULL, REG_MULTI_SZ, buffer, 1, 0);
-
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index f322b64ccc7..82f3f0400ff 100644
--- a/sdk/tools/winesync/reg.cfg
+++ b/sdk/tools/winesync/reg.cfg
@@ -4,4 +4,4 @@ directories:
files:
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
tags:
- wine: dedcd7c100461cf8be46387ebd65b60488c13ecf
+ wine: 1aae492dcbb2a0a7725a9cff40edd6a355f7fc79