[gnome-break-timer] Fix spurious failure in test_deserialize_hardcoded



commit ddaeb178fb322892aad5d015c69e3069bbf72fe1
Author: Dylan McCall <dylanmccall ubuntu com>
Date:   Sat Sep 21 09:15:31 2013 -0700

    Fix spurious failure in test_deserialize_hardcoded

 tests/helper-util/test_StatefulTimer.vala |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tests/helper-util/test_StatefulTimer.vala b/tests/helper-util/test_StatefulTimer.vala
index b51a11a..ae0b8a3 100644
--- a/tests/helper-util/test_StatefulTimer.vala
+++ b/tests/helper-util/test_StatefulTimer.vala
@@ -95,8 +95,9 @@ public class test_StatefulTimer : TestSuiteWithActivityMonitor {
                        timer.deserialize (data);
 
                        assert (timer.state == StatefulTimer.State.STOPPED);
-                       assert (timer.elapsed () == 20.0);
-                       assert (timer.lap_time () == 5.0);
+                       // Convert time values to ints to deal with floating point errors
+                       assert ((int)timer.elapsed () == 20);
+                       assert ((int)timer.lap_time () == 5);
                }
        }
 }
\ No newline at end of file


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