240 QTest::addColumn<QTime>("testedStartValue"); |
240 QTest::addColumn<QTime>("testedStartValue"); |
241 QTest::addColumn<QTime>("testedEndValue"); |
241 QTest::addColumn<QTime>("testedEndValue"); |
242 QTest::addColumn<QTime>("testStartValue"); |
242 QTest::addColumn<QTime>("testStartValue"); |
243 QTest::addColumn<QTime>("testEndValue"); |
243 QTest::addColumn<QTime>("testEndValue"); |
244 |
244 |
245 QTest::newRow("Full time start and end") << QTime(10,00,00) |
245 QTest::newRow("Full time start and end") |
246 << QTime(11,00,00) |
246 << QTime(10,00,00) |
247 << QTime(10,00,00) |
247 << QTime(11,00,00) |
248 << QTime(11,00,00); |
248 << QTime(10,00,00) |
249 QTest::newRow("Exactly 30min time start and end") << QTime(10,30,00) |
249 << QTime(11,00,00); |
250 << QTime(11,30,00) |
250 QTest::newRow("Exactly 15m time start and end") |
251 << QTime(10,30,00) |
251 << QTime(10, 15, 00) |
252 << QTime(11,30,00); |
252 << QTime(11, 15, 00) |
253 QTest::newRow("More than 30min time start and end") << QTime(10,40,00) |
253 << QTime(10, 15, 00) |
254 << QTime(12,35,00) |
254 << QTime(11, 15, 00); |
255 << QTime(10,30,00) |
255 QTest::newRow("More than 15m, less than 30m time start and end") |
256 << QTime(13,00,00); |
256 << QTime(10,18,00) |
257 QTest::newRow("time start > 30m and end > 23h30m") << QTime(20,35,00) |
257 << QTime(10,24,00) |
258 << QTime(23,35,00) |
258 << QTime(10,15,00) |
259 << QTime(20,30,00) |
259 << QTime(10,30,00); |
260 << QTime(23,59,00); |
260 QTest::newRow("Exactly 30m time start and end") |
261 QTest::newRow("time start < 30m and end > 23h00m") << QTime(11,19,00) |
261 << QTime(9, 30, 00) |
262 << QTime(23,10,00) |
262 << QTime(10, 30, 00) |
263 << QTime(11,00,00) |
263 << QTime(9, 30, 00) |
264 << QTime(23,30,00); |
264 << QTime(10, 30, 00); |
|
265 QTest::newRow("More than 30m, less than 45m time start and end") |
|
266 << QTime(10,32,00) |
|
267 << QTime(10,43,00) |
|
268 << QTime(10,30,00) |
|
269 << QTime(10,45,00); |
|
270 QTest::newRow("Exactly 45m time start and end") |
|
271 << QTime(9, 45, 00) |
|
272 << QTime(10, 45, 00) |
|
273 << QTime(9, 45, 00) |
|
274 << QTime(10, 45, 00); |
|
275 QTest::newRow("More than 45m, less than 60m time start and end") |
|
276 << QTime(10,48,00) |
|
277 << QTime(10,57,00) |
|
278 << QTime(10,45,00) |
|
279 << QTime(11,00,00); |
|
280 QTest::newRow("time start > 45m and end > 23h45m") |
|
281 << QTime(20,47,00) |
|
282 << QTime(23,55,00) |
|
283 << QTime(20,45,00) |
|
284 << QTime(23,59,00); |
|
285 QTest::newRow("time start < 30m and (23h30m < end < 23h45m") |
|
286 << QTime(11,19,00) |
|
287 << QTime(23,38,00) |
|
288 << QTime(11,15,00) |
|
289 << QTime(23,45,00); |
265 } |
290 } |
266 |
291 |
267 /*! |
292 /*! |
268 Test calculating start and end time drawing of event bubble on prepared data |
293 Test calculating start and end time drawing of event bubble on prepared data |
269 \sa testCalculateStartEndTimePosition_data |
294 \sa testCalculateStartEndTimePosition_data |
277 QFETCH(QTime, testEndValue); |
302 QFETCH(QTime, testEndValue); |
278 |
303 |
279 //run function |
304 //run function |
280 QPair<QTime,QTime> testStartEndValue |
305 QPair<QTime,QTime> testStartEndValue |
281 = mStatusStrip->calculateStartEndPostion(testedStartValue, |
306 = mStatusStrip->calculateStartEndPostion(testedStartValue, |
282 testedEndValue); |
307 testedEndValue); |
283 //check data |
308 //check data |
284 QCOMPARE(testStartEndValue.first,testStartValue); |
309 QCOMPARE(testStartEndValue.first,testStartValue); |
285 QCOMPARE(testStartEndValue.second,testEndValue); |
310 QCOMPARE(testStartEndValue.second,testEndValue); |
286 } |
311 } |
287 |
312 |