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
f95f3fb1
Commit
f95f3fb1
authored
Aug 07, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Add tests for importing Windows 3.1 registry data.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
96fd03b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
0 deletions
+118
-0
reg.c
programs/reg/tests/reg.c
+118
-0
No files found.
programs/reg/tests/reg.c
View file @
f95f3fb1
...
...
@@ -4053,6 +4053,123 @@ static void test_unicode_import_with_whitespace(void)
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKeyA failed: got %d, expected 0
\n
"
,
err
);
}
static
void
test_import_31
(
void
)
{
LONG
err
;
HKEY
hkey
;
DWORD
r
;
err
=
RegDeleteKeyA
(
HKEY_CLASSES_ROOT
,
KEY_BASE
);
ok
(
err
==
ERROR_SUCCESS
||
err
==
ERROR_FILE_NOT_FOUND
,
"RegDeleteKeyA failed: %d
\n
"
,
err
);
/* Check if reg.exe is running with elevated privileges */
err
=
RegCreateKeyExA
(
HKEY_CLASSES_ROOT
,
KEY_BASE
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_READ
|
KEY_SET_VALUE
,
NULL
,
&
hkey
,
NULL
);
if
(
err
==
ERROR_ACCESS_DENIED
)
{
win_skip
(
"reg.exe is not running with elevated privileges; "
"skipping Windows 3.1 import tests
\n
"
);
return
;
}
/* Test simple value */
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value0
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Value0"
,
7
,
0
);
/* Test proper handling of spaces and equals signs */
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" =Value1
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Value1"
,
7
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value2
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
" Value2"
,
8
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value3
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Value3 "
,
8
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" Value4
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Value4"
,
7
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" Value5
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Value5"
,
7
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
"
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
""
,
1
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
"
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
""
,
1
,
0
);
test_import_str
(
"REGEDIT
\r\n
"
"HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = No newline"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"No newline"
,
11
,
0
);
err
=
RegDeleteValueW
(
hkey
,
NULL
);
todo_wine
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteValue failed: %d
\n
"
,
err
);
/* Test character validity at the start of the line */
test_import_str
(
"REGEDIT
\r\n
"
" HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value1a
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
" HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value1b
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
"
\t
HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value1c
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
";HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value2a
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
"#HKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value2b
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
/* Test case sensitivity */
test_import_str
(
"REGEDIT
\r\n
"
"hkey_classes_root
\\
"
KEY_BASE
" = Value3a
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
"hKEY_CLASSES_ROOT
\\
"
KEY_BASE
" = Value3b
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
test_import_str
(
"REGEDIT
\r\n
"
"Hkey_Classes_Root
\\
"
KEY_BASE
" = Value3c
\r\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_reg_nonexist
(
hkey
,
""
);
RegCloseKey
(
hkey
);
err
=
RegDeleteKeyA
(
HKEY_CLASSES_ROOT
,
KEY_BASE
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKeyA failed: %d
\n
"
,
err
);
}
START_TEST
(
reg
)
{
DWORD
r
;
...
...
@@ -4069,4 +4186,5 @@ START_TEST(reg)
test_unicode_import
();
test_import_with_whitespace
();
test_unicode_import_with_whitespace
();
test_import_31
();
}
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