Zebediah Figura : quartz/tests: Fix a test failure on 32-bit Windows.

Alexandre Julliard julliard at winehq.org
Mon May 11 16:08:36 CDT 2020


Module: wine
Branch: master
Commit: 34648344435dfa46554ddd06edd1e5b3f67937bd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=34648344435dfa46554ddd06edd1e5b3f67937bd

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon May 11 11:03:06 2020 -0500

quartz/tests: Fix a test failure on 32-bit Windows.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/vmr9.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index 656f943ca3..3a3863ff50 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <stdint.h>
 #define COBJMACROS
 #include "ocidl.h"
 #include "olectl.h"
@@ -70,6 +71,22 @@ 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)
+{
+    int64_t x = *(int64_t *)&f;
+    int64_t y = *(int64_t *)&g;
+
+    if (x < 0)
+        x = INT64_MIN - x;
+    if (y < 0)
+        y = INT64_MIN - y;
+
+    if (abs(x - y) > ulps)
+        return FALSE;
+
+    return TRUE;
+}
+
 static IFilterGraph2 *create_graph(void)
 {
     IFilterGraph2 *ret;
@@ -3693,7 +3710,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);
+    todo_wine ok(compare_double(reftime, 0.02, 1 << 28), "Got frame rate %.16e.\n", reftime);
 
     l = 0xdeadbeef;
     hr = IBasicVideo_get_BitRate(video, &l);




More information about the wine-cvs mailing list