Changeset View
Changeset View
Standalone View
Standalone View
autotests/QueryTest.cpp
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 271 | { | |||
---|---|---|---|---|---|
292 | } | 292 | } | ||
293 | 293 | | |||
294 | { | 294 | { | ||
295 | auto query = LinkedResources | RecentlyCreatedFirst | HighScoredFirst; | 295 | auto query = LinkedResources | RecentlyCreatedFirst | HighScoredFirst; | ||
296 | QCOMPARE(query.ordering(), HighScoredFirst); | 296 | QCOMPARE(query.ordering(), HighScoredFirst); | ||
297 | } | 297 | } | ||
298 | } | 298 | } | ||
299 | 299 | | |||
300 | void QueryTest::testNormalSyntaxDateDefinition() | ||||
301 | { | ||||
302 | TEST_CHUNK(QStringLiteral("Testing the Date definition")) | ||||
303 | { | ||||
304 | auto query = Date::today(); | ||||
305 | QCOMPARE(query.value, QDate::currentDate()); | ||||
306 | } | ||||
307 | { | ||||
308 | auto query = Date::yesterday(); | ||||
309 | QDate date = QDate::currentDate(); | ||||
310 | QCOMPARE(query.value, date.addDays(-1)); | ||||
311 | } | ||||
312 | { | ||||
313 | auto query = Date(QDate::fromString(QStringLiteral("2019-07-25"))); | ||||
314 | QCOMPARE(query.value, QDate::fromString(QStringLiteral("2019-07-25"))); | ||||
315 | } | ||||
316 | } | ||||
317 | | ||||
300 | void QueryTest::initTestCase() | 318 | void QueryTest::initTestCase() | ||
301 | { | 319 | { | ||
302 | // CHECK_CONDITION(isActivityManagerRunning, FailIfTrue); | 320 | // CHECK_CONDITION(isActivityManagerRunning, FailIfTrue); | ||
303 | } | 321 | } | ||
304 | 322 | | |||
305 | void QueryTest::cleanupTestCase() | 323 | void QueryTest::cleanupTestCase() | ||
306 | { | 324 | { | ||
307 | emit testFinished(); | 325 | emit testFinished(); | ||
308 | } | 326 | } | ||
309 | 327 | |