Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
dddf714f
Commit
dddf714f
authored
15 years ago
by
Andrew Nguyen
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dxdiagn: Add tests for IDxDiagProvider.
parent
b0e3c91c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+9
-0
9 additions, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/dxdiagn/tests/Makefile.in
+13
-0
13 additions, 0 deletions
dlls/dxdiagn/tests/Makefile.in
dlls/dxdiagn/tests/provider.c
+152
-0
152 additions, 0 deletions
dlls/dxdiagn/tests/provider.c
with
175 additions
and
0 deletions
configure
+
9
−
0
View file @
dddf714f
...
...
@@ -14840,6 +14840,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/dxdiagn/Makefile: dlls/dxdiagn/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/dxdiagn/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/dxdiagn/tests/Makefile"
test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\
dxdiagn/tests"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/dxdiagn/tests/Makefile: dlls/dxdiagn/tests/Makefile.in dlls/Maketest.rules"
ac_config_files="$ac_config_files dlls/dxdiagn/tests/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/dxerr8/Makefile"
test "x$enable_dxerr8" != xno && ALL_IMPLIB_DIRS="$ALL_IMPLIB_DIRS \\
...
...
@@ -19001,6 +19009,7 @@ do
"dlls/dswave/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dswave/Makefile" ;;
"dlls/dwmapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dwmapi/Makefile" ;;
"dlls/dxdiagn/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxdiagn/Makefile" ;;
"dlls/dxdiagn/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxdiagn/tests/Makefile" ;;
"dlls/dxerr8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr8/Makefile" ;;
"dlls/dxerr9/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr9/Makefile" ;;
"dlls/dxgi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxgi/Makefile" ;;
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
dddf714f
...
...
@@ -2240,6 +2240,7 @@ WINE_CONFIG_MAKEFILE([dlls/dssenh/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL
WINE_CONFIG_MAKEFILE([dlls/dswave/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dwmapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dxdiagn/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dxdiagn/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/dxerr8/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dxerr9/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dxgi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
...
...
This diff is collapsed.
Click to expand it.
dlls/dxdiagn/tests/Makefile.in
0 → 100644
+
13
−
0
View file @
dddf714f
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
dxdiagn.dll
IMPORTS
=
ole32 kernel32
CTESTS
=
\
provider.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
This diff is collapsed.
Click to expand it.
dlls/dxdiagn/tests/provider.c
0 → 100644
+
152
−
0
View file @
dddf714f
/*
* Unit tests for IDxDiagProvider
*
* Copyright (C) 2009 Andrew Nguyen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include
"initguid.h"
#include
"dxdiag.h"
#include
"wine/test.h"
static
void
test_Initialize
(
void
)
{
HRESULT
hr
;
IDxDiagProvider
*
pddp
;
DXDIAG_INIT_PARAMS
params
;
hr
=
CoCreateInstance
(
&
CLSID_DxDiagProvider
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDxDiagProvider
,
(
LPVOID
*
)
&
pddp
);
ok
(
hr
==
S_OK
,
"Creating a IDxDiagProvider instance failed with %x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create a IDxDiagProvider instance
\n
"
);
return
;
}
/* Test passing a NULL DXDIAG_INIT_PARAMS pointer. */
hr
=
IDxDiagProvider_Initialize
(
pddp
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Expected IDxDiagProvider::Initialize to return E_POINTER, got %x
\n
"
,
hr
);
/* Test passing invalid dwSize values. */
params
.
dwSize
=
0
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x
\n
"
,
hr
);
params
.
dwSize
=
sizeof
(
params
)
+
1
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x
\n
"
,
hr
);
/* Test passing an unexpected dwDxDiagHeaderVersion value. */
params
.
dwSize
=
sizeof
(
params
);
params
.
dwDxDiagHeaderVersion
=
0
;
params
.
bAllowWHQLChecks
=
FALSE
;
params
.
pReserved
=
NULL
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagProvider::Initialize to return E_INVALIDARG, got %x
\n
"
,
hr
);
/* Setting pReserved to a non-NULL value causes a crash on Windows. */
if
(
0
)
{
params
.
dwDxDiagHeaderVersion
=
DXDIAG_DX9_SDK_VERSION
;
params
.
bAllowWHQLChecks
=
FALSE
;
params
.
pReserved
=
(
VOID
*
)
0xdeadbeef
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
trace
(
"IDxDiagProvider::Initialize returned %x
\n
"
,
hr
);
}
/* Test passing an appropriately initialized DXDIAG_INIT_PARAMS. */
params
.
dwDxDiagHeaderVersion
=
DXDIAG_DX9_SDK_VERSION
;
params
.
bAllowWHQLChecks
=
FALSE
;
params
.
pReserved
=
NULL
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::Initialize to return S_OK, got %x
\n
"
,
hr
);
/* Test initializing multiple times. */
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::Initialize to return S_OK, got %x
\n
"
,
hr
);
IDxDiagProvider_Release
(
pddp
);
}
static
void
test_GetRootContainer
(
void
)
{
HRESULT
hr
;
IDxDiagProvider
*
pddp
;
IDxDiagContainer
*
pddc
;
DXDIAG_INIT_PARAMS
params
;
hr
=
CoCreateInstance
(
&
CLSID_DxDiagProvider
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDxDiagProvider
,
(
LPVOID
*
)
&
pddp
);
ok
(
hr
==
S_OK
,
"Creating a IDxDiagProvider instance failed with %x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create a IDxDiagProvider instance
\n
"
);
return
;
}
/* Test calling IDxDiagProvider::GetRootContainer before initialization. */
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
NULL
);
todo_wine
ok
(
hr
==
CO_E_NOTINITIALIZED
,
"Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x
\n
"
,
hr
);
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
&
pddc
);
todo_wine
ok
(
hr
==
CO_E_NOTINITIALIZED
,
"Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x
\n
"
,
hr
);
params
.
dwSize
=
sizeof
(
params
);
params
.
dwDxDiagHeaderVersion
=
DXDIAG_DX9_SDK_VERSION
;
params
.
bAllowWHQLChecks
=
FALSE
;
params
.
pReserved
=
NULL
;
hr
=
IDxDiagProvider_Initialize
(
pddp
,
&
params
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::Initialize to return S_OK, got %x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"IDxDiagProvider::Initialize failed
\n
"
);
IDxDiagProvider_Release
(
pddp
);
return
;
}
/* Passing NULL causes a crash on Windows. */
if
(
0
)
{
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
NULL
);
trace
(
"IDxDiagProvider::GetRootContainer returned %x
\n
"
,
hr
);
}
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
&
pddc
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::GetRootContainer to return S_OK, got %x
\n
"
,
hr
);
IDxDiagContainer_Release
(
pddc
);
IDxDiagProvider_Release
(
pddp
);
}
START_TEST
(
provider
)
{
CoInitialize
(
NULL
);
test_Initialize
();
test_GetRootContainer
();
CoUninitialize
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment