summaryrefslogtreecommitdiffstats
path: root/tests/querytest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r--tests/querytest.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp
index 41ce40c..7685086 100644
--- a/tests/querytest.cpp
+++ b/tests/querytest.cpp
@@ -1823,44 +1823,6 @@ private slots:
1823 1823
1824 } 1824 }
1825 1825
1826 void testOverlapLive()
1827 {
1828 eventsWithDates();
1829
1830 {
1831 Sink::Query query;
1832 query.resourceFilter("sink.dummy.instance1");
1833 query.setFlags(Query::LiveQuery);
1834 query.filter<Event::StartTime, Event::EndTime>(QueryBase::Comparator(
1835 QVariantList{ QDateTime::fromString("2018-05-22T12:00:00Z", Qt::ISODate),
1836 QDateTime::fromString("2018-05-30T13:00:00Z", Qt::ISODate) },
1837 QueryBase::Comparator::Overlap));
1838 auto model = Sink::Store::loadModel<Event>(query);
1839 QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool());
1840 QCOMPARE(model->rowCount(), 5);
1841
1842 Event event = Event::createEntity<Event>("sink.dummy.instance1");
1843 event.setExtractedStartTime(QDateTime::fromString("2018-05-23T12:00:00Z", Qt::ISODate));
1844 event.setExtractedEndTime(QDateTime::fromString("2018-05-23T13:00:00Z", Qt::ISODate));
1845 VERIFYEXEC(Sink::Store::create<Event>(event));
1846
1847 Event event2 = Event::createEntity<Event>("sink.dummy.instance1");
1848 event2.setExtractedStartTime(QDateTime::fromString("2018-05-33T12:00:00Z", Qt::ISODate));
1849 event2.setExtractedEndTime(QDateTime::fromString("2018-05-33T13:00:00Z", Qt::ISODate));
1850 VERIFYEXEC(Sink::Store::create<Event>(event2));
1851
1852 QTest::qWait(500);
1853 QCOMPARE(model->rowCount(), 6);
1854
1855 VERIFYEXEC(Sink::Store::remove<Event>(event));
1856 VERIFYEXEC(Sink::Store::remove<Event>(event2));
1857
1858 QTest::qWait(500);
1859 QCOMPARE(model->rowCount(), 5);
1860 }
1861
1862 }
1863
1864}; 1826};
1865 1827
1866QTEST_MAIN(QueryTest) 1828QTEST_MAIN(QueryTest)