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
2515ff77
Commit
2515ff77
authored
Nov 19, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Nov 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added beginnings of RegQueryValueEx tests.
parent
02b690db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
registry.c
dlls/advapi32/tests/registry.c
+30
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
2515ff77
...
...
@@ -28,6 +28,9 @@
static
HKEY
hkey_main
;
static
const
char
*
sTestpath1
=
"%LONGSYSTEMVAR%
\\
subdir1"
;
static
const
char
*
sTestpath2
=
"%FOO%
\\
subdir1"
;
/* delete key and all its subkeys */
static
DWORD
delete_key
(
HKEY
hkey
)
{
...
...
@@ -57,6 +60,19 @@ static void setup_main_key(void)
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey_main
,
NULL
));
}
static
void
create_test_entries
(
void
)
{
SetEnvironmentVariableA
(
"LONGSYSTEMVAR"
,
"bar"
);
SetEnvironmentVariableA
(
"FOO"
,
"ImARatherLongButIndeedNeededString"
);
ok
(
!
RegSetValueExA
(
hkey_main
,
"Test1"
,
0
,
REG_EXPAND_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed
\n
"
);
ok
(
!
RegSetValueExA
(
hkey_main
,
"Test2"
,
0
,
REG_SZ
,
sTestpath1
,
strlen
(
sTestpath1
)
+
1
),
"RegSetValueExA failed
\n
"
);
ok
(
!
RegSetValueExA
(
hkey_main
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
sTestpath2
,
strlen
(
sTestpath2
)
+
1
),
"RegSetValueExA failed
\n
"
);
}
static
void
test_enum_value
(
void
)
{
DWORD
res
;
...
...
@@ -227,10 +243,24 @@ CLEANUP:
RegDeleteValueA
(
hkey_main
,
"Test"
);
}
static
void
test_query_value_ex
()
{
DWORD
ret
;
DWORD
size
;
DWORD
type
;
ret
=
RegQueryValueExA
(
hkey_main
,
"Test2"
,
NULL
,
&
type
,
NULL
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %ld
\n
"
,
ret
);
ok
(
size
==
strlen
(
sTestpath1
)
+
1
,
"(%ld,%ld)
\n
"
,
(
DWORD
)
strlen
(
sTestpath1
)
+
1
,
size
);
ok
(
type
==
REG_SZ
,
"type %ld is not REG_SZ
\n
"
,
type
);
}
START_TEST
(
registry
)
{
setup_main_key
();
create_test_entries
();
test_enum_value
();
test_query_value_ex
();
/* cleanup */
delete_key
(
hkey_main
);
...
...
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