https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ee54c258719705b0b3a92…
commit ee54c258719705b0b3a92ef5ecf69b7591da9e6d
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 14:51:44 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:27 2022 +0200
[WINESYNC] reg/tests: Add initial syntax tests for 'reg copy'.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 6cf0e7fe85ba2f9348cec4d4d555c5dac42033de by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/reg.c | 80 +++++++++++++++++++++++++++++++++++-
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 80 insertions(+), 2 deletions(-)
diff --git a/modules/rostests/winetests/reg/reg.c b/modules/rostests/winetests/reg/reg.c
index ea4e128da5a..afba8424c1a 100644
--- a/modules/rostests/winetests/reg/reg.c
+++ b/modules/rostests/winetests/reg/reg.c
@@ -21,7 +21,8 @@
#include "wine/test.h"
#define lok ok_(__FILE__,line)
-#define KEY_BASE "Software\\Wine\\reg_test"
+#define KEY_WINE "Software\\Wine"
+#define KEY_BASE KEY_WINE "\\reg_test"
#define REG_EXIT_SUCCESS 0
#define REG_EXIT_FAILURE 1
#define TODO_REG_TYPE (0x0001u)
@@ -4684,6 +4685,82 @@ static void test_export(void)
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
+#define COPY_DEST KEY_WINE "\\reg_copy"
+
+static void test_copy(void)
+{
+ DWORD r;
+
+ run_reg_exe("reg copy", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /?", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg copy /h", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg copy -H", &r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ run_reg_exe("reg copy /? /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /h /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /? /s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /h /s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /s /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /f /s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /f",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " foo /f",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE "
HKEY_CURRENT_USER\\" KEY_BASE" /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /f HKEY_CURRENT_USER\\" KEY_BASE "
HKEY_CURRENT_USER\\" KEY_BASE, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy /f HKEY_CURRENT_USER\\" KEY_BASE "
HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /f
HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /s
HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" COPY_DEST "
HKEY_CURRENT_USER\\" KEY_BASE, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" COPY_DEST "
HKEY_CURRENT_USER\\" KEY_BASE, &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE "
HKEY_CURRENT_USER\\" COPY_DEST "/a", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE "
HKEY_CURRENT_USER\\" COPY_DEST "/f /a", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+}
+
START_TEST(reg)
{
DWORD r;
@@ -4702,4 +4779,5 @@ START_TEST(reg)
test_unicode_import_with_whitespace();
test_import_31();
test_export();
+ test_copy();
}
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 006dabe76f1..3b785ba86af 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: f81d15beb690c5e08c5995b90aec8015218bee55
+ wine: 6cf0e7fe85ba2f9348cec4d4d555c5dac42033de