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
33f9093f
Commit
33f9093f
authored
Oct 13, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Oct 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit/tests: Add more export tests.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ecc0d41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
regedit.c
programs/regedit/tests/regedit.c
+79
-0
No files found.
programs/regedit/tests/regedit.c
View file @
33f9093f
...
...
@@ -3416,6 +3416,7 @@ static void test_export(void)
LONG
lr
;
HKEY
hkey
,
subkey
;
DWORD
dword
;
BYTE
hex
[
4
];
const
char
*
empty_key_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
...
...
@@ -3465,6 +3466,32 @@ static void test_export(void)
"
\"
Value 2
\"
=
\"
I was added first!
\"\r\n
"
"
\"
Value 1
\"
=
\"
I was added second!
\"\r\n\r\n
"
;
const
char
*
empty_hex_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
Wine1a
\"
=hex(0):
\r\n
"
"
\"
Wine1b
\"
=
\"\"\r\n
"
"
\"
Wine1c
\"
=hex(2):
\r\n
"
"
\"
Wine1d
\"
=hex:
\r\n
"
"
\"
Wine1e
\"
=hex(4):
\r\n
"
"
\"
Wine1f
\"
=hex(7):
\r\n
"
"
\"
Wine1g
\"
=hex(100):
\r\n
"
"
\"
Wine1h
\"
=hex(abcd):
\r\n\r\n
"
;
const
char
*
empty_hex_test2
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
Wine2a
\"
=
\"\"\r\n
"
"
\"
Wine2b
\"
=hex:
\r\n
"
"
\"
Wine2c
\"
=hex(4):
\r\n\r\n
"
;
const
char
*
hex_types_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
Wine3a
\"
=
\"
Value
\"\r\n
"
"
\"
Wine3b
\"
=hex:12,34,56,78
\r\n
"
"
\"
Wine3c
\"
=dword:10203040
\r\n\r\n
"
;
lr
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
);
ok
(
lr
==
ERROR_SUCCESS
||
lr
==
ERROR_FILE_NOT_FOUND
,
"RegDeleteKeyA failed: %d
\n
"
,
lr
);
...
...
@@ -3547,6 +3574,58 @@ static void test_export(void)
ok
(
compare_export
(
"file.reg"
,
value_order_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
/* Test registry export with empty hex data */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_value
(
hkey
,
"Wine1a"
,
REG_NONE
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1b"
,
REG_SZ
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1c"
,
REG_EXPAND_SZ
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1d"
,
REG_BINARY
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1e"
,
REG_DWORD
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1f"
,
REG_MULTI_SZ
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1g"
,
0x100
,
NULL
,
0
);
add_value
(
hkey
,
"Wine1h"
,
0xabcd
,
NULL
,
0
);
RegCloseKey
(
hkey
);
run_regedit_exe
(
"regedit.exe /e file.reg HKEY_CURRENT_USER
\\
"
KEY_BASE
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
/* Test registry export after importing alternative registry data types */
exec_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine2a
\"
=hex(1):
\n
"
"
\"
Wine2b
\"
=hex(3):
\n
"
"
\"
Wine2c
\"
=hex(4):
\n\n
"
);
open_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
&
hkey
);
verify_reg
(
hkey
,
"Wine2a"
,
REG_SZ
,
NULL
,
0
,
0
);
verify_reg
(
hkey
,
"Wine2b"
,
REG_BINARY
,
NULL
,
0
,
0
);
verify_reg
(
hkey
,
"Wine2c"
,
REG_DWORD
,
NULL
,
0
,
0
);
RegCloseKey
(
hkey
);
run_regedit_exe
(
"regedit.exe /e file.reg HKEY_CURRENT_USER
\\
"
KEY_BASE
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test2
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
exec_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
"
\"
Wine3a
\"
=hex(1):56,00,61,00,6c,00,75,00,65,00,00,00
\n
"
"
\"
Wine3b
\"
=hex(3):12,34,56,78
\n
"
"
\"
Wine3c
\"
=hex(4):40,30,20,10
\n\n
"
);
open_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
&
hkey
);
verify_reg
(
hkey
,
"Wine3a"
,
REG_SZ
,
"Value"
,
6
,
0
);
memcpy
(
hex
,
"
\x12\x34\x56\x78
"
,
4
);
verify_reg
(
hkey
,
"Wine3b"
,
REG_BINARY
,
hex
,
4
,
0
);
dword
=
0x10203040
;
verify_reg
(
hkey
,
"Wine3c"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
RegCloseKey
(
hkey
);
run_regedit_exe
(
"regedit.exe /e file.reg HKEY_CURRENT_USER
\\
"
KEY_BASE
);
ok
(
compare_export
(
"file.reg"
,
hex_types_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
}
START_TEST
(
regedit
)
...
...
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