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
fdceb5ed
Commit
fdceb5ed
authored
Jun 16, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Modify verify_key() to support opening of registry views.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0eb85504
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
77 deletions
+77
-77
add.c
programs/reg/tests/add.c
+9
-9
copy.c
programs/reg/tests/copy.c
+21
-21
delete.c
programs/reg/tests/delete.c
+1
-1
import.c
programs/reg/tests/import.c
+44
-44
reg_test.h
programs/reg/tests/reg_test.h
+2
-2
No files found.
programs/reg/tests/add.c
View file @
fdceb5ed
...
...
@@ -97,12 +97,12 @@ void close_key_(const char *file, unsigned line, HKEY hkey)
lok
(
err
==
ERROR_SUCCESS
,
"RegCloseKey failed: got error %d
\n
"
,
err
);
}
void
verify_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
key_base
,
const
char
*
subkey
)
void
verify_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
)
{
HKEY
hkey
;
LONG
err
;
err
=
RegOpenKeyExA
(
key_base
,
subkey
,
0
,
KEY_READ
,
&
hkey
);
err
=
RegOpenKeyExA
(
root
,
path
,
0
,
KEY_READ
|
sam
,
&
hkey
);
lok
(
err
==
ERROR_SUCCESS
,
"RegOpenKeyExA failed: got error %d
\n
"
,
err
);
if
(
hkey
)
...
...
@@ -302,15 +302,15 @@ static void test_key_formats(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
keytest3
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"keytest3"
);
verify_key
(
hkey
,
"keytest3"
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
keytest4 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"keytest4"
);
verify_key
(
hkey
,
"keytest4"
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
https://winehq.org /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"https://winehq.org"
);
verify_key
(
hkey
,
"https://winehq.org"
,
0
);
close_key
(
hkey
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
...
...
@@ -384,8 +384,8 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
hkey
,
"Subkey"
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
verify_key
(
hkey
,
"Subkey"
,
0
);
verify_reg
(
hkey
,
"Test1"
,
REG_SZ
,
"Value1"
,
7
,
0
);
verify_reg
(
hkey
,
"Test2"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
""
,
1
,
0
);
...
...
@@ -393,8 +393,8 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_NONE /d Test /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
hkey
,
"Subkey"
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
verify_key
(
hkey
,
"Subkey"
,
0
);
verify_reg
(
hkey
,
"Test1"
,
REG_SZ
,
"Value1"
,
7
,
0
);
verify_reg
(
hkey
,
"Test2"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
NULL
,
REG_NONE
,
"T
\0
e
\0
s
\0
t
\0\0
"
,
10
,
0
);
...
...
programs/reg/tests/copy.c
View file @
fdceb5ed
...
...
@@ -137,7 +137,7 @@ static void test_copy_empty_key(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -148,7 +148,7 @@ static void test_copy_empty_key(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -159,7 +159,7 @@ static void test_copy_empty_key(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -170,7 +170,7 @@ static void test_copy_empty_key(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -179,7 +179,7 @@ static void test_copy_empty_key(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -207,7 +207,7 @@ static void test_copy_simple_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -218,7 +218,7 @@ static void test_copy_simple_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -229,7 +229,7 @@ static void test_copy_simple_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -240,7 +240,7 @@ static void test_copy_simple_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -249,7 +249,7 @@ static void test_copy_simple_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -309,7 +309,7 @@ static void test_copy_complex_data(void)
/* Copy values only */
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -318,7 +318,7 @@ static void test_copy_complex_data(void)
/* Copy subkeys and values */
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -343,7 +343,7 @@ static void test_copy_key_order(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -368,7 +368,7 @@ static void test_copy_value_order(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -400,7 +400,7 @@ static void test_copy_hex_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -419,7 +419,7 @@ static void test_copy_hex_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -438,7 +438,7 @@ static void test_copy_hex_data(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -470,7 +470,7 @@ static void test_copy_embedded_null_values(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -496,7 +496,7 @@ static void test_copy_slashes(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /s /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -525,7 +525,7 @@ static void test_copy_escaped_null_values(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -559,7 +559,7 @@ static void test_copy_key_class(void)
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
open_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
&
hkey
);
verify_reg
(
hkey
,
"String"
,
REG_SZ
,
"Data"
,
5
,
0
);
...
...
programs/reg/tests/delete.c
View file @
fdceb5ed
...
...
@@ -88,7 +88,7 @@ static void test_delete(void)
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /va /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
"foo"
);
verify_key
(
hkey
,
"subkey"
);
verify_key
(
hkey
,
"subkey"
,
0
);
/* Test forward and back slashes */
add_key
(
hkey
,
"https://winehq.org"
,
NULL
);
...
...
programs/reg/tests/import.c
View file @
fdceb5ed
...
...
@@ -895,21 +895,21 @@ static void test_import(void)
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1c "
);
verify_key
(
hkey
,
"Subkey1c "
,
0
);
delete_key
(
hkey
,
"Subkey1c "
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1d
\t
]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1d
\t
"
);
verify_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
delete_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1e
\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1e
\\
"
);
verify_key
(
hkey
,
"Subkey1e"
);
verify_key
(
hkey
,
"Subkey1e
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1e"
,
0
);
open_key
(
hkey
,
"Subkey1e"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -919,9 +919,9 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1f
\\\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1f
\\\\
"
);
verify_key
(
hkey
,
"Subkey1f
\\
"
);
verify_key
(
hkey
,
"Subkey1f"
);
verify_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1f
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1f"
,
0
);
open_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -931,10 +931,10 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1g
\\\\\\\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1g
\\\\\\\\
"
);
verify_key
(
hkey
,
"Subkey1g
\\\\
"
);
verify_key
(
hkey
,
"Subkey1g
\\
"
);
verify_key
(
hkey
,
"Subkey1g"
);
verify_key
(
hkey
,
"Subkey1g
\\\\\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g"
,
0
);
open_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -945,28 +945,28 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[ -HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[
\t
-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[- HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[-
\t
HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n\n
"
...
...
@@ -980,8 +980,8 @@ static void test_import(void)
"[hkey_CURRENT_user
\\
"
KEY_BASE
"
\\
Subkey3a]
\n\n
"
"[HkEy_CuRrEnT_uSeR
\\
"
KEY_BASE
"
\\
SuBkEy3b]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey3a"
);
verify_key
(
hkey
,
"Subkey3b"
);
verify_key
(
hkey
,
"Subkey3a"
,
0
);
verify_key
(
hkey
,
"Subkey3b"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[-HKEY_current_USER
\\
"
KEY_BASE
"
\\
sUBKEY3A]
\n\n
"
...
...
@@ -994,7 +994,7 @@ static void test_import(void)
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey4a]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey4a"
);
verify_key
(
hkey
,
"Subkey4a"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n\n
"
...
...
@@ -1181,7 +1181,7 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
"Wine54b"
);
verify_key
(
hkey
,
"Subkey2"
);
verify_key
(
hkey
,
"Subkey2"
,
0
);
delete_key
(
hkey
,
"Subkey2"
,
0
);
...
...
@@ -1616,7 +1616,7 @@ static void test_import(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"count/up"
,
REG_SZ
,
"one/two/three"
,
14
,
0
);
verify_reg
(
hkey
,
"
\\
foo
\\
bar"
,
REG_SZ
,
""
,
1
,
0
);
verify_key
(
hkey
,
"https://winehq.org"
);
verify_key
(
hkey
,
"https://winehq.org"
,
0
);
close_key
(
hkey
);
...
...
@@ -2434,21 +2434,21 @@ static void test_unicode_import(void)
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1c "
);
verify_key
(
hkey
,
"Subkey1c "
,
0
);
delete_key
(
hkey
,
"Subkey1c "
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1d
\t
]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1d
\t
"
);
verify_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
delete_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1e
\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1e
\\
"
);
verify_key
(
hkey
,
"Subkey1e"
);
verify_key
(
hkey
,
"Subkey1e
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1e"
,
0
);
open_key
(
hkey
,
"Subkey1e"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -2458,9 +2458,9 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1f
\\\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1f
\\\\
"
);
verify_key
(
hkey
,
"Subkey1f
\\
"
);
verify_key
(
hkey
,
"Subkey1f"
);
verify_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1f
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1f"
,
0
);
open_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -2470,10 +2470,10 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1g
\\\\\\\\
]
\n
"
"
\"
Wine
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1g
\\\\\\\\
"
);
verify_key
(
hkey
,
"Subkey1g
\\\\
"
);
verify_key
(
hkey
,
"Subkey1g
\\
"
);
verify_key
(
hkey
,
"Subkey1g"
);
verify_key
(
hkey
,
"Subkey1g
\\\\\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g
\\
"
,
0
);
verify_key
(
hkey
,
"Subkey1g"
,
0
);
open_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
...
...
@@ -2484,28 +2484,28 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[ -HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[
\t
-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[- HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2a"
);
verify_key
(
hkey
,
"Subkey2a"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[-
\t
HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey2b"
);
verify_key
(
hkey
,
"Subkey2b"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2a]
\n\n
"
...
...
@@ -2519,8 +2519,8 @@ static void test_unicode_import(void)
"[hkey_CURRENT_user
\\
"
KEY_BASE
"
\\
Subkey3a]
\n\n
"
"[HkEy_CuRrEnT_uSeR
\\
"
KEY_BASE
"
\\
SuBkEy3b]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey3a"
);
verify_key
(
hkey
,
"Subkey3b"
);
verify_key
(
hkey
,
"Subkey3a"
,
0
);
verify_key
(
hkey
,
"Subkey3b"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[-HKEY_current_USER
\\
"
KEY_BASE
"
\\
sUBKEY3A]
\n\n
"
...
...
@@ -2533,7 +2533,7 @@ static void test_unicode_import(void)
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey4a]
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey4a"
);
verify_key
(
hkey
,
"Subkey4a"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n\n
"
...
...
@@ -2723,7 +2723,7 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey2]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
"Wine54b"
);
verify_key
(
hkey
,
"Subkey2"
);
verify_key
(
hkey
,
"Subkey2"
,
0
);
delete_key
(
hkey
,
"Subkey2"
,
0
);
...
...
@@ -3165,7 +3165,7 @@ static void test_unicode_import(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"count/up"
,
REG_SZ
,
"one/two/three"
,
14
,
0
);
verify_reg
(
hkey
,
"
\\
foo
\\
bar"
,
REG_SZ
,
""
,
1
,
0
);
verify_key
(
hkey
,
"https://winehq.org"
);
verify_key
(
hkey
,
"https://winehq.org"
,
0
);
close_key
(
hkey
);
...
...
programs/reg/tests/reg_test.h
View file @
fdceb5ed
...
...
@@ -52,8 +52,8 @@ void open_key_(const char *file, unsigned line, HKEY root, const char *path, REG
#define close_key(k) close_key_(__FILE__,__LINE__,k)
void
close_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
hkey
);
#define verify_key(
k,s) verify_key_(__FILE__,__LINE__,k
,s)
void
verify_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
key_base
,
const
char
*
subkey
);
#define verify_key(
r,p,s) verify_key_(__FILE__,__LINE__,r,p
,s)
void
verify_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
#define verify_key_nonexist(k,s) verify_key_nonexist_(__FILE__,__LINE__,k,s)
void
verify_key_nonexist_
(
const
char
*
file
,
unsigned
line
,
HKEY
key_base
,
const
char
*
subkey
);
...
...
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