summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Adams <chris.adams@qinetic.com.au>2020-10-01 17:25:04 +1000
committerChris Adams <chris.adams@qinetic.com.au>2020-11-02 13:18:59 +1000
commit2aefdd8bd28a4decf9ef8381f5b255f39f1ee90c (patch)
tree923ce86cd2d4823f9306cea11594c2af95db5fa4
parent914e2658c90450deea68ddd3fcd98a411a6f5ee8 (diff)
More QDateTime(QDate) -> QDate::startOfDay() fixes
Change-Id: I39585d6de01e0850f21277e2d952167cc0cc78dc Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
-rw-r--r--tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp2
-rw-r--r--tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp4
-rw-r--r--tests/auto/organizer/qorganizeritemdetail/tst_qorganizeritemdetail.cpp2
-rw-r--r--tests/auto/organizer/qorganizermanager/tst_qorganizermanager.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp b/tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp
index 369fee03b..e93a2ce85 100644
--- a/tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp
+++ b/tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp
@@ -307,7 +307,7 @@ void tst_QContactDetail::values()
dt.setTime(t);
QDate d = dt.date();
- QDateTime ddt(d); // DateTime version of a Date (QTime())
+ QDateTime ddt = d.startOfDay(); // DateTime version of a Date (QTime())
QVERIFY(p.setValue(QContactAddress::FieldStreet, "This is a string"));
QVERIFY(p.setValue(QContactAddress::FieldLocality, d));
diff --git a/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp b/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp
index eacdc8758..521fb9f90 100644
--- a/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp
+++ b/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp
@@ -1147,8 +1147,8 @@ void tst_QOrganizerItem::todoOccurrence()
testTodoOccurrence.setStatus(QOrganizerTodoProgress::StatusComplete);
QCOMPARE(testTodoOccurrence.progressPercentage(), 50); // XXX TODO: should this update automatically?
- testTodoOccurrence.setStartDateTime(QDate::currentDate()te::currentDate().addDays(1).startOfDay());
- QCOMPARE(testTodoOccurrence.startDateTime(), QDate::currentDate().startOfDay());
+ testTodoOccurrence.setStartDateTime(QDate::currentDate().addDays(1).startOfDay());
+ QCOMPARE(testTodoOccurrence.startDateTime(), QDate::currentDate().addDays(1).startOfDay());
testTodoOccurrence.setDueDateTime(QDate::currentDate().startOfDay());
QCOMPARE(testTodoOccurrence.dueDateTime(), QDate::currentDate().startOfDay());
testTodoOccurrence.setFinishedDateTime(QDate::currentDate().addDays(1).startOfDay());
diff --git a/tests/auto/organizer/qorganizeritemdetail/tst_qorganizeritemdetail.cpp b/tests/auto/organizer/qorganizeritemdetail/tst_qorganizeritemdetail.cpp
index 3a050b34f..93a237ab0 100644
--- a/tests/auto/organizer/qorganizeritemdetail/tst_qorganizeritemdetail.cpp
+++ b/tests/auto/organizer/qorganizeritemdetail/tst_qorganizeritemdetail.cpp
@@ -321,7 +321,7 @@ void tst_QOrganizerItemDetail::values()
dt.setTime(t);
QDate d = dt.date();
- QDateTime ddt(d); // DateTime version of a Date (QTime())
+ QDateTime ddt = d.startOfDay(); // DateTime version of a Date (QTime())
p.setValue(101, "This is a string");
p.setValue(102, d);
diff --git a/tests/auto/organizer/qorganizermanager/tst_qorganizermanager.cpp b/tests/auto/organizer/qorganizermanager/tst_qorganizermanager.cpp
index 2d8d1b0a1..cf40fe373 100644
--- a/tests/auto/organizer/qorganizermanager/tst_qorganizermanager.cpp
+++ b/tests/auto/organizer/qorganizermanager/tst_qorganizermanager.cpp
@@ -2267,8 +2267,8 @@ void tst_QOrganizerManager::recurrenceWithGenerator()
if (cm->saveItem(&event)) {
QList<QOrganizerItem> items = cm->itemOccurrences(event,
- QDateTime(startDate, QTime(0, 0, 0)),
- QDateTime(endDate, QTime(23, 59, 59, 999)));
+ startDate.startOfDay(),
+ endDate.endOfDay());
QList<QDate> actualDates;
for (int i = 0; i < items.size(); i++) {