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
3ca45f8e
Commit
3ca45f8e
authored
Aug 12, 2005
by
Richard Cohen
Committed by
Alexandre Julliard
Aug 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blame ExpandEnvironmentStringsA for the failing NT4 test.
parent
0f94e03b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
shreg.c
dlls/shlwapi/tests/shreg.c
+22
-12
No files found.
dlls/shlwapi/tests/shreg.c
View file @
3ca45f8e
...
...
@@ -47,8 +47,8 @@ static const char * sEnvvar2 = "ImARatherLongButIndeedNeededString";
static
char
sExpTestpath1
[
MAX_PATH
];
static
char
sExpTestpath2
[
MAX_PATH
];
static
unsigned
s
ExpLen1
;
static
unsigned
s
ExpLen2
;
static
DWORD
n
ExpLen1
;
static
DWORD
n
ExpLen2
;
static
const
char
*
sEmptyBuffer
=
"0123456789"
;
...
...
@@ -75,6 +75,7 @@ static HKEY create_test_entries(void)
{
HKEY
hKey
;
DWORD
ret
;
DWORD
nExpectedLen1
,
nExpectedLen2
;
SetEnvironmentVariableA
(
"LONGSYSTEMVAR"
,
sEnvvar1
);
SetEnvironmentVariableA
(
"FOO"
,
sEnvvar2
);
...
...
@@ -89,15 +90,24 @@ static HKEY create_test_entries(void)
ok
(
!
RegSetValueExA
(
hKey
,
"Test3"
,
0
,
REG_EXPAND_SZ
,
(
LPBYTE
)
sTestpath2
,
strlen
(
sTestpath2
)
+
1
),
"RegSetValueExA failed
\n
"
);
}
s
ExpLen1
=
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
s
ExpLen2
=
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
n
ExpLen1
=
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
n
ExpLen2
=
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
ok
(
sExpLen1
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath1
);
trace
(
"sExplen1 = (%d)
\n
"
,
sExpLen1
);
ok
(
sExpLen2
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath2
);
trace
(
"sExplen2 = (%d)
\n
"
,
sExpLen2
);
nExpectedLen1
=
strlen
(
sTestpath1
)
-
strlen
(
"%LONGSYSTEMVAR%"
)
+
strlen
(
sEnvvar1
)
+
1
;
nExpectedLen2
=
strlen
(
sTestpath2
)
-
strlen
(
"%FOO%"
)
+
strlen
(
sEnvvar2
)
+
1
;
/* ExpandEnvironmentStringsA on NT4 returns 2x the correct result */
trace
(
"sExplen1 = (%ld)
\n
"
,
nExpLen1
);
if
(
nExpectedLen1
!=
nExpLen1
)
trace
(
"Expanding %s failed (expected %ld) - known bug in NT4
\n
"
,
sTestpath1
,
nExpectedLen1
);
return
hKey
;
trace
(
"sExplen2 = (%ld)
\n
"
,
nExpLen2
);
if
(
nExpectedLen2
!=
nExpLen2
)
trace
(
"Expanding %s failed (expected %ld) - known bug in NT4
\n
"
,
sTestpath2
,
nExpectedLen2
);
/* Make sure we carry on with correct values */
nExpLen1
=
nExpectedLen1
;
nExpLen2
=
nExpectedLen2
;
return
hKey
;
}
static
void
test_SHGetValue
(
void
)
...
...
@@ -226,7 +236,7 @@ static void test_SHQUeryValueEx(void)
todo_wine
{
ok
(
(
0
==
strcmp
(
""
,
buf
))
|
(
0
==
strcmp
(
sTestpath2
,
buf
)),
ok
(
(
0
==
strcmp
(
""
,
buf
))
|
|
(
0
==
strcmp
(
sTestpath2
,
buf
)),
"Expected empty or unexpanded string (win98), got (%s)
\n
"
,
buf
);
}
...
...
@@ -239,14 +249,14 @@ static void test_SHQUeryValueEx(void)
* if the unexpanded string fits into the buffer it can get cut when expanded
*/
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
s
ExpLen2
-
4
;
dwSize
=
n
ExpLen2
-
4
;
dwType
=
-
1
;
dwRet
=
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
);
ok
(
ERROR_MORE_DATA
==
dwRet
,
"Expected ERROR_MORE_DATA, got (%lu)
\n
"
,
dwRet
);
todo_wine
{
ok
(
(
0
==
strcmp
(
""
,
buf
))
|
(
0
==
strcmp
(
sEnvvar2
,
buf
)),
ok
(
(
0
==
strcmp
(
""
,
buf
))
|
|
(
0
==
strcmp
(
sEnvvar2
,
buf
)),
"Expected empty or first part of the string
\"
%s
\"
, got
\"
%s
\"\n
"
,
sEnvvar2
,
buf
);
}
...
...
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