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
a2fc092e
Commit
a2fc092e
authored
Nov 23, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Nov 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add more tests for 'reg import'.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9c5b15aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
reg.c
programs/reg/tests/reg.c
+96
-0
No files found.
programs/reg/tests/reg.c
View file @
a2fc092e
...
...
@@ -819,6 +819,9 @@ static void test_import(void)
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
)
/* WinXP */
,
"got exit code %d, expected 1
\n
"
,
r
);
test_import_str
(
"REGEDIT"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
test_import_str
(
"REGEDIT
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -944,6 +947,30 @@ static void test_import(void)
todo_wine
verify_reg
(
hkey
,
"Wine4"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine5
\"
=
\"
No newline
\"
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegQueryValueExA
(
hkey
,
"Wine5"
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
||
broken
(
err
==
ERROR_FILE_NOT_FOUND
/* WinXP */
),
"got %d, expected 0
\n
"
,
err
);
if
(
err
==
ERROR_SUCCESS
)
verify_reg
(
hkey
,
"Wine5"
,
REG_SZ
,
"No newline"
,
11
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine6
\"
=dword:00000050
\n\n
"
"
\"
Wine7
\"
=
\"
No newline
\"
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x50
;
todo_wine
verify_reg
(
hkey
,
"Wine6"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
err
=
RegQueryValueExA
(
hkey
,
"Wine7"
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
||
broken
(
err
==
ERROR_FILE_NOT_FOUND
/* WinXP */
),
"got %d, expected 0
\n
"
,
err
);
if
(
err
==
ERROR_SUCCESS
)
verify_reg
(
hkey
,
"Wine7"
,
REG_SZ
,
"No newline"
,
11
,
0
);
err
=
RegCloseKey
(
hkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
...
...
@@ -959,9 +986,15 @@ static void test_import(void)
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
)
/* WinXP */
,
"got exit code %d, expected 1
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT4"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT4
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -1012,6 +1045,9 @@ static void test_import(void)
ok
(
r
==
REG_EXIT_FAILURE
||
broken
(
r
==
REG_EXIT_SUCCESS
)
/* WinXP */
,
"got exit code %d, expected 1
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -1047,6 +1083,66 @@ static void test_import(void)
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"Unicode6"
,
REG_SZ
,
"Value6"
,
7
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Line1
\"
=
\"
Value1
\"\n\n
"
"
\"
Line2
\"
=
\"
Value2
\"\n\n\n
"
"
\"
Line3
\"
=
\"
Value3
\"\n\n\n\n
"
"
\"
Line4
\"
=
\"
Value4
\"\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"Line1"
,
REG_SZ
,
"Value1"
,
7
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
"Line2"
,
REG_SZ
,
"Value2"
,
7
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
"Line3"
,
REG_SZ
,
"Value3"
,
7
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
"Line4"
,
REG_SZ
,
"Value4"
,
7
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine1
\"
=dword:00000782
\n\n
"
"
\"
Wine2
\"
=
\"
Test Value
\"\n
"
"
\"
Wine3
\"
=hex(7):4c,00,69,00,6e,00,65,00,20,00,63,00,6f,00,6e,00,63,00,\
61,00,74,00,65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00
\n
"
"#comment
\n
"
"@=
\"
Test
\"\n
"
";comment
\n\n
"
"
\"
Wine4
\"
=dword:12345678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x782
;
todo_wine
verify_reg
(
hkey
,
"Wine1"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
"Wine2"
,
REG_SZ
,
"Test Value"
,
11
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
"Wine3"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Test"
,
5
,
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
dword
=
0x12345678
;
todo_wine
verify_reg
(
hkey
,
"Wine4"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine5
\"
=
\"
No newline
\"
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegQueryValueExA
(
hkey
,
"Wine5"
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
||
broken
(
err
==
ERROR_FILE_NOT_FOUND
/* WinXP */
),
"got %d, expected 0
\n
"
,
err
);
if
(
err
==
ERROR_SUCCESS
)
verify_reg
(
hkey
,
"Wine5"
,
REG_SZ
,
"No newline"
,
11
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine6
\"
=dword:00000050
\n\n
"
"
\"
Wine7
\"
=
\"
No newline
\"
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x50
;
todo_wine
verify_reg
(
hkey
,
"Wine6"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
TODO_REG_TYPE
|
TODO_REG_SIZE
|
TODO_REG_DATA
);
err
=
RegQueryValueExA
(
hkey
,
"Wine7"
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
||
broken
(
err
==
ERROR_FILE_NOT_FOUND
/* WinXP */
),
"got %d, expected 0
\n
"
,
err
);
if
(
err
==
ERROR_SUCCESS
)
verify_reg
(
hkey
,
"Wine7"
,
REG_SZ
,
"No newline"
,
11
,
0
);
err
=
RegCloseKey
(
hkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
...
...
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