diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index f1b19aa6634..d7eafe53be8 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #define COBJMACROS #include "dshow.h" #include "d3d9.h" @@ -65,6 +66,23 @@ static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TY && !memcmp(a->pbFormat, b->pbFormat, a->cbFormat); } +static BOOL compare_double(double f, double g, unsigned int ulps) +{ + uint64_t x = *(ULONGLONG *)&f; + uint64_t y = *(ULONGLONG *)&g; + + if (f < 0) + x = ~x + 1; + else + x |= ((ULONGLONG)1)<<63; + if (g < 0) + y = ~y + 1; + else + y |= ((ULONGLONG)1)<<63; + + return (x>y ? x-y : y-x) <= ulps; +} + static IFilterGraph2 *create_graph(void) { IFilterGraph2 *ret; @@ -2707,7 +2725,7 @@ static void test_basic_video(void) reftime = 0.0; hr = IBasicVideo_get_AvgTimePerFrame(video, &reftime); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(reftime == 0.02, "Got frame rate %.16e.\n", reftime); + ok(compare_double(reftime, 0.02, 1 << 28), "Got frame rate %.16e.\n", reftime); l = 0xdeadbeef; hr = IBasicVideo_get_BitRate(video, &l);