Commit e4ba8eb4 authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Implement D3DX8Vec2Length with a test.

parent 6d6b9a38
......@@ -94,6 +94,9 @@ dlls/d3drm/tests/d3drm_crosstest.exe
dlls/d3drm/tests/testlist.c
dlls/d3drm/version.res
dlls/d3dx8/libd3dx8.def
dlls/d3dx8/tests/*.ok
dlls/d3dx8/tests/d3dx8_crosstest.exe
dlls/d3dx8/tests/testlist.c
dlls/d3dxof/libd3dxof.def
dlls/d3dxof/version.res
dlls/dbghelp/libdbghelp.def
......@@ -687,6 +690,7 @@ programs/winetest/crypt32_test.exe
programs/winetest/d3d8_test.exe
programs/winetest/d3d9_test.exe
programs/winetest/d3drm_test.exe
programs/winetest/d3dx8_test.exe
programs/winetest/ddraw_test.exe
programs/winetest/dinput_test.exe
programs/winetest/dnsapi_test.exe
......
......@@ -198,6 +198,7 @@ ALL_MAKEFILES = \
dlls/d3drm/Makefile \
dlls/d3drm/tests/Makefile \
dlls/d3dx8/Makefile \
dlls/d3dx8/tests/Makefile \
dlls/d3dxof/Makefile \
dlls/dbghelp/Makefile \
dlls/dciman32/Makefile \
......@@ -570,6 +571,7 @@ dlls/d3dim/Makefile: dlls/d3dim/Makefile.in dlls/Makedll.rules
dlls/d3drm/Makefile: dlls/d3drm/Makefile.in dlls/Makedll.rules
dlls/d3drm/tests/Makefile: dlls/d3drm/tests/Makefile.in dlls/Maketest.rules
dlls/d3dx8/Makefile: dlls/d3dx8/Makefile.in dlls/Makedll.rules
dlls/d3dx8/tests/Makefile: dlls/d3dx8/tests/Makefile.in dlls/Maketest.rules
dlls/d3dxof/Makefile: dlls/d3dxof/Makefile.in dlls/Makedll.rules
dlls/dbghelp/Makefile: dlls/dbghelp/Makefile.in dlls/Makedll.rules
dlls/dciman32/Makefile: dlls/dciman32/Makefile.in dlls/Makedll.rules
......
......@@ -20356,6 +20356,8 @@ ac_config_files="$ac_config_files dlls/d3drm/tests/Makefile"
ac_config_files="$ac_config_files dlls/d3dx8/Makefile"
ac_config_files="$ac_config_files dlls/d3dx8/tests/Makefile"
ac_config_files="$ac_config_files dlls/d3dxof/Makefile"
ac_config_files="$ac_config_files dlls/dbghelp/Makefile"
......@@ -21596,6 +21598,7 @@ do
"dlls/d3drm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/Makefile" ;;
"dlls/d3drm/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/tests/Makefile" ;;
"dlls/d3dx8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;;
"dlls/d3dx8/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/tests/Makefile" ;;
"dlls/d3dxof/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dxof/Makefile" ;;
"dlls/dbghelp/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dbghelp/Makefile" ;;
"dlls/dciman32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dciman32/Makefile" ;;
......
......@@ -1598,6 +1598,7 @@ AC_CONFIG_FILES([dlls/d3dim/Makefile])
AC_CONFIG_FILES([dlls/d3drm/Makefile])
AC_CONFIG_FILES([dlls/d3drm/tests/Makefile])
AC_CONFIG_FILES([dlls/d3dx8/Makefile])
AC_CONFIG_FILES([dlls/d3dx8/tests/Makefile])
AC_CONFIG_FILES([dlls/d3dxof/Makefile])
AC_CONFIG_FILES([dlls/dbghelp/Makefile])
AC_CONFIG_FILES([dlls/dciman32/Makefile])
......
......@@ -255,6 +255,7 @@ TESTSUBDIRS = \
d3d8/tests \
d3d9/tests \
d3drm/tests \
d3dx8/tests \
ddraw/tests \
dinput/tests \
dnsapi/tests \
......
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = d3dx8.dll
IMPORTS = kernel32
EXTRALIBS = -ldxguid
CTESTS = math.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend
/*
* Copyright 2007 David Adam
*
* 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
*/
#include <assert.h>
#include "d3dx8math.h"
#include "d3dx8math.inl"
#include "wine/test.h"
#define admitted_error 0.00001f
static void D3X8Vector2Test(void)
{
D3DXVECTOR2 u;
FLOAT expected, got;
u.x=3.0f; u.y=4.0f;
/*_______________D3DXVec2Length__________________________*/
expected = 5.0f;
got = D3DXVec2Length(&u);
ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got);
/* Tests the case NULL */
expected=0.0f;
got= D3DXVec2Length(NULL);
ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got);
}
START_TEST(math)
{
D3X8Vector2Test();
}
......@@ -108,6 +108,7 @@ SRCDIR_INCLUDES = \
d3dx8.h \
d3dx8core.h \
d3dx8math.h \
d3dx8math.inl \
dbghelp.h \
dbinit.idl \
dbprop.idl \
......
......@@ -58,4 +58,6 @@ typedef struct D3DXCOLOR
FLOAT r, g, b, a;
} D3DXCOLOR, *LPD3DXCOLOR;
FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv);
#endif /* __D3DX8MATH_H__ */
/*
* Copyright (C) 2007 David Adam
*
* 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
*/
#ifndef __D3DX8MATH_INL__
#define __D3DX8MATH_INL__
extern inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv)
{
if (!pv) return 0.0f;
return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
}
#endif
......@@ -31,6 +31,7 @@ TESTBINS = \
d3d8_test.exe \
d3d9_test.exe \
d3drm_test.exe \
d3dx8_test.exe \
ddraw_test.exe \
dinput_test.exe \
dnsapi_test.exe \
......@@ -111,6 +112,8 @@ d3d9_test.exe: $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT)
cp $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3drm_test.exe: $(DLLDIR)/d3drm/tests/d3drm_test.exe$(DLLEXT)
cp $(DLLDIR)/d3drm/tests/d3drm_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3dx8_test.exe: $(DLLDIR)/d3dx8/tests/d3dx8_test.exe$(DLLEXT)
cp $(DLLDIR)/d3dx8/tests/d3dx8_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)
......
......@@ -89,6 +89,7 @@ crypt32_test.exe TESTRES "crypt32_test.exe"
d3d8_test.exe TESTRES "d3d8_test.exe"
d3d9_test.exe TESTRES "d3d9_test.exe"
d3drm_test.exe TESTRES "d3drm_test.exe"
d3dx8_test.exe TESTRES "d3dx8_test.exe"
ddraw_test.exe TESTRES "ddraw_test.exe"
dinput_test.exe TESTRES "dinput_test.exe"
dnsapi_test.exe TESTRES "dnsapi_test.exe"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment