Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6cf0e7fe
Commit
6cf0e7fe
authored
Feb 09, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Feb 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add initial syntax tests for 'reg copy'.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5423e0d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
1 deletion
+79
-1
reg.c
programs/reg/tests/reg.c
+79
-1
No files found.
programs/reg/tests/reg.c
View file @
6cf0e7fe
...
...
@@ -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
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment