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
e6e227f2
Commit
e6e227f2
authored
Feb 22, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Feb 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Move /v* syntax tests to the 'add' and 'delete' test sequences.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
405853ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
38 deletions
+35
-38
reg.c
programs/reg/tests/reg.c
+35
-38
No files found.
programs/reg/tests/reg.c
View file @
e6e227f2
...
@@ -574,6 +574,9 @@ static void test_add(void)
...
@@ -574,6 +574,9 @@ static void test_add(void)
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
/* Test duplicate switches */
/* Test duplicate switches */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v Wine /t REG_DWORD /d 0x1 /v Test /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v dup1 /t REG_DWORD /d 123 /f /t REG_SZ"
,
&
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v dup1 /t REG_DWORD /d 123 /f /t REG_SZ"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
"got exit code %u, expected 1
\n
"
,
r
);
"got exit code %u, expected 1
\n
"
,
r
);
...
@@ -581,6 +584,17 @@ static void test_add(void)
...
@@ -581,6 +584,17 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v dup2 /t REG_DWORD /d 123 /f /d 456"
,
&
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v dup2 /t REG_DWORD /d 123 /f /d 456"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
/* Multiple /v* switches */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v Wine /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* No /v argument */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /d Test /f /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* Test invalid switches */
/* Test invalid switches */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v invalid1 /a"
,
&
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v invalid1 /a"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
...
@@ -618,6 +632,27 @@ static void test_delete(void)
...
@@ -618,6 +632,27 @@ static void test_delete(void)
run_reg_exe
(
"reg delete -H"
,
&
r
);
run_reg_exe
(
"reg delete -H"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
/* Multiple /v* switches */
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /va"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /ve /va"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /v Test /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* No /v argument */
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* Create a test key */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_value
(
hkey
,
"foo"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
add_value
(
hkey
,
"foo"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
add_value
(
hkey
,
"bar"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
add_value
(
hkey
,
"bar"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
...
@@ -757,43 +792,6 @@ static void test_query(void)
...
@@ -757,43 +792,6 @@ static void test_query(void)
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
}
}
static
void
test_v_flags
(
void
)
{
DWORD
r
;
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v Wine /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /va"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /ve /va"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* No /v argument */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /d Test /f /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /f /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
/* Multiple /v switches */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v Wine /t REG_DWORD /d 0x1 /v Test /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg delete HKCU
\\
"
KEY_BASE
" /v Wine /v Test /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
}
static
BOOL
write_file
(
const
void
*
str
,
DWORD
size
)
static
BOOL
write_file
(
const
void
*
str
,
DWORD
size
)
{
{
HANDLE
file
;
HANDLE
file
;
...
@@ -4772,7 +4770,6 @@ START_TEST(reg)
...
@@ -4772,7 +4770,6 @@ START_TEST(reg)
test_add
();
test_add
();
test_delete
();
test_delete
();
test_query
();
test_query
();
test_v_flags
();
test_import
();
test_import
();
test_unicode_import
();
test_unicode_import
();
test_import_with_whitespace
();
test_import_with_whitespace
();
...
...
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