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
9af841ea
Commit
9af841ea
authored
Mar 03, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Mar 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add more tests for all supported data types.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d4ac88a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
reg.c
programs/reg/tests/reg.c
+39
-0
No files found.
programs/reg/tests/reg.c
View file @
9af841ea
...
...
@@ -149,6 +149,10 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"none1"
,
REG_NONE
,
"
\0
"
,
2
,
TODO_REG_SIZE
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_NONE /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
NULL
,
REG_NONE
,
"
\0
"
,
2
,
TODO_REG_SIZE
|
TODO_REG_TYPE
|
TODO_REG_DATA
);
/* REG_SZ */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /d WineTest /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
||
broken
(
r
==
REG_EXIT_FAILURE
/* WinXP */
),
...
...
@@ -181,6 +185,14 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"test3"
,
REG_SZ
,
""
,
1
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
""
,
1
,
TODO_REG_SIZE
|
TODO_REG_DATA
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_SZ /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
""
,
1
,
TODO_REG_SIZE
|
TODO_REG_DATA
);
/* REG_EXPAND_SZ */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v expand0 /t REG_EXpand_sz /d
\"
dead%PATH%beef
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
...
...
@@ -202,6 +214,10 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
verify_reg
(
hkey
,
"expand3"
,
REG_EXPAND_SZ
,
""
,
1
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_EXPAND_SZ /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
NULL
,
REG_EXPAND_SZ
,
""
,
1
,
TODO_REG_SIZE
|
TODO_REG_DATA
);
/* REG_BINARY */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_BINARY /v bin0 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
...
...
@@ -242,6 +258,10 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v bin6 /t REG_BINARY /f /d"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_BINARY /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
NULL
,
REG_BINARY
,
buffer
,
0
,
TODO_REG_DATA
|
TODO_REG_SIZE
);
/* REG_DWORD */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_DWORD /f /d 12345678"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
||
broken
(
r
==
REG_EXIT_FAILURE
/* WinXP */
),
...
...
@@ -310,6 +330,10 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v dword15 /t REG_DWORD /d 4294967296 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_DWORD /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
"got exit code %u
\n
"
,
r
);
/* REG_DWORD_LITTLE_ENDIAN */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v DWORD_LE /t REG_DWORD_LITTLE_ENDIAN /d 456 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -324,6 +348,17 @@ static void test_add(void)
/* REG_DWORD_BIG_ENDIAN is broken in every version of windows. It behaves like
* an ordinary REG_DWORD - that is little endian. GG */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v DWORD_BE2 /t REG_DWORD_BIG_ENDIAN /f /d"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v DWORD_BE3 /t REG_DWORD_BIG_ENDIAN /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_DWORD_BIG_ENDIAN /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
/* WinXP */
),
"got exit code %u
\n
"
,
r
);
/* REG_MULTI_SZ */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi0 /t REG_MULTI_SZ /d
\"
three
\\
0little
\\
0strings
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
...
...
@@ -401,6 +436,10 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi21"
,
REG_MULTI_SZ
,
"two
\\
0
\\
0strings
\0
"
,
16
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /t REG_MULTI_SZ /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
NULL
,
REG_MULTI_SZ
,
buffer
,
1
,
TODO_REG_SIZE
|
TODO_REG_DATA
|
TODO_REG_TYPE
);
RegCloseKey
(
hkey
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
);
...
...
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