Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
9780dfc0
Commit
9780dfc0
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_nonexist() to support registry views.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fdceb5ed
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
62 deletions
+61
-62
add.c
programs/reg/tests/add.c
+6
-7
copy.c
programs/reg/tests/copy.c
+18
-18
delete.c
programs/reg/tests/delete.c
+3
-3
export.c
programs/reg/tests/export.c
+1
-1
import.c
programs/reg/tests/import.c
+30
-30
query.c
programs/reg/tests/query.c
+1
-1
reg_test.h
programs/reg/tests/reg_test.h
+2
-2
No files found.
programs/reg/tests/add.c
View file @
9780dfc0
...
...
@@ -109,14 +109,13 @@ void verify_key_(const char *file, unsigned line, HKEY root, const char *path, R
RegCloseKey
(
hkey
);
}
void
verify_key_nonexist_
(
const
char
*
file
,
unsigned
line
,
HKEY
key_base
,
const
char
*
subkey
)
void
verify_key_nonexist_
(
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
);
lok
(
err
==
ERROR_FILE_NOT_FOUND
,
"registry key '%s' shouldn't exist; got %d, expected 2
\n
"
,
subkey
,
err
);
err
=
RegOpenKeyExA
(
root
,
path
,
0
,
KEY_READ
|
sam
,
&
hkey
);
lok
(
err
==
ERROR_FILE_NOT_FOUND
,
"registry key '%s' shouldn't exist; got %d, expected 2
\n
"
,
path
,
err
);
if
(
hkey
)
RegCloseKey
(
hkey
);
...
...
@@ -221,7 +220,7 @@ static void test_command_syntax(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg add"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -287,11 +286,11 @@ static void test_key_formats(void)
run_reg_exe
(
"reg add
\\
HKCU
\\
"
KEY_BASE
"
\\
keytest0 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"keytest0"
);
verify_key_nonexist
(
hkey
,
"keytest0"
,
0
);
run_reg_exe
(
"reg add
\\\\
HKCU
\\
"
KEY_BASE
"
\\
keytest1 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"keytest1"
);
verify_key_nonexist
(
hkey
,
"keytest1"
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
keytest2
\\\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
...
...
programs/reg/tests/copy.c
View file @
9780dfc0
...
...
@@ -127,10 +127,10 @@ static void test_copy_empty_key(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
NULL
);
...
...
@@ -192,10 +192,10 @@ static void test_copy_simple_data(void)
DWORD
r
,
dword
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
...
...
@@ -262,10 +262,10 @@ static void test_copy_complex_data(void)
DWORD
r
,
dword
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
...
...
@@ -331,10 +331,10 @@ static void test_copy_key_order(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_key
(
hkey
,
"Subkey2"
,
NULL
);
...
...
@@ -356,10 +356,10 @@ static void test_copy_value_order(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_value
(
hkey
,
"Value 2"
,
REG_SZ
,
"I was added first!"
,
19
);
...
...
@@ -381,10 +381,10 @@ static void test_copy_hex_data(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Try copying empty hex values */
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
...
...
@@ -450,10 +450,10 @@ static void test_copy_embedded_null_values(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
COPY_SRC
"]
\n
"
...
...
@@ -483,10 +483,10 @@ static void test_copy_slashes(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_key
(
hkey
,
"https://winehq.org"
,
NULL
);
...
...
@@ -509,10 +509,10 @@ static void test_copy_escaped_null_values(void)
DWORD
r
;
delete_tree
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
add_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
&
hkey
);
add_value
(
hkey
,
"Wine5a"
,
REG_SZ
,
"
\\
0"
,
3
);
...
...
programs/reg/tests/delete.c
View file @
9780dfc0
...
...
@@ -26,7 +26,7 @@ static void test_delete(void)
const
DWORD
deadbeef
=
0xdeadbeef
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg delete"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -97,7 +97,7 @@ static void test_delete(void)
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
"
\\
https://winehq.org /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"https://winehq.org"
);
verify_key_nonexist
(
hkey
,
"https://winehq.org"
,
0
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v count/up /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -127,7 +127,7 @@ static void test_delete(void)
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
programs/reg/tests/export.c
View file @
9780dfc0
...
...
@@ -177,7 +177,7 @@ static void test_export(void)
BYTE
hex
[
4
],
buffer
[
8
];
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg export"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
programs/reg/tests/import.c
View file @
9780dfc0
...
...
@@ -79,7 +79,7 @@ static void test_import(void)
BYTE
hex
[
8
];
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg import"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -695,13 +695,13 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\\n
"
"Subkey1]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\n
"
"
\\
Subkey2]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey2"
);
verify_key_nonexist
(
hkey
,
"Subkey2"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -875,22 +875,22 @@ static void test_import(void)
test_import_str
(
"REGEDIT4
\n\n
"
"HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
No_Opening_Bracket]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"No_Opening_Bracket"
);
verify_key_nonexist
(
hkey
,
"No_Opening_Bracket"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
No_Closing_Bracket
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"No_Closing_Bracket"
);
verify_key_nonexist
(
hkey
,
"No_Closing_Bracket"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[ HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1a"
);
verify_key_nonexist
(
hkey
,
"Subkey1a"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[
\t
HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1b"
);
verify_key_nonexist
(
hkey
,
"Subkey1b"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
...
...
@@ -972,8 +972,8 @@ 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_nonexist
(
hkey
,
"Subkey2a"
);
verify_key_nonexist
(
hkey
,
"Subkey2b"
);
verify_key_nonexist
(
hkey
,
"Subkey2a"
,
0
);
verify_key_nonexist
(
hkey
,
"Subkey2b"
,
0
);
/* Test case sensitivity when creating and deleting registry keys. */
test_import_str
(
"REGEDIT4
\n\n
"
...
...
@@ -987,8 +987,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_nonexist
(
hkey
,
"Subkey3a"
);
verify_key_nonexist
(
hkey
,
"Subkey3b"
);
verify_key_nonexist
(
hkey
,
"Subkey3a"
,
0
);
verify_key_nonexist
(
hkey
,
"Subkey3b"
,
0
);
/* Test mixed key creation and deletion. We start by creating a subkey. */
test_import_str
(
"REGEDIT4
\n\n
"
...
...
@@ -1001,7 +1001,7 @@ static void test_import(void)
"[-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey4a]
\n
"
"
\"
Wine46a
\"
=dword:12345678
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey4a"
);
verify_key_nonexist
(
hkey
,
"Subkey4a"
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
test_import_str
(
"REGEDIT4
\n\n
"
...
...
@@ -1009,7 +1009,7 @@ static void test_import(void)
"[HKEY_CURRENT_USERS
\\
"
KEY_BASE
"
\\
Subkey4b]
\n
"
"
\"
Wine46b
\"
=dword:12345678
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey4b"
);
verify_key_nonexist
(
hkey
,
"Subkey4b"
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
/* Test value deletion. We start by creating some registry values. */
...
...
@@ -1173,7 +1173,7 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
"Wine54a"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -1632,7 +1632,7 @@ static void test_unicode_import(void)
BYTE
hex
[
8
];
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
test_import_wstr
(
"REGEDIT
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
)
/* WinXP */
,
...
...
@@ -2234,13 +2234,13 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\\n
"
"Subkey1]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\n
"
"
\\
Subkey2]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey2"
);
verify_key_nonexist
(
hkey
,
"Subkey2"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -2414,22 +2414,22 @@ 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
"
\\
No_Opening_Bracket]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"No_Opening_Bracket"
);
verify_key_nonexist
(
hkey
,
"No_Opening_Bracket"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
No_Closing_Bracket
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"No_Closing_Bracket"
);
verify_key_nonexist
(
hkey
,
"No_Closing_Bracket"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[ HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1a]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1a"
);
verify_key_nonexist
(
hkey
,
"Subkey1a"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[
\t
HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1b]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey1b"
);
verify_key_nonexist
(
hkey
,
"Subkey1b"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
...
...
@@ -2511,8 +2511,8 @@ 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_nonexist
(
hkey
,
"Subkey2a"
);
verify_key_nonexist
(
hkey
,
"Subkey2b"
);
verify_key_nonexist
(
hkey
,
"Subkey2a"
,
0
);
verify_key_nonexist
(
hkey
,
"Subkey2b"
,
0
);
/* Test case sensitivity when creating and deleting registry keys. */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -2526,8 +2526,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_nonexist
(
hkey
,
"Subkey3a"
);
verify_key_nonexist
(
hkey
,
"Subkey3b"
);
verify_key_nonexist
(
hkey
,
"Subkey3a"
,
0
);
verify_key_nonexist
(
hkey
,
"Subkey3b"
,
0
);
/* Test mixed key creation and deletion. We start by creating a subkey. */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -2540,7 +2540,7 @@ static void test_unicode_import(void)
"[-HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey4a]
\n
"
"
\"
Wine46a
\"
=dword:12345678
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey4a"
);
verify_key_nonexist
(
hkey
,
"Subkey4a"
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -2548,7 +2548,7 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USERS
\\
"
KEY_BASE
"
\\
Subkey4b]
\n
"
"
\"
Wine46b
\"
=dword:12345678
\n\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key_nonexist
(
hkey
,
"Subkey4b"
);
verify_key_nonexist
(
hkey
,
"Subkey4b"
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
/* Test value deletion. We start by creating some registry values. */
...
...
@@ -2715,7 +2715,7 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
"Wine54a"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
);
verify_key_nonexist
(
hkey
,
"Subkey1"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -3178,7 +3178,7 @@ static void test_import_with_whitespace(void)
DWORD
r
,
dword
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
test_import_str
(
" REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n\n
"
,
&
r
);
...
...
@@ -3324,7 +3324,7 @@ static void test_unicode_import_with_whitespace(void)
DWORD
r
,
dword
;
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n\n
"
,
&
r
);
...
...
programs/reg/tests/query.c
View file @
9780dfc0
...
...
@@ -165,7 +165,7 @@ static void test_query(void)
BYTE
buf
[
512
];
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg query"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
programs/reg/tests/reg_test.h
View file @
9780dfc0
...
...
@@ -55,8 +55,8 @@ void close_key_(const char *file, unsigned line, HKEY hkey);
#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
);
#define verify_key_nonexist(
r,p,s) verify_key_nonexist_(__FILE__,__LINE__,r,p
,s)
void
verify_key_nonexist_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
#define add_key(k,p,s) add_key_(__FILE__,__LINE__,k,p,s)
void
add_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
,
HKEY
*
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