d3dxof: Add basic tests.

oldstable
Christian Costa 2008-08-19 00:30:44 +02:00 committed by Alexandre Julliard
parent c6b2529fd2
commit 04d72cdd6f
9 changed files with 100 additions and 0 deletions

1
.gitignore vendored
View File

@ -270,6 +270,7 @@ programs/winetest/d3d9_test.exe
programs/winetest/d3drm_test.exe
programs/winetest/d3dx8_test.exe
programs/winetest/d3dx9_36_test.exe
programs/winetest/d3dxof_test.exe
programs/winetest/ddraw_test.exe
programs/winetest/dinput_test.exe
programs/winetest/dnsapi_test.exe

View File

@ -231,6 +231,7 @@ ALL_MAKEFILES = \
dlls/d3dx9_36/tests/Makefile \
dlls/d3dx9_37/Makefile \
dlls/d3dxof/Makefile \
dlls/d3dxof/tests/Makefile \
dlls/dbghelp/Makefile \
dlls/dciman32/Makefile \
dlls/ddraw/Makefile \
@ -666,6 +667,7 @@ dlls/d3dx9_36/Makefile: dlls/d3dx9_36/Makefile.in dlls/Makedll.rules
dlls/d3dx9_36/tests/Makefile: dlls/d3dx9_36/tests/Makefile.in dlls/Maketest.rules
dlls/d3dx9_37/Makefile: dlls/d3dx9_37/Makefile.in dlls/Makedll.rules
dlls/d3dxof/Makefile: dlls/d3dxof/Makefile.in dlls/Makedll.rules
dlls/d3dxof/tests/Makefile: dlls/d3dxof/tests/Makefile.in dlls/Maketest.rules
dlls/dbghelp/Makefile: dlls/dbghelp/Makefile.in dlls/Makedll.rules
dlls/dciman32/Makefile: dlls/dciman32/Makefile.in dlls/Makedll.rules
dlls/ddraw/Makefile: dlls/ddraw/Makefile.in dlls/Makedll.rules

3
configure vendored
View File

@ -22041,6 +22041,8 @@ ac_config_files="$ac_config_files dlls/d3dx9_37/Makefile"
ac_config_files="$ac_config_files dlls/d3dxof/Makefile"
ac_config_files="$ac_config_files dlls/d3dxof/tests/Makefile"
ac_config_files="$ac_config_files dlls/dbghelp/Makefile"
ac_config_files="$ac_config_files dlls/dciman32/Makefile"
@ -23382,6 +23384,7 @@ do
"dlls/d3dx9_36/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx9_36/tests/Makefile" ;;
"dlls/d3dx9_37/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx9_37/Makefile" ;;
"dlls/d3dxof/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dxof/Makefile" ;;
"dlls/d3dxof/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dxof/tests/Makefile" ;;
"dlls/dbghelp/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dbghelp/Makefile" ;;
"dlls/dciman32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dciman32/Makefile" ;;
"dlls/ddraw/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ddraw/Makefile" ;;

View File

@ -1783,6 +1783,7 @@ AC_CONFIG_FILES([dlls/d3dx9_36/Makefile])
AC_CONFIG_FILES([dlls/d3dx9_36/tests/Makefile])
AC_CONFIG_FILES([dlls/d3dx9_37/Makefile])
AC_CONFIG_FILES([dlls/d3dxof/Makefile])
AC_CONFIG_FILES([dlls/d3dxof/tests/Makefile])
AC_CONFIG_FILES([dlls/dbghelp/Makefile])
AC_CONFIG_FILES([dlls/dciman32/Makefile])
AC_CONFIG_FILES([dlls/ddraw/Makefile])

View File

@ -304,6 +304,7 @@ TESTSUBDIRS = \
d3drm/tests \
d3dx8/tests \
d3dx9_36/tests \
d3dxof/tests \
ddraw/tests \
dinput/tests \
dnsapi/tests \

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = d3dxof.dll
IMPORTS = d3dxof kernel32
CTESTS = \
d3dxof.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -0,0 +1,75 @@
/*
* Some unit tests for d3dxof
*
* Copyright (C) 2008 Christian Costa
*
* 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 <assert.h>
#include "wine/test.h"
#include "dxfile.h"
char template[] =
"xof 0302 txt 064\n"
"template Header\n"
"{\n"
"<3D82AB43-62DA-11CF-AB390020AF71E433>\n"
"WORD major ;\n"
"WORD minor ;\n"
"DWORD flags ;\n"
"}\n";
static unsigned long getRefcount(IUnknown *iface)
{
IUnknown_AddRef(iface);
return IUnknown_Release(iface);
}
static void test_d3dxof(void)
{
HRESULT hr;
unsigned long ref;
LPDIRECTXFILE lpDirectXFile = NULL;
hr = DirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
if(!lpDirectXFile)
{
trace("Couldn't create DirectXFile interface, skipping tests\n");
return;
}
ref = getRefcount( (IUnknown *) lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
ref = IDirectXFile_AddRef(lpDirectXFile);
ok(ref == 2, "Got refcount %ld, expected 1\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
/* RegisterTemplates does not support txt format yet */
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, strlen(template));
todo_wine ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
ref = IDirectXFile_Release(lpDirectXFile);
ok(ref == 0, "Got refcount %ld, expected 1\n", ref);
}
START_TEST(d3dxof)
{
test_d3dxof();
}

View File

@ -39,6 +39,7 @@ TESTBINS = \
d3drm_test.exe \
d3dx8_test.exe \
d3dx9_36_test.exe \
d3dxof_test.exe \
ddraw_test.exe \
dinput_test.exe \
dnsapi_test.exe \
@ -139,6 +140,8 @@ d3dx8_test.exe: $(DLLDIR)/d3dx8/tests/d3dx8_test.exe$(DLLEXT)
cp $(DLLDIR)/d3dx8/tests/d3dx8_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3dx9_36_test.exe: $(DLLDIR)/d3dx9_36/tests/d3dx9_36_test.exe$(DLLEXT)
cp $(DLLDIR)/d3dx9_36/tests/d3dx9_36_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3dxof_test.exe: $(DLLDIR)/d3dxof/tests/d3dxof_test.exe$(DLLEXT)
cp $(DLLDIR)/d3dxof/tests/d3dxof_test.exe$(DLLEXT) $@ && $(STRIP) $@
ddraw_test.exe: $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT)
cp $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT) $@ && $(STRIP) $@
dinput_test.exe: $(DLLDIR)/dinput/tests/dinput_test.exe$(DLLEXT)

View File

@ -100,6 +100,7 @@ d3d9_test.exe TESTRES "d3d9_test.exe"
d3drm_test.exe TESTRES "d3drm_test.exe"
d3dx8_test.exe TESTRES "d3dx8_test.exe"
d3dx9_36_test.exe TESTRES "d3dx9_36_test.exe"
d3dxof_test.exe TESTRES "d3dxof_test.exe"
ddraw_test.exe TESTRES "ddraw_test.exe"
dinput_test.exe TESTRES "dinput_test.exe"
dnsapi_test.exe TESTRES "dnsapi_test.exe"