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
6bedd7cc
Commit
6bedd7cc
authored
Oct 03, 2020
by
Thomas Faber
Committed by
Alexandre Julliard
Nov 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp/tests: Add tests for SymSetSearchPath.
Signed-off-by:
Thomas Faber
<
thomas.faber@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
06f1c40f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
1 deletion
+72
-1
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+72
-1
No files found.
dlls/dbghelp/tests/dbghelp.c
View file @
6bedd7cc
...
...
@@ -132,12 +132,83 @@ static void test_stack_walk(void)
#endif
/* __i386__ || __x86_64__ */
static
void
test_search_path
(
void
)
{
char
search_path
[
128
];
BOOL
ret
;
/* The default symbol path is ".[;%_NT_SYMBOL_PATH%][;%_NT_ALT_SYMBOL_PATH%]".
* We unset both variables earlier so should simply get "." */
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_path
);
/* Set an arbitrary search path */
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
"W:
\\
"
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ok
(
!
strcmp
(
search_path
,
"W:
\\
"
),
"Got search path '%s', expected 'W:
\\
'
\n
"
,
search_path
);
/* Setting to NULL resets to the default */
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
NULL
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_path
);
/* With _NT_SYMBOL_PATH */
SetEnvironmentVariableA
(
"_NT_SYMBOL_PATH"
,
"X:
\\
"
);
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
NULL
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
".;X:
\\
"
),
"Got search path '%s', expected '.;X:
\\
'
\n
"
,
search_path
);
/* With both _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH */
SetEnvironmentVariableA
(
"_NT_ALT_SYMBOL_PATH"
,
"Y:
\\
"
);
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
NULL
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
".;X:
\\
;Y:
\\
"
),
"Got search path '%s', expected '.;X:
\\
;Y:
\\
'
\n
"
,
search_path
);
/* With just _NT_ALT_SYMBOL_PATH */
SetEnvironmentVariableA
(
"_NT_SYMBOL_PATH"
,
NULL
);
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
NULL
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
".;Y:
\\
"
),
"Got search path '%s', expected '.;Y:
\\
'
\n
"
,
search_path
);
/* Restore original search path */
SetEnvironmentVariableA
(
"_NT_ALT_SYMBOL_PATH"
,
NULL
);
ret
=
SymSetSearchPath
(
GetCurrentProcess
(),
NULL
);
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_path
);
}
START_TEST
(
dbghelp
)
{
BOOL
ret
=
SymInitialize
(
GetCurrentProcess
(),
NULL
,
TRUE
);
BOOL
ret
;
/* Don't let the user's environment influence our symbol path */
SetEnvironmentVariableA
(
"_NT_SYMBOL_PATH"
,
NULL
);
SetEnvironmentVariableA
(
"_NT_ALT_SYMBOL_PATH"
,
NULL
);
ret
=
SymInitialize
(
GetCurrentProcess
(),
NULL
,
TRUE
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
test_stack_walk
();
test_search_path
();
ret
=
SymCleanup
(
GetCurrentProcess
());
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
...
...
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