https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e89696846fa18e589202f…
commit e89696846fa18e589202f9ad1151828413cd9838
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Jan 17 18:47:36 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:38 2022 +0200
[WINESYNC] reg/tests: Split 'query' syntax tests into a separate function.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id a899d743c585fe8004c41f12cf0a080ebe622fd1 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/query.c | 54 +++++++++++++++++++---------------
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/modules/rostests/winetests/reg/query.c
b/modules/rostests/winetests/reg/query.c
index 270f0aad75d..f5ba32f97e3 100644
--- a/modules/rostests/winetests/reg/query.c
+++ b/modules/rostests/winetests/reg/query.c
@@ -105,6 +105,35 @@ static void compare_query_(const char *file, unsigned line, const
BYTE *buf,
/* Unit tests */
+static void test_command_syntax(void)
+{
+ DWORD r;
+
+ run_reg_exe("reg query", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg query /?", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg query /h", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg query -H", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg query HKCU\\" KEY_BASE " /v", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg query HKCU\\" KEY_BASE " /v Test1 /v Test2",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg query HKCU\\" KEY_BASE " /v Test1 /ve",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg query HKCU\\" KEY_BASE " /s /s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+}
+
static void test_query(void)
{
const char *test1 = "\r\n"
@@ -167,18 +196,6 @@ static void test_query(void)
delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0);
- run_reg_exe("reg query", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
-
- run_reg_exe("reg query /?", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
-
- run_reg_exe("reg query /h", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
-
- run_reg_exe("reg query -H", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
-
/* Key not present */
run_reg_exe("reg query HKCU\\" KEY_BASE, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
@@ -188,21 +205,9 @@ static void test_query(void)
add_value(hkey, "Test1", REG_SZ, "Hello, World", 13);
add_value(hkey, "Test2", REG_DWORD, &dword, sizeof(dword));
- run_reg_exe("reg query HKCU\\" KEY_BASE " /v", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
-
run_reg_exe("reg query HKCU\\" KEY_BASE " /v Missing", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg query HKCU\\" KEY_BASE " /v Test1 /v Test2",
&r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
-
- run_reg_exe("reg query HKCU\\" KEY_BASE " /v Test1 /ve",
&r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
-
- run_reg_exe("reg query HKCU\\" KEY_BASE " /s /s", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
-
read_reg_output("reg query HKCU\\" KEY_BASE, buf, sizeof(buf), &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
compare_query(buf, test1, FALSE, 0);
@@ -300,5 +305,6 @@ START_TEST(query)
return;
}
+ test_command_syntax();
test_query();
}
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 7f559185a17..60ba2410111 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: 31f070f7d3e312942d72e774a4a7dbd21b655a31
+ wine: a899d743c585fe8004c41f12cf0a080ebe622fd1