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
a899d743
Commit
a899d743
authored
Jun 28, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Split 'query' syntax tests into a separate function.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
31f070f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
+30
-24
query.c
programs/reg/tests/query.c
+30
-24
No files found.
programs/reg/tests/query.c
View file @
a899d743
...
...
@@ -105,6 +105,35 @@ static void compare_query_(const char *file, unsigned line, const BYTE *buf,
/* Unit tests */
static
void
test_command_syntax
(
void
)
{
DWORD
r
;
run_reg_exe
(
"reg query"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query /?"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query /h"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query -H"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v Test1 /v Test2"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v Test1 /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /s /s"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
}
static
void
test_query
(
void
)
{
const
char
*
test1
=
"
\r\n
"
...
...
@@ -167,18 +196,6 @@ static void test_query(void)
delete_tree
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
verify_key_nonexist
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg query"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query /?"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query /h"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query -H"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
/* Key not present */
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -188,21 +205,9 @@ static void test_query(void)
add_value
(
hkey
,
"Test1"
,
REG_SZ
,
"Hello, World"
,
13
);
add_value
(
hkey
,
"Test2"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
));
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v Missing"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v Test1 /v Test2"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /v Test1 /ve"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg query HKCU
\\
"
KEY_BASE
" /s /s"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
read_reg_output
(
"reg query HKCU
\\
"
KEY_BASE
,
buf
,
sizeof
(
buf
),
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
compare_query
(
buf
,
test1
,
FALSE
,
0
);
...
...
@@ -300,5 +305,6 @@ START_TEST(query)
return
;
}
test_command_syntax
();
test_query
();
}
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