diff base/test/TestScaleTickIntervals.h @ 1408:f89365917d02 scale-ticks

These tests now pass, but there's still a lot to be done
author Chris Cannam
date Wed, 03 May 2017 17:02:01 +0100
parents 25ed6dde2ce0
children 21ba60008200
line wrap: on
line diff
--- a/base/test/TestScaleTickIntervals.h	Wed May 03 13:02:08 2017 +0100
+++ b/base/test/TestScaleTickIntervals.h	Wed May 03 17:02:01 2017 +0100
@@ -47,16 +47,20 @@
     void compareTicks(vector<ScaleTickIntervals::Tick> ticks,
 		      vector<ScaleTickIntervals::Tick> expected)
     {
+        double eps = 1e-7;
 	for (int i = 0; i < int(expected.size()); ++i) {
 	    if (i < int(ticks.size())) {
 		if (ticks[i].label != expected[i].label ||
-		    ticks[i].value != expected[i].value) {
+		    fabs(ticks[i].value - expected[i].value) > eps) {
 		    printDiff(ticks, expected);
 		}
 		QCOMPARE(ticks[i].label, expected[i].label);
 		QCOMPARE(ticks[i].value, expected[i].value);
 	    }
 	}
+        if (ticks.size() != expected.size()) {
+            printDiff(ticks, expected);
+        }
 	QCOMPARE(ticks.size(), expected.size());
     }