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
f320e74c
Commit
f320e74c
authored
Jun 28, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer depends on external env strings values.
parent
2021de68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
shreg.c
dlls/shlwapi/tests/shreg.c
+16
-9
No files found.
dlls/shlwapi/tests/shreg.c
View file @
f320e74c
...
...
@@ -28,18 +28,23 @@
#include "winuser.h"
#include "shlwapi.h"
static
char
*
sTestpath1
=
"%
SYSTEMROOT
%
\\
subdir1"
;
static
char
*
sTestpath2
=
"%
USERPROFILE
%
\\
subdir1"
;
static
char
*
sTestpath1
=
"%
LONGSYSTEMVAR
%
\\
subdir1"
;
static
char
*
sTestpath2
=
"%
FOO
%
\\
subdir1"
;
static
char
sExpTestpath1
[
MAX_PATH
];
static
char
sExpTestpath2
[
MAX_PATH
];
static
unsigned
sExpLen1
;
static
unsigned
sExpLen2
;
static
char
*
sEmptyBuffer
=
"0123456789"
;
static
void
create_test_entrys
()
static
void
create_test_entrys
(
void
)
{
HKEY
hKey
;
SetEnvironmentVariableA
(
"LONGSYSTEMVAR"
,
"bar"
);
SetEnvironmentVariableA
(
"FOO"
,
"ImARatherLongButIndeedNeededString"
);
ok
(
!
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
&
hKey
),
"RegCreateKeyA failed"
);
if
(
hKey
)
...
...
@@ -50,9 +55,11 @@ static void create_test_entrys()
RegCloseKey
(
hKey
);
}
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
ok
(
strlen
(
sExpTestpath2
)
>
25
,
"%%USERPROFILE%% is set to a short value on this machine. we cant perform all tests."
);
sExpLen1
=
ExpandEnvironmentStringsA
(
sTestpath1
,
sExpTestpath1
,
sizeof
(
sExpTestpath1
));
sExpLen2
=
ExpandEnvironmentStringsA
(
sTestpath2
,
sExpTestpath2
,
sizeof
(
sExpTestpath2
));
ok
(
sExpLen1
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath1
);
ok
(
sExpLen2
>
0
,
"Couldn't expand %s
\n
"
,
sTestpath2
);
}
static
void
test_SHGetValue
(
void
)
...
...
@@ -159,11 +166,11 @@ static void test_SHQUeryValueEx(void)
* if the unexpanded string fits into the buffer it can get cut when expanded
*/
strcpy
(
buf
,
sEmptyBuffer
);
dwSize
=
2
4
;
dwSize
=
sExpLen2
-
4
;
dwType
=
-
1
;
ok
(
ERROR_MORE_DATA
==
SHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
dwType
,
buf
,
&
dwSize
),
"Expected ERROR_MORE_DATA"
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
24
-
1
),
"(%s)"
,
buf
);
ok
(
24
-
1
==
strlen
(
buf
),
"(%s)"
,
buf
);
ok
(
0
==
strncmp
(
sExpTestpath2
,
buf
,
sExpLen2
-
4
-
1
),
"(%s)"
,
buf
);
ok
(
sExpLen2
-
4
-
1
==
strlen
(
buf
),
"(%s)"
,
buf
);
ok
(
dwSize
==
nUsedBuffer2
,
"(%lu,%u)"
,
dwSize
,
nUsedBuffer2
);
ok
(
dwType
==
REG_SZ
,
"(%lu)"
,
dwType
);
...
...
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