diff data/model/test/TestSparseModels.h @ 1689:d7b04b0ed056 single-point

Build fix for older Qt
author Chris Cannam
date Fri, 05 Apr 2019 13:40:08 +0100
parents 0e9840a381b5
children c077a97d055f
line wrap: on
line diff
--- a/data/model/test/TestSparseModels.h	Thu Apr 04 14:10:57 2019 +0100
+++ b/data/model/test/TestSparseModels.h	Fri Apr 05 13:40:08 2019 +0100
@@ -42,10 +42,10 @@
         SparseOneDimensionalModel m(100, 10, false);
         QCOMPARE(m.isEmpty(), true);
         QCOMPARE(m.getEventCount(), 0);
-        QCOMPARE(m.getAllEvents().size(), 0);
+        QCOMPARE(m.getAllEvents().size(), size_t(0));
         QCOMPARE(m.getStartFrame(), 0);
         QCOMPARE(m.getEndFrame(), 0);
-        QCOMPARE(m.getSampleRate(), 100);
+        QCOMPARE(m.getSampleRate(), 100.0);
         QCOMPARE(m.getResolution(), 10);
         QCOMPARE(m.isSparse(), true);
 
@@ -54,7 +54,7 @@
         m.remove(p);
         QCOMPARE(m.isEmpty(), true);
         QCOMPARE(m.getEventCount(), 0);
-        QCOMPARE(m.getAllEvents().size(), 0);
+        QCOMPARE(m.getAllEvents().size(), size_t(0));
         QCOMPARE(m.getStartFrame(), 0);
         QCOMPARE(m.getEndFrame(), 0);
     }
@@ -69,7 +69,7 @@
         m.add(p2);
         QCOMPARE(m.isEmpty(), false);
         QCOMPARE(m.getEventCount(), 2);
-        QCOMPARE(m.getAllEvents().size(), 2);
+        QCOMPARE(m.getAllEvents().size(), size_t(2));
         QCOMPARE(*m.getAllEvents().begin(), p1);
         QCOMPARE(*m.getAllEvents().rbegin(), p2);
         QCOMPARE(m.getStartFrame(), 20);
@@ -77,7 +77,7 @@
         QCOMPARE(m.containsEvent(p1), true);
         m.remove(p1);
         QCOMPARE(m.getEventCount(), 1);
-        QCOMPARE(m.getAllEvents().size(), 1);
+        QCOMPARE(m.getAllEvents().size(), size_t(1));
         QCOMPARE(*m.getAllEvents().begin(), p2);
         QCOMPARE(m.getStartFrame(), 50);
         QCOMPARE(m.getEndFrame(), 60);
@@ -90,22 +90,22 @@
         m.add(p1);
         m.add(p2);
         m.add(p3);
-        QCOMPARE(m.getAllEvents().size(), 3);
+        QCOMPARE(m.getAllEvents().size(), size_t(3));
         QCOMPARE(*m.getAllEvents().begin(), p1);
         QCOMPARE(*m.getAllEvents().rbegin(), p3);
 
         // The EventSeries that is used internally is tested more
         // thoroughly in its own test suite. This is just a check
         auto pp = m.getEventsWithin(20, 10);
-        QCOMPARE(pp.size(), 2);
+        QCOMPARE(pp.size(), size_t(2));
         QCOMPARE(*pp.begin(), p1);
         QCOMPARE(*pp.rbegin(), p2);
         
         pp = m.getEventsWithin(40, 10);
-        QCOMPARE(pp.size(), 0);
+        QCOMPARE(pp.size(), size_t(0));
 
         pp = m.getEventsStartingAt(50);
-        QCOMPARE(pp.size(), 1);
+        QCOMPARE(pp.size(), size_t(1));
         QCOMPARE(*pp.begin(), p3);
     }
 
@@ -147,7 +147,7 @@
         m.add(p2);
         QCOMPARE(m.isEmpty(), false);
         QCOMPARE(m.getEventCount(), 2);
-        QCOMPARE(m.getAllEvents().size(), 2);
+        QCOMPARE(m.getAllEvents().size(), size_t(2));
         QCOMPARE(*m.getAllEvents().begin(), p1);
         QCOMPARE(*m.getAllEvents().rbegin(), p2);
         QCOMPARE(m.getStartFrame(), 20);
@@ -157,7 +157,7 @@
         QCOMPARE(m.getValueMaximum(), 124.3f);
         m.remove(p1);
         QCOMPARE(m.getEventCount(), 1);
-        QCOMPARE(m.getAllEvents().size(), 1);
+        QCOMPARE(m.getAllEvents().size(), size_t(1));
         QCOMPARE(*m.getAllEvents().begin(), p2);
         QCOMPARE(m.getStartFrame(), 50);
         QCOMPARE(m.getEndFrame(), 80);
@@ -173,24 +173,24 @@
         m.add(p2);
         m.add(p3);
 
-        QCOMPARE(m.getAllEvents().size(), 3);
+        QCOMPARE(m.getAllEvents().size(), size_t(3));
         QCOMPARE(*m.getAllEvents().begin(), p1);
         QCOMPARE(*m.getAllEvents().rbegin(), p3);
 
         auto pp = m.getEventsSpanning(20, 10);
-        QCOMPARE(pp.size(), 2);
+        QCOMPARE(pp.size(), size_t(2));
         QCOMPARE(*pp.begin(), p1);
         QCOMPARE(*pp.rbegin(), p2);
 
         pp = m.getEventsSpanning(30, 20);
-        QCOMPARE(pp.size(), 1);
+        QCOMPARE(pp.size(), size_t(1));
         QCOMPARE(*pp.begin(), p2);
 
         pp = m.getEventsSpanning(40, 10);
-        QCOMPARE(pp.size(), 0);
+        QCOMPARE(pp.size(), size_t(0));
 
         pp = m.getEventsCovering(50);
-        QCOMPARE(pp.size(), 1);
+        QCOMPARE(pp.size(), size_t(1));
         QCOMPARE(*pp.begin(), p3);
     }