Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ca57a860
Commit
ca57a860
authored
May 17, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add key and value order tests for the 'copy' command.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f2c18726
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
12 deletions
+66
-12
copy.c
programs/reg/tests/copy.c
+52
-0
export.c
programs/reg/tests/export.c
+12
-12
reg_test.h
programs/reg/tests/reg_test.h
+2
-0
No files found.
programs/reg/tests/copy.c
View file @
ca57a860
...
...
@@ -325,6 +325,56 @@ static void test_copy_complex_data(void)
todo_wine
ok
(
compare_export
(
"file.reg"
,
complex_data_test
,
0
),
"compare_export() failed
\n
"
);
}
static
void
test_copy_key_order
(
void
)
{
HKEY
hkey
;
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_key
(
hkey
,
"Subkey2"
,
NULL
);
add_key
(
hkey
,
"Subkey1"
,
NULL
);
close_key
(
hkey
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
ok
(
compare_export
(
"file.reg"
,
key_order_test
,
0
),
"compare_export() failed
\n
"
);
}
static
void
test_copy_value_order
(
void
)
{
HKEY
hkey
;
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_value
(
hkey
,
"Value 2"
,
REG_SZ
,
"I was added first!"
,
19
);
add_value
(
hkey
,
"Value 1"
,
REG_SZ
,
"I was added second!"
,
20
);
close_key
(
hkey
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
ok
(
compare_export
(
"file.reg"
,
value_order_test
,
0
),
"compare_export() failed
\n
"
);
}
static
void
test_copy_hex_data
(
void
)
{
HKEY
hkey
;
...
...
@@ -498,6 +548,8 @@ START_TEST(copy)
test_copy_empty_key
();
test_copy_simple_data
();
test_copy_complex_data
();
test_copy_key_order
();
test_copy_value_order
();
test_copy_hex_data
();
test_copy_embedded_null_values
();
test_copy_slashes
();
...
...
programs/reg/tests/export.c
View file @
ca57a860
...
...
@@ -99,6 +99,18 @@ const char *complex_data_test =
"@=dword:12345678
\r\n
"
"
\"
43981
\"
=hex(abcd):56,61,6c,75,65,00
\r\n\r\n
"
;
const
char
*
key_order_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1]
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2]
\r\n\r\n
"
;
const
char
*
value_order_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
Value 2
\"
=
\"
I was added first!
\"\r\n
"
"
\"
Value 1
\"
=
\"
I was added second!
\"\r\n\r\n
"
;
const
char
*
empty_hex_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
...
...
@@ -164,18 +176,6 @@ static void test_export(void)
HKEY
hkey
,
subkey
;
BYTE
hex
[
4
],
buffer
[
8
];
const
char
*
key_order_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1]
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2]
\r\n\r\n
"
;
const
char
*
value_order_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
Value 2
\"
=
\"
I was added first!
\"\r\n
"
"
\"
Value 1
\"
=
\"
I was added second!
\"\r\n\r\n
"
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
...
...
programs/reg/tests/reg_test.h
View file @
ca57a860
...
...
@@ -81,6 +81,8 @@ BOOL compare_export_(const char *file, unsigned line, const char *filename,
extern
const
char
*
empty_key_test
;
extern
const
char
*
simple_data_test
;
extern
const
char
*
complex_data_test
;
extern
const
char
*
key_order_test
;
extern
const
char
*
value_order_test
;
extern
const
char
*
empty_hex_test
;
extern
const
char
*
empty_hex_test2
;
extern
const
char
*
hex_types_test
;
...
...
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