File: 1001_fix-qtdatetime-null-comparison.patch

package info (click to toggle)
qtpim-opensource-src 5.0~git20201102.f9a8f0fc%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 18,236 kB
  • sloc: cpp: 82,965; xml: 91; makefile: 81; javascript: 67
file content (21 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Fix unit test tst_QContactManager::compareVariant_data
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Comment:
 This partially reverts upstream commit
 55287ea79625092ca7638fdb028a9c1f03ffd7ca.
 .
 This patch was not necessary with Qt 5.12, but is so with Qt 5.14.

--- a/tests/auto/contacts/qcontactmanager/tst_qcontactmanager.cpp
+++ b/tests/auto/contacts/qcontactmanager/tst_qcontactmanager.cpp
@@ -3512,9 +3512,7 @@
     QDateTime dt4(d5, t1);
     QDateTime dt5(d6, t4); // end of the universe
 
-    // Note: this test used to verify that null QDateTime compared less than a non-null date prior to 1AD
-    // The current Qt behavior is to compare null as the UNIX epoch, so we will follow that
-    QTest::newRow("datetimes dt0 > dt1") << QVariant(dt0) << QVariant(dt1) << Qt::CaseInsensitive << 1;
+    QTest::newRow("datetimes dt0 < dt1") << QVariant(dt0) << QVariant(dt1) << Qt::CaseInsensitive << -1;
     QTest::newRow("datetimes dt1 < dt2") << QVariant(dt1) << QVariant(dt2) << Qt::CaseInsensitive << -1;
     QTest::newRow("datetimes dt2 < dt3") << QVariant(dt2) << QVariant(dt3) << Qt::CaseInsensitive << -1;
     QTest::newRow("datetimes dt3 < dt4") << QVariant(dt3) << QVariant(dt4) << Qt::CaseInsensitive << -1;