https://git.reactos.org/?p=reactos.git;a=commitdiff;h=22af0f3d732233a344934…
commit 22af0f3d732233a344934dc7ad40374c9f4bb0a1
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 20:07:57 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:28 2022 +0200
[WINESYNC] reg/tests: Split Windows 3.1 'import' tests from reg.c.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id fc5816a61e1f203b5c004d9fd25b43043954f386 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/import.c | 116 ++++++++++++++++++++++++++++++++
modules/rostests/winetests/reg/reg.c | 116 --------------------------------
sdk/tools/winesync/reg.cfg | 2 +-
3 files changed, 117 insertions(+), 117 deletions(-)
diff --git a/modules/rostests/winetests/reg/import.c
b/modules/rostests/winetests/reg/import.c
index 2ed949944a3..5b520f11d5f 100644
--- a/modules/rostests/winetests/reg/import.c
+++ b/modules/rostests/winetests/reg/import.c
@@ -3464,6 +3464,121 @@ static void test_unicode_import_with_whitespace(void)
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
+static void test_import_win31(void)
+{
+ LONG err;
+ HKEY hkey;
+ DWORD dispos, r;
+
+ /* Check if reg.exe is running with elevated privileges */
+ err = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
+ if (err == ERROR_ACCESS_DENIED)
+ {
+ win_skip("reg.exe is not running with elevated privileges; "
+ "skipping Windows 3.1 import tests\n");
+ return;
+ }
+
+ if (dispos == REG_OPENED_EXISTING_KEY)
+ delete_value(hkey, NULL);
+
+ /* Test simple value */
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "Value0", 7, 0);
+
+ /* Test proper handling of spaces and equals signs */
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " =Value1\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "Value1", 7, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, " Value2", 8, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value3 \r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " Value4\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "Value4", 7, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " Value5\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "Value5", 7, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE "\r\n", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "", 1, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " \r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "", 1, 0);
+
+ test_import_str("REGEDIT\r\n"
+ "HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, "", REG_SZ, "No newline", 11, 0);
+
+ delete_value(hkey, NULL);
+
+ /* Test character validity at the start of the line */
+ test_import_str("REGEDIT\r\n"
+ " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1a\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ " HKEY_CLASSES_ROOT\\" KEY_BASE " =
Value1b\r\n", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ "\tHKEY_CLASSES_ROOT\\" KEY_BASE " =
Value1c\r\n", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ ";HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2a\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ "#HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2b\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ /* Test case sensitivity */
+ test_import_str("REGEDIT\r\n"
+ "hkey_classes_root\\" KEY_BASE " = Value3a\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ "hKEY_CLASSES_ROOT\\" KEY_BASE " = Value3b\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ test_import_str("REGEDIT\r\n"
+ "Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg_nonexist(hkey, "");
+
+ close_key(hkey);
+
+ delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
+}
+
START_TEST(import)
{
DWORD r;
@@ -3477,4 +3592,5 @@ START_TEST(import)
test_unicode_import();
test_import_with_whitespace();
test_unicode_import_with_whitespace();
+ test_import_win31();
}
diff --git a/modules/rostests/winetests/reg/reg.c b/modules/rostests/winetests/reg/reg.c
index 9576106fda4..8e98ab6379f 100644
--- a/modules/rostests/winetests/reg/reg.c
+++ b/modules/rostests/winetests/reg/reg.c
@@ -614,121 +614,6 @@ static void test_add(void)
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
}
-static void test_import_31(void)
-{
- LONG err;
- HKEY hkey;
- DWORD dispos, r;
-
- /* Check if reg.exe is running with elevated privileges */
- err = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
- if (err == ERROR_ACCESS_DENIED)
- {
- win_skip("reg.exe is not running with elevated privileges; "
- "skipping Windows 3.1 import tests\n");
- return;
- }
-
- if (dispos == REG_OPENED_EXISTING_KEY)
- delete_value(hkey, NULL);
-
- /* Test simple value */
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value0", 7, 0);
-
- /* Test proper handling of spaces and equals signs */
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " =Value1\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value1", 7, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, " Value2", 8, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value3 \r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " Value4\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value4", 7, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " Value5\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value5", 7, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE "\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "", 1, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " \r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "", 1, 0);
-
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "No newline", 11, 0);
-
- delete_value(hkey, NULL);
-
- /* Test character validity at the start of the line */
- test_import_str("REGEDIT\r\n"
- " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1a\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- " HKEY_CLASSES_ROOT\\" KEY_BASE " =
Value1b\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- "\tHKEY_CLASSES_ROOT\\" KEY_BASE " =
Value1c\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- ";HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2a\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- "#HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2b\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- /* Test case sensitivity */
- test_import_str("REGEDIT\r\n"
- "hkey_classes_root\\" KEY_BASE " = Value3a\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- "hKEY_CLASSES_ROOT\\" KEY_BASE " = Value3b\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- test_import_str("REGEDIT\r\n"
- "Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n",
&r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
-
- close_key(hkey);
-
- delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
-}
-
#define compare_export(f,e,todo) compare_export_(__LINE__,f,e,todo)
static BOOL compare_export_(unsigned line, const char *filename, const char *expected,
DWORD todo)
{
@@ -1199,7 +1084,6 @@ START_TEST(reg)
}
test_add();
- test_import_31();
test_export();
test_copy();
}
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index fcd66610114..3fcc91f3e9f 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: 56d9d0f791046aeab85466e2ebadac63ce457f86
+ wine: fc5816a61e1f203b5c004d9fd25b43043954f386