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
47f506a1
Commit
47f506a1
authored
Apr 10, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Apr 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add tests for importing DWORD values.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8335d915
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
0 deletions
+124
-0
reg.c
programs/reg/tests/reg.c
+124
-0
No files found.
programs/reg/tests/reg.c
View file @
47f506a1
...
...
@@ -1220,6 +1220,59 @@ static void test_import(void)
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine32a
\"
=dword:1
\n
"
"
\"
Wine32b
\"
=dword:4444
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x1
;
todo_wine
verify_reg
(
hkey
,
"Wine32a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
dword
=
0x4444
;
todo_wine
verify_reg
(
hkey
,
"Wine32b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine33a
\"
=dword:
\n
"
"
\"
Wine33b
\"
=dword:hello
\n
"
"
\"
Wine33c
\"
=dword:123456789
\n
"
"
\"
Wine33d
\"
=dword:012345678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33c"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33d"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine34a
\"
=dword:12345678abc
\n
"
"
\"
Wine34b
\"
=dword:12345678 abc
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine34a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine34b"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine35a
\"
=dword:0x123
\n
"
"
\"
Wine35b
\"
=dword:123 456
\n
"
"
\"
Wine35c
\"
=dword:1234 5678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35c"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine36a
\"
=dword:1234;5678
\n
"
"
\"
Wine36b
\"
=dword:1234 ;5678
\n
"
"
\"
Wine36c
\"
=dword:1234#5678
\n
"
"
\"
Wine36d
\"
=dword:1234 #5678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x1234
;
todo_wine
verify_reg
(
hkey
,
"Wine36a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine36b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine36c"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine36d"
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
double
\\\"
quote
\"
=
\"
valid
\\\"
or
\\\"
not
\"\n
"
"
\"
single'quote
\"
=dword:00000008
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
...
...
@@ -1589,6 +1642,59 @@ static void test_import(void)
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine32a
\"
=dword:1
\n
"
"
\"
Wine32b
\"
=dword:4444
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x1
;
todo_wine
verify_reg
(
hkey
,
"Wine32a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
dword
=
0x4444
;
todo_wine
verify_reg
(
hkey
,
"Wine32b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine33a
\"
=dword:
\n
"
"
\"
Wine33b
\"
=dword:hello
\n
"
"
\"
Wine33c
\"
=dword:123456789
\n
"
"
\"
Wine33d
\"
=dword:012345678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33c"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine33d"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine34a
\"
=dword:12345678abc
\n
"
"
\"
Wine34b
\"
=dword:12345678 abc
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine34a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine34b"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine35a
\"
=dword:0x123
\n
"
"
\"
Wine35b
\"
=dword:123 456
\n
"
"
\"
Wine35c
\"
=dword:1234 5678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine35c"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine36a
\"
=dword:1234;5678
\n
"
"
\"
Wine36b
\"
=dword:1234 ;5678
\n
"
"
\"
Wine36c
\"
=dword:1234#5678
\n
"
"
\"
Wine36d
\"
=dword:1234 #5678
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x1234
;
todo_wine
verify_reg
(
hkey
,
"Wine36a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine36b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine36c"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine36d"
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Multi-Line1
\"
=hex(7):4c,00,69,00,6e,00,65,00,20,00,
\\\n
"
" 63,00,6f,00,6e,00,
\\
;comment
\n
"
" 63,00,61,00,74,00,
\\
;comment
\n
"
...
...
@@ -1822,6 +1928,15 @@ static void test_import_with_whitespace(void)
todo_wine
verify_reg
(
hkey
,
"Wine8a"
,
REG_SZ
,
"Trailing spaces"
,
16
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine8b"
,
REG_SZ
,
"Trailing tabs and spaces"
,
25
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine9a
\"
=dword: 00000008
\n
"
"
\"
Wine9b
\"
=dword:
\t\t
00000008
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x00000008
;
todo_wine
verify_reg
(
hkey
,
"Wine9a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine9b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
err
=
RegCloseKey
(
hkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"RegCloseKey failed: got %d, expected 0
\n
"
,
err
);
...
...
@@ -1941,6 +2056,15 @@ static void test_import_with_whitespace(void)
todo_wine
verify_reg
(
hkey
,
"Wine8a"
,
REG_SZ
,
"Trailing spaces"
,
16
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine8b"
,
REG_SZ
,
"Trailing tabs and spaces"
,
25
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine9a
\"
=dword: 00000008
\n
"
"
\"
Wine9b
\"
=dword:
\t\t
00000008
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
dword
=
0x00000008
;
todo_wine
verify_reg
(
hkey
,
"Wine9a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine9b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
err
=
RegCloseKey
(
hkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"RegCloseKey failed: 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