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
ba0a7b0f
Commit
ba0a7b0f
authored
Sep 25, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Use a helper function to delete registry values.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
08a2a019
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
reg.c
programs/reg/tests/reg.c
+14
-10
No files found.
programs/reg/tests/reg.c
View file @
ba0a7b0f
...
...
@@ -180,6 +180,15 @@ static void add_value_(unsigned line, HKEY hkey, const char *name, DWORD type,
lok
(
err
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
err
);
}
#define delete_value(k,n) delete_value_(__LINE__,k,n)
static
void
delete_value_
(
unsigned
line
,
const
HKEY
hkey
,
const
char
*
name
)
{
LONG
err
;
err
=
RegDeleteValueA
(
hkey
,
name
);
lok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValueA failed: %d
\n
"
,
err
);
}
static
void
test_add
(
void
)
{
HKEY
hkey
;
...
...
@@ -2058,8 +2067,7 @@ static void test_import(void)
verify_reg_nonexist
(
hkey
,
"Wine57i"
);
verify_reg
(
hkey
,
"Wine57j"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %u
\n
"
,
err
);
delete_value
(
hkey
,
NULL
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -2087,8 +2095,7 @@ static void test_import(void)
verify_reg_nonexist
(
hkey
,
"Wine58c"
);
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
"Default value 3"
,
16
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %u
\n
"
,
err
);
delete_value
(
hkey
,
NULL
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -3542,8 +3549,7 @@ static void test_unicode_import(void)
verify_reg_nonexist
(
hkey
,
"Wine57i"
);
verify_reg
(
hkey
,
"Wine57j"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %u
\n
"
,
err
);
delete_value
(
hkey
,
NULL
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -3571,8 +3577,7 @@ static void test_unicode_import(void)
verify_reg_nonexist
(
hkey
,
"Wine58c"
);
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
"Default value 3"
,
16
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %u
\n
"
,
err
);
delete_value
(
hkey
,
NULL
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -4201,8 +4206,7 @@ static void test_import_31(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
""
,
REG_SZ
,
"No newline"
,
11
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %d
\n
"
,
err
);
delete_value
(
hkey
,
NULL
);
/* Test character validity at the start of the line */
test_import_str
(
"REGEDIT
\r\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