summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 6df9ad7cdf..36784435b8 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -5012,6 +5012,12 @@ void tst_QString::operator_eqeq_nullstring()
QVERIFY( QString("") == "" );
QVERIFY( "" == QString("") );
+ QVERIFY(QString() == nullptr);
+ QVERIFY(nullptr == QString());
+
+ QVERIFY(QString("") == nullptr);
+ QVERIFY(nullptr == QString(""));
+
QVERIFY( QString().size() == 0 );
QVERIFY( QString("").size() == 0 );
@@ -5025,6 +5031,8 @@ void tst_QString::operator_smaller()
QString null;
QString empty("");
QString foo("foo");
+ const char *nullC = nullptr;
+ const char *emptyC = "";
QVERIFY( !(null < QString()) );
QVERIFY( !(null > QString()) );
@@ -5035,6 +5043,12 @@ void tst_QString::operator_smaller()
QVERIFY( !(null < empty) );
QVERIFY( !(null > empty) );
+ QVERIFY( !(nullC < empty) );
+ QVERIFY( !(nullC > empty) );
+
+ QVERIFY( !(null < emptyC) );
+ QVERIFY( !(null > emptyC) );
+
QVERIFY( null < foo );
QVERIFY( !(null > foo) );
QVERIFY( foo > null );