[at-spi2-atk: 3/4] atk_test_value: Use exactly representable float values



commit c633a9d18495910ff9fc57b192779b486ec640b2
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Mon Aug 26 10:31:34 2019 +0200

    atk_test_value: Use exactly representable float values
    
    Some archs might round them differently from xml and from C, leading to
    float comparison failure, e.g. on i386.

 tests/atk_test_value.c    | 8 ++++----
 tests/data/test-value.xml | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tests/atk_test_value.c b/tests/atk_test_value.c
index 4638293..0911603 100644
--- a/tests/atk_test_value.c
+++ b/tests/atk_test_value.c
@@ -43,7 +43,7 @@ atk_test_value_get_minimum_value (gpointer fixture, gconstpointer user_data)
   g_assert (child);
   AtspiValue *obj = atspi_accessible_get_value_iface (child);
   gdouble val = atspi_value_get_minimum_value (obj, NULL);
-  g_assert_cmpfloat (val, ==, 1.1);
+  g_assert_cmpfloat (val, ==, 1.25);
 }
 
 static void
@@ -55,7 +55,7 @@ atk_test_value_get_current_value (gpointer fixture, gconstpointer user_data)
   g_assert (child);
   AtspiValue *obj = atspi_accessible_get_value_iface (child);
   gdouble val = atspi_value_get_current_value (obj, NULL);
-  g_assert_cmpfloat (val, ==, 2.1);
+  g_assert_cmpfloat (val, ==, 2.25);
 }
 
 static void
@@ -67,7 +67,7 @@ atk_test_value_get_maximum_value (gpointer fixture, gconstpointer user_data)
   g_assert (child);
   AtspiValue *obj = atspi_accessible_get_value_iface (child);
   gdouble val = atspi_value_get_maximum_value (obj, NULL);
-  g_assert_cmpfloat (val, ==, 3.1);
+  g_assert_cmpfloat (val, ==, 3.25);
 }
 
 static void
@@ -92,7 +92,7 @@ atk_test_value_get_minimum_increment (gpointer fixture, gconstpointer user_data)
   g_assert (child);
   AtspiValue *obj = atspi_accessible_get_value_iface (child);
   gdouble val = atspi_value_get_minimum_increment (obj, NULL);
-  g_assert_cmpfloat (val, ==, 0.1);
+  g_assert_cmpfloat (val, ==, 0.25);
 }
 
 static void
diff --git a/tests/data/test-value.xml b/tests/data/test-value.xml
index 83172d5..1f5ae6c 100644
--- a/tests/data/test-value.xml
+++ b/tests/data/test-value.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?>
 <accessible description="Root of the accessible tree" name="root_object" role="accelerator label">
        <accessible_value description="first child" name="obj0" role="alert">
-               <value_node min="1.1" current="2.1" max="3.1" step="0.1"/>
+               <value_node min="1.25" current="2.25" max="3.25" step="0.25"/>
        </accessible_value>
 </accessible>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]