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
da5a0b76
Commit
da5a0b76
authored
Jan 05, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jan 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add tests for quotes and slashes in keys, values and data.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
061c4bce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
1 deletion
+67
-1
reg.c
programs/reg/tests/reg.c
+67
-1
No files found.
programs/reg/tests/reg.c
View file @
da5a0b76
...
...
@@ -774,7 +774,7 @@ static void test_import(void)
char
test1_reg
[
MAX_PATH
],
test2_reg
[
MAX_PATH
];
char
cmdline
[
MAX_PATH
];
char
test_string
[]
=
"Test string"
;
HKEY
hkey
;
HKEY
hkey
,
subkey
;
LONG
err
;
run_reg_exe
(
"reg import"
,
&
r
);
...
...
@@ -1082,6 +1082,39 @@ 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
,
"Multi-Line2"
,
REG_MULTI_SZ
,
"Line concat"
,
12
,
0
);
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
);
todo_wine
verify_reg
(
hkey
,
"double
\"
quote"
,
REG_SZ
,
"valid
\"
or
\"
not"
,
15
,
0
);
dword
=
0x00000008
;
todo_wine
verify_reg
(
hkey
,
"single'quote"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey
\"
1]
\n
"
"
\"
Wine
\\\\
31
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey
\"
1"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
todo_wine
verify_reg
(
subkey
,
"Wine
\\
31"
,
REG_SZ
,
"Test value"
,
11
,
0
);
err
=
RegCloseKey
(
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey/2]
\n
"
"
\"
123/
\\\"
4;'5
\"
=
\"
Random value name
\"\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey/2"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
todo_wine
verify_reg
(
subkey
,
"123/
\"
4;'5"
,
REG_SZ
,
"Random value name"
,
18
,
0
);
err
=
RegCloseKey
(
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
err
=
RegCloseKey
(
hkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
...
...
@@ -1358,6 +1391,39 @@ 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
,
"Multi-Line2"
,
REG_MULTI_SZ
,
"Line concat"
,
12
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\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
);
todo_wine
verify_reg
(
hkey
,
"double
\"
quote"
,
REG_SZ
,
"valid
\"
or
\"
not"
,
15
,
0
);
dword
=
0x00000008
;
todo_wine
verify_reg
(
hkey
,
"single'quote"
,
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
"
\\
Subkey
\"
1]
\n
"
"
\"
Wine
\\\\
31
\"
=
\"
Test value
\"\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey
\"
1"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
todo_wine
verify_reg
(
subkey
,
"Wine
\\
31"
,
REG_SZ
,
"Test value"
,
11
,
0
);
err
=
RegCloseKey
(
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey/2]
\n
"
"
\"
123/
\\\"
4;'5
\"
=
\"
Random value name
\"\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegOpenKeyExA
(
hkey
,
"Subkey/2"
,
0
,
KEY_READ
,
&
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
todo_wine
verify_reg
(
subkey
,
"123/
\"
4;'5"
,
REG_SZ
,
"Random value name"
,
18
,
0
);
err
=
RegCloseKey
(
subkey
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"got %d, expected 0
\n
"
,
err
);
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