1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
From 8d7f5585dd94152495ceadaa7bde347f052a0c0e Mon Sep 17 00:00:00 2001
From: Chris Adams <chris.adams@qinetic.com.au>
Date: Thu, 1 Oct 2020 17:25:04 +1000
Subject: [PATCH 16/32] More QDateTime(QDate) -> QDate::startOfDay() fixes
Change-Id: I39585d6de01e0850f21277e2d952167cc0cc78dc
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
tests/auto/contacts/qcontactdetail/tst_qcontactdetail.cpp | 2 +-
tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp | 4 ++--
.../qorganizeritemdetail/tst_qorganizeritemdetail.cpp | 2 +-
.../organizer/qorganizermanager/tst_qorganizermanager.cpp | 4 ++--
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 c12e068e..7cdb47dd 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 24670a82..e4c2eb84 100644
--- a/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp
+++ b/tests/auto/organizer/qorganizeritem/tst_qorganizeritem.cpp
@@ -1153,8 +1153,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 6eda6fcc..233ef2a0 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 2d8d1b0a..cf40fe37 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++) {
--
2.30.2
|