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
be3a4c26
Commit
be3a4c26
authored
Dec 07, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Dec 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add verify_reg_nonexist helper function.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eda5d61c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
reg.c
programs/reg/tests/reg.c
+13
-6
No files found.
programs/reg/tests/reg.c
View file @
be3a4c26
...
...
@@ -81,6 +81,16 @@ static void verify_reg_(unsigned line, HKEY hkey, const char* value,
lok
(
memcmp
(
data
,
exp_data
,
size
)
==
0
,
"got wrong data
\n
"
);
}
#define verify_reg_nonexist(k,v) verify_reg_nonexist_(__LINE__,k,v)
static
void
verify_reg_nonexist_
(
unsigned
line
,
HKEY
hkey
,
const
char
*
value
)
{
LONG
err
;
err
=
RegQueryValueExA
(
hkey
,
value
,
NULL
,
NULL
,
NULL
,
NULL
);
lok
(
err
==
ERROR_FILE_NOT_FOUND
,
"registry value '%s' shouldn't exist; got %d, expected 2
\n
"
,
value
,
err
);
}
static
void
test_add
(
void
)
{
HKEY
hkey
,
subkey
;
...
...
@@ -499,18 +509,15 @@ static void test_delete(void)
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v bar /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegQueryValueExA
(
hkey
,
"bar"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
verify_reg_nonexist
(
hkey
,
"bar"
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /ve /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegQueryValueExA
(
hkey
,
""
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d, expected 2
\n
"
,
err
);
verify_reg_nonexist
(
hkey
,
""
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /va /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegQueryValueExA
(
hkey
,
"foo"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
verify_reg_nonexist
(
hkey
,
"foo"
);
err
=
RegOpenKeyExA
(
hkey
,
"subkey"
,
0
,
KEY_READ
,
&
hsubkey
);
ok
(
err
==
ERROR_SUCCESS
,
"got %d
\n
"
,
err
);
RegCloseKey
(
hsubkey
);
...
...
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