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
e8b260f0
Commit
e8b260f0
authored
Jun 26, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Use the verify_key*() functions where possible.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ceebbfc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
24 deletions
+13
-24
reg.c
programs/reg/tests/reg.c
+13
-24
No files found.
programs/reg/tests/reg.c
View file @
e8b260f0
...
...
@@ -120,7 +120,7 @@ static void verify_key_nonexist_(unsigned line, HKEY key_base, const char *subke
static
void
test_add
(
void
)
{
HKEY
hkey
,
subkey
;
HKEY
hkey
;
LONG
err
;
DWORD
r
,
dword
,
type
,
size
;
char
buffer
[
22
];
...
...
@@ -134,8 +134,7 @@ static void test_add(void)
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
);
ok
(
err
==
ERROR_SUCCESS
||
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
err
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
KEY_READ
,
&
hkey
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -167,18 +166,14 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
keytest3
\\
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
err
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
keytest3"
,
0
,
KEY_READ
,
&
subkey
);
ok
(
err
==
ERROR_SUCCESS
,
"key creation failed, got %d
\n
"
,
err
);
RegCloseKey
(
subkey
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
keytest3"
);
verify_key
(
hkey
,
"keytest3"
);
err
=
RegDeleteKeyA
(
hkey
,
"keytest3"
);
ok
(
err
==
ERROR_SUCCESS
,
"got exit code %d
\n
"
,
err
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
"
\\
keytest4 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
err
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
keytest4"
,
0
,
KEY_READ
,
&
subkey
);
ok
(
err
==
ERROR_SUCCESS
,
"key creation failed, got %d
\n
"
,
err
);
RegCloseKey
(
subkey
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
keytest4"
);
verify_key
(
hkey
,
"keytest4"
);
err
=
RegDeleteKeyA
(
hkey
,
"keytest4"
);
ok
(
err
==
ERROR_SUCCESS
,
"got exit code %d
\n
"
,
err
);
/* REG_NONE */
...
...
@@ -545,15 +540,13 @@ 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"
);
err
=
RegOpenKeyExA
(
hkey
,
"subkey"
,
0
,
KEY_READ
,
&
hsubkey
);
ok
(
err
==
ERROR_SUCCESS
,
"got %d
\n
"
,
err
);
RegCloseKey
(
hsubkey
);
verify_key
(
hkey
,
"subkey"
);
RegCloseKey
(
hkey
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
KEY_READ
,
&
hkey
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
...
...
@@ -1435,15 +1428,13 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\\n
"
"Subkey1]
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey1"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d, expected 2
\n
"
,
err
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey1"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\n
"
"
\\
Subkey2]
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey2"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d, expected 2
\n
"
,
err
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey2"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -2441,15 +2432,13 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\\n
"
"Subkey1]
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey1"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d, expected 2
\n
"
,
err
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey1"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\n
"
"
\\
Subkey2]
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey2"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d, expected 2
\n
"
,
err
);
todo_wine
verify_key_nonexist
(
hkey
,
"Subkey2"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
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