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
559086af
Commit
559086af
authored
Apr 16, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Apr 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Only pass a newly created HKEY if it is used in later tests.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bbdc0cc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
add.c
programs/reg/tests/add.c
+9
-4
delete.c
programs/reg/tests/delete.c
+3
-5
export.c
programs/reg/tests/export.c
+3
-6
No files found.
programs/reg/tests/add.c
View file @
559086af
...
...
@@ -126,10 +126,16 @@ void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const
void
add_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
,
HKEY
*
subkey
)
{
LONG
err
;
HKEY
new_key
;
err
=
RegCreateKeyExA
(
hkey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_READ
|
KEY_WRITE
,
NULL
,
sub
key
,
NULL
);
KEY_READ
|
KEY_WRITE
,
NULL
,
&
new_
key
,
NULL
);
lok
(
err
==
ERROR_SUCCESS
,
"RegCreateKeyExA failed: %d
\n
"
,
err
);
if
(
subkey
)
*
subkey
=
new_key
;
else
RegCloseKey
(
new_key
);
}
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
)
...
...
@@ -315,7 +321,7 @@ static void test_key_formats(void)
static
void
test_add
(
void
)
{
HKEY
hkey
,
hsubkey
;
HKEY
hkey
;
DWORD
r
,
dword
;
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
...
...
@@ -324,8 +330,7 @@ static void test_add(void)
open_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
KEY_WRITE
,
&
hkey
);
/* Test whether overwriting a registry key modifies existing keys and values */
add_key
(
hkey
,
"Subkey"
,
&
hsubkey
);
close_key
(
hsubkey
);
add_key
(
hkey
,
"Subkey"
,
NULL
);
add_value
(
hkey
,
"Test1"
,
REG_SZ
,
"Value1"
,
7
);
dword
=
0x123
;
add_value
(
hkey
,
"Test2"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
));
...
...
programs/reg/tests/delete.c
View file @
559086af
...
...
@@ -21,7 +21,7 @@
static
void
test_delete
(
void
)
{
HKEY
hkey
,
hsubkey
;
HKEY
hkey
;
DWORD
r
;
const
DWORD
deadbeef
=
0xdeadbeef
;
...
...
@@ -75,8 +75,7 @@ static void test_delete(void)
add_value
(
hkey
,
"bar"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
add_value
(
hkey
,
NULL
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
add_key
(
hkey
,
"subkey"
,
&
hsubkey
);
close_key
(
hsubkey
);
add_key
(
hkey
,
"subkey"
,
NULL
);
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
);
...
...
@@ -92,8 +91,7 @@ static void test_delete(void)
verify_key
(
hkey
,
"subkey"
);
/* Test forward and back slashes */
add_key
(
hkey
,
"https://winehq.org"
,
&
hsubkey
);
close_key
(
hsubkey
);
add_key
(
hkey
,
"https://winehq.org"
,
NULL
);
add_value
(
hkey
,
"count/up"
,
REG_SZ
,
"one/two/three"
,
14
);
add_value
(
hkey
,
"
\\
foo
\\
bar"
,
REG_SZ
,
""
,
1
);
...
...
programs/reg/tests/export.c
View file @
559086af
...
...
@@ -291,10 +291,8 @@ static void test_export(void)
/* Test the export order of registry keys */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_key
(
hkey
,
"Subkey2"
,
&
subkey
);
close_key
(
subkey
);
add_key
(
hkey
,
"Subkey1"
,
&
subkey
);
close_key
(
subkey
);
add_key
(
hkey
,
"Subkey2"
,
NULL
);
add_key
(
hkey
,
"Subkey1"
,
NULL
);
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
);
...
...
@@ -405,8 +403,7 @@ static void test_export(void)
/* Test registry export with forward and back slashes */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_key
(
hkey
,
"https://winehq.org"
,
&
subkey
);
close_key
(
subkey
);
add_key
(
hkey
,
"https://winehq.org"
,
NULL
);
add_value
(
hkey
,
"count/up"
,
REG_SZ
,
"one/two/three"
,
14
);
add_value
(
hkey
,
"
\\
foo
\\
bar"
,
REG_SZ
,
""
,
1
);
close_key
(
hkey
);
...
...
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