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
b3032b42
Commit
b3032b42
authored
Sep 25, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit/tests: Test registry export with a simple data structure.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fd4ce9a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
regedit.c
programs/regedit/tests/regedit.c
+28
-0
No files found.
programs/regedit/tests/regedit.c
View file @
b3032b42
...
...
@@ -188,6 +188,16 @@ static void delete_key_(unsigned line, const HKEY hkey, const char *path)
}
}
#define add_value(k,n,t,d,s) add_value_(__LINE__,k,n,t,d,s)
static
void
add_value_
(
unsigned
line
,
HKEY
hkey
,
const
char
*
name
,
DWORD
type
,
const
void
*
data
,
size_t
size
)
{
LONG
lr
;
lr
=
RegSetValueExA
(
hkey
,
name
,
0
,
type
,
(
const
BYTE
*
)
data
,
size
);
lok
(
lr
==
ERROR_SUCCESS
,
"RegSetValueExA failed: %d
\n
"
,
lr
);
}
#define KEY_BASE "Software\\Wine\\regedit_test"
static
void
test_basic_import
(
void
)
...
...
@@ -3320,11 +3330,18 @@ static void test_export(void)
{
LONG
lr
;
HKEY
hkey
;
DWORD
dword
;
const
char
*
empty_key_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n\r\n
"
;
const
char
*
simple_test
=
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\r\n\r\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\r\n
"
"
\"
DWORD
\"
=dword:00000100
\r\n
"
"
\"
String
\"
=
\"
Your text here...
\"\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
);
...
...
@@ -3337,6 +3354,17 @@ static void test_export(void)
lr
=
DeleteFileA
(
"file.reg"
);
ok
(
lr
,
"DeleteFile failed: %u
\n
"
,
GetLastError
());
/* Test registry export with a simple data structure */
dword
=
0x100
;
add_value
(
hkey
,
"DWORD"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
));
add_value
(
hkey
,
"String"
,
REG_SZ
,
"Your text here..."
,
18
);
run_regedit_exe
(
"regedit.exe /e file.reg HKEY_CURRENT_USER
\\
"
KEY_BASE
);
ok
(
compare_export
(
"file.reg"
,
simple_test
),
"compare_export() failed
\n
"
);
lr
=
DeleteFileA
(
"file.reg"
);
ok
(
lr
,
"DeleteFile failed: %u
\n
"
,
GetLastError
());
RegCloseKey
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
...
...
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