diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index ca1c87d..b418126 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -2281,6 +2281,37 @@ static void test_D3DXFloat_Array(void) ok(relative_error(single, testdata[i].single_out_ver2) < admitted_error, "Got %f, expected %f for index %d.\n", single, testdata[i].single_out_ver2, i); } + + { + HMODULE dll_handle = NULL; + D3DXFLOAT16 res, res2; + D3DXFLOAT16* (WINAPI * float32to16)(D3DXFLOAT16 *pout, CONST FLOAT *pin, UINT n); + union + { + float f; + DWORD d; + } x; + + dll_handle = LoadLibraryA("d3dx9_36_2.dll"); + if (!dll_handle) skip("init: Could not load d3dx9_36_2.dll.\n"); + + float32to16 = (void *)GetProcAddress(dll_handle, "D3DXFloat32To16Array"); + if (!float32to16) + { + FreeLibrary(dll_handle); + skip("init: Could not get function pointer (D3DXFloat32To16Array).\n"); + } + + for (i = 0; i < 0xfffff000; i += 0xfff) + { + x.d = i; + float32to16(&res, &x.f, 1); + D3DXFloat32To16Array(&res2, &x.f, 1); + + ok(res.value == res2.value, "Failed i=%#x f=%f (%#x!=%#x)\n", i, x.f, res.value, res2.value); + } + FreeLibrary(dll_handle); + } } START_TEST(math)