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
1ce21dbb
Commit
1ce21dbb
authored
Apr 28, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Rework syntax tests for the 'copy' operation.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
33cfc644
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
copy.c
programs/reg/tests/copy.c
+15
-17
No files found.
programs/reg/tests/copy.c
View file @
1ce21dbb
...
@@ -18,15 +18,12 @@
...
@@ -18,15 +18,12 @@
#include "reg_test.h"
#include "reg_test.h"
#define COPY_
DEST
KEY_WINE "\\reg_copy"
#define COPY_
SRC
KEY_WINE "\\reg_copy"
static
void
test_co
py
(
void
)
static
void
test_co
mmand_syntax
(
void
)
{
{
DWORD
r
;
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
run_reg_exe
(
"reg copy"
,
&
r
);
run_reg_exe
(
"reg copy"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
@@ -63,37 +60,38 @@ static void test_copy(void)
...
@@ -63,37 +60,38 @@ static void test_copy(void)
run_reg_exe
(
"reg copy /f /s"
,
&
r
);
run_reg_exe
(
"reg copy /f /s"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" /f"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" foo /f"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" foo /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy /f HK
EY_CURRENT_USER
\\
"
KEY_BASE
" HKEY_CURRENT_USER
\\
"
KEY_BASE
,
&
r
);
run_reg_exe
(
"reg copy /f HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
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
);
run_reg_exe
(
"reg copy
HKCU
\\
"
COPY_SRC
" /f HKCU
\\
"
KEY_BASE
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" /f HKEY_CURRENT_USER
\\
"
COPY_DEST
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" /s HKCU
\\
"
KEY_BASE
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" /s HKEY_CURRENT_USER
\\
"
COPY_DEST
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /a"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" HKEY_CURRENT_USER
\\
"
COPY_DEST
"
/a"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f
/a"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" HKEY_CURRENT_USER
\\
"
COPY_DEST
" /f /a
"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
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
,
&
r
);
/* Source and destination keys are the same */
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
COPY_SRC
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" HKEY_CURRENT_USER
\\
"
KEY_BASE
" /f"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
COPY_SRC
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy HK
EY_CURRENT_USER
\\
"
KEY_BASE
" HKEY_CURRENT_USER
\\
"
KEY_BASE
" /s /f"
,
&
r
);
run_reg_exe
(
"reg copy HK
CU
\\
"
COPY_SRC
" HKCU
\\
"
COPY_SRC
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
}
}
...
@@ -106,5 +104,5 @@ START_TEST(copy)
...
@@ -106,5 +104,5 @@ START_TEST(copy)
return
;
return
;
}
}
test_co
py
();
test_co
mmand_syntax
();
}
}
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