Mercurial > hg > svcore
comparison data/model/test/TestSparseModels.h @ 1717:417528c41e66
Build fix for Travis
author | Chris Cannam |
---|---|
date | Fri, 17 May 2019 12:41:06 +0100 |
parents | c077a97d055f |
children | 9d82b164f264 |
comparison
equal
deleted
inserted
replaced
1716:021556fcd30b | 1717:417528c41e66 |
---|---|
41 void s1d_empty() { | 41 void s1d_empty() { |
42 SparseOneDimensionalModel m(100, 10, false); | 42 SparseOneDimensionalModel m(100, 10, false); |
43 QCOMPARE(m.isEmpty(), true); | 43 QCOMPARE(m.isEmpty(), true); |
44 QCOMPARE(m.getEventCount(), 0); | 44 QCOMPARE(m.getEventCount(), 0); |
45 QCOMPARE(m.getAllEvents().size(), size_t(0)); | 45 QCOMPARE(m.getAllEvents().size(), size_t(0)); |
46 QCOMPARE(m.getStartFrame(), 0); | 46 QCOMPARE(m.getStartFrame(), sv_frame_t(0)); |
47 QCOMPARE(m.getEndFrame(), 0); | 47 QCOMPARE(m.getEndFrame(), sv_frame_t(0)); |
48 QCOMPARE(m.getSampleRate(), 100.0); | 48 QCOMPARE(m.getSampleRate(), 100.0); |
49 QCOMPARE(m.getResolution(), 10); | 49 QCOMPARE(m.getResolution(), 10); |
50 QCOMPARE(m.isSparse(), true); | 50 QCOMPARE(m.isSparse(), true); |
51 | 51 |
52 Event p(10); | 52 Event p(10); |
53 m.add(p); | 53 m.add(p); |
54 m.remove(p); | 54 m.remove(p); |
55 QCOMPARE(m.isEmpty(), true); | 55 QCOMPARE(m.isEmpty(), true); |
56 QCOMPARE(m.getEventCount(), 0); | 56 QCOMPARE(m.getEventCount(), 0); |
57 QCOMPARE(m.getAllEvents().size(), size_t(0)); | 57 QCOMPARE(m.getAllEvents().size(), size_t(0)); |
58 QCOMPARE(m.getStartFrame(), 0); | 58 QCOMPARE(m.getStartFrame(), sv_frame_t(0)); |
59 QCOMPARE(m.getEndFrame(), 0); | 59 QCOMPARE(m.getEndFrame(), sv_frame_t(0)); |
60 } | 60 } |
61 | 61 |
62 void s1d_extents() { | 62 void s1d_extents() { |
63 SparseOneDimensionalModel m(100, 10, false); | 63 SparseOneDimensionalModel m(100, 10, false); |
64 Event p1(20); | 64 Event p1(20); |
70 QCOMPARE(m.isEmpty(), false); | 70 QCOMPARE(m.isEmpty(), false); |
71 QCOMPARE(m.getEventCount(), 2); | 71 QCOMPARE(m.getEventCount(), 2); |
72 QCOMPARE(m.getAllEvents().size(), size_t(2)); | 72 QCOMPARE(m.getAllEvents().size(), size_t(2)); |
73 QCOMPARE(*m.getAllEvents().begin(), p1); | 73 QCOMPARE(*m.getAllEvents().begin(), p1); |
74 QCOMPARE(*m.getAllEvents().rbegin(), p2); | 74 QCOMPARE(*m.getAllEvents().rbegin(), p2); |
75 QCOMPARE(m.getStartFrame(), 20); | 75 QCOMPARE(m.getStartFrame(), sv_frame_t(20)); |
76 QCOMPARE(m.getEndFrame(), 60); | 76 QCOMPARE(m.getEndFrame(), sv_frame_t(60)); |
77 QCOMPARE(m.containsEvent(p1), true); | 77 QCOMPARE(m.containsEvent(p1), true); |
78 m.remove(p1); | 78 m.remove(p1); |
79 QCOMPARE(m.getEventCount(), 1); | 79 QCOMPARE(m.getEventCount(), 1); |
80 QCOMPARE(m.getAllEvents().size(), size_t(1)); | 80 QCOMPARE(m.getAllEvents().size(), size_t(1)); |
81 QCOMPARE(*m.getAllEvents().begin(), p2); | 81 QCOMPARE(*m.getAllEvents().begin(), p2); |
82 QCOMPARE(m.getStartFrame(), 50); | 82 QCOMPARE(m.getStartFrame(), sv_frame_t(50)); |
83 QCOMPARE(m.getEndFrame(), 60); | 83 QCOMPARE(m.getEndFrame(), sv_frame_t(60)); |
84 QCOMPARE(m.containsEvent(p1), false); | 84 QCOMPARE(m.containsEvent(p1), false); |
85 } | 85 } |
86 | 86 |
87 void s1d_sample() { | 87 void s1d_sample() { |
88 SparseOneDimensionalModel m(100, 10, false); | 88 SparseOneDimensionalModel m(100, 10, false); |
148 QCOMPARE(m.isEmpty(), false); | 148 QCOMPARE(m.isEmpty(), false); |
149 QCOMPARE(m.getEventCount(), 2); | 149 QCOMPARE(m.getEventCount(), 2); |
150 QCOMPARE(m.getAllEvents().size(), size_t(2)); | 150 QCOMPARE(m.getAllEvents().size(), size_t(2)); |
151 QCOMPARE(*m.getAllEvents().begin(), p1); | 151 QCOMPARE(*m.getAllEvents().begin(), p1); |
152 QCOMPARE(*m.getAllEvents().rbegin(), p2); | 152 QCOMPARE(*m.getAllEvents().rbegin(), p2); |
153 QCOMPARE(m.getStartFrame(), 20); | 153 QCOMPARE(m.getStartFrame(), sv_frame_t(20)); |
154 QCOMPARE(m.getEndFrame(), 80); | 154 QCOMPARE(m.getEndFrame(), sv_frame_t(80)); |
155 QCOMPARE(m.containsEvent(p1), true); | 155 QCOMPARE(m.containsEvent(p1), true); |
156 QCOMPARE(m.getValueMinimum(), 123.4f); | 156 QCOMPARE(m.getValueMinimum(), 123.4f); |
157 QCOMPARE(m.getValueMaximum(), 124.3f); | 157 QCOMPARE(m.getValueMaximum(), 124.3f); |
158 m.remove(p1); | 158 m.remove(p1); |
159 QCOMPARE(m.getEventCount(), 1); | 159 QCOMPARE(m.getEventCount(), 1); |
160 QCOMPARE(m.getAllEvents().size(), size_t(1)); | 160 QCOMPARE(m.getAllEvents().size(), size_t(1)); |
161 QCOMPARE(*m.getAllEvents().begin(), p2); | 161 QCOMPARE(*m.getAllEvents().begin(), p2); |
162 QCOMPARE(m.getStartFrame(), 50); | 162 QCOMPARE(m.getStartFrame(), sv_frame_t(50)); |
163 QCOMPARE(m.getEndFrame(), 80); | 163 QCOMPARE(m.getEndFrame(), sv_frame_t(80)); |
164 QCOMPARE(m.containsEvent(p1), false); | 164 QCOMPARE(m.containsEvent(p1), false); |
165 } | 165 } |
166 | 166 |
167 void note_sample() { | 167 void note_sample() { |
168 NoteModel m(100, 10, false); | 168 NoteModel m(100, 10, false); |