summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp6
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp21
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp8
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp2
-rw-r--r--tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp6
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp14
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp10
-rw-r--r--tests/auto/corelib/tools/qstringref/tst_qstringref.cpp8
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp3
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp2
10 files changed, 33 insertions, 47 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 93c10d78db..338adaabf7 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -756,13 +756,7 @@ void tst_QByteArray::qvsnprintf()
QCOMPARE(static_cast<const char *>(buf), "bub****************");
# endif
#else
-#ifdef Q_OS_IRIX
- // Irix reports back the amount of characters written without the \0
- QCOMPARE(::qsnprintf(buf, 3, "%s", "bubu"), 2);
-#else
- // Every other system in this world reports the amount of data that could have been written
QCOMPARE(::qsnprintf(buf, 3, "%s", "bubu"), 4);
-#endif
QCOMPARE(static_cast<const char*>(buf), "bu");
#endif
QCOMPARE(buf[4], char(42));
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index c0ed88e154..7e1e2f1345 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -1263,9 +1263,6 @@ void tst_QDateTime::addSecs()
QFETCH(QDateTime, dt);
QFETCH(int, nsecs);
QFETCH(QDateTime, result);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
-#endif
QDateTime test = dt.addSecs(nsecs);
QCOMPARE(test, result);
QCOMPARE(test.timeSpec(), dt.timeSpec());
@@ -1285,9 +1282,6 @@ void tst_QDateTime::addMSecs()
QFETCH(int, nsecs);
QFETCH(QDateTime, result);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
-#endif
QDateTime test = dt.addMSecs(qint64(nsecs) * 1000);
QCOMPARE(test, result);
QCOMPARE(test.timeSpec(), dt.timeSpec());
@@ -1373,9 +1367,6 @@ void tst_QDateTime::toTimeSpec()
QCOMPARE(localToLocal.time(), fromLocal.time());
QCOMPARE(localToLocal.timeSpec(), Qt::LocalTime);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(utcToLocal, fromLocal);
QCOMPARE(utcToLocal.date(), fromLocal.date());
QCOMPARE(utcToLocal.time(), fromLocal.time());
@@ -1427,9 +1418,6 @@ void tst_QDateTime::toLocalTime()
QFETCH(QDateTime, fromLocal);
QCOMPARE(fromLocal.toLocalTime(), fromLocal);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(fromUtc.toLocalTime(), fromLocal);
QCOMPARE(fromUtc.toLocalTime(), fromLocal.toLocalTime());
} else {
@@ -1449,9 +1437,6 @@ void tst_QDateTime::toUTC()
QFETCH(QDateTime, fromLocal);
QCOMPARE(fromUtc.toUTC(), fromUtc);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(fromLocal.toUTC(), fromUtc);
QCOMPARE(fromUtc.toUTC(), fromLocal.toUTC());
} else {
@@ -1512,9 +1497,6 @@ void tst_QDateTime::secsTo()
QFETCH(QDateTime, result);
if (dt.isValid()) {
- #ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
- #endif
QCOMPARE(dt.secsTo(result), (qint64)nsecs);
QCOMPARE(result.secsTo(dt), (qint64)-nsecs);
QVERIFY((dt == result) == (0 == nsecs));
@@ -1541,9 +1523,6 @@ void tst_QDateTime::msecsTo()
QFETCH(QDateTime, result);
if (dt.isValid()) {
- #ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
- #endif
QCOMPARE(dt.msecsTo(result), qint64(nsecs) * 1000);
QCOMPARE(result.msecsTo(dt), -qint64(nsecs) * 1000);
QVERIFY((dt == result) == (0 == (qint64(nsecs) * 1000)));
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
index c8373b6ae9..dcfb0aa042 100644
--- a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
+++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
@@ -86,7 +86,7 @@ void tst_QLatin1String::nullString()
// default ctor
{
QLatin1String l1;
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
@@ -95,9 +95,9 @@ void tst_QLatin1String::nullString()
// from nullptr
{
- const char *null = Q_NULLPTR;
+ const char *null = nullptr;
QLatin1String l1(null);
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
@@ -111,7 +111,7 @@ void tst_QLatin1String::nullString()
QLatin1String l1(null);
QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings...", Continue);
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index 145ba7ff72..deee7171b1 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -68,7 +68,7 @@ void tst_QRingBuffer::constructing()
QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
QVERIFY(ringBuffer.isEmpty());
QCOMPARE(ringBuffer.nextDataBlockSize(), Q_INT64_C(0));
- QVERIFY(ringBuffer.readPointer() == Q_NULLPTR);
+ QVERIFY(ringBuffer.readPointer() == nullptr);
QCOMPARE(ringBuffer.skip(5), Q_INT64_C(0));
QCOMPARE(ringBuffer.read(), QByteArray());
QCOMPARE(ringBuffer.getChar(), -1);
diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
index a4b06d1b3b..b943b04e23 100644
--- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
+++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
@@ -68,6 +68,7 @@ void tst_QScopedPointer::defaultConstructor()
/* Check that the members, one, is correctly initialized. */
QScopedPointer<int> p;
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
void tst_QScopedPointer::dataOnDefaultConstructed()
@@ -75,6 +76,7 @@ void tst_QScopedPointer::dataOnDefaultConstructed()
QScopedPointer<int> p;
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
class MyClass
@@ -113,6 +115,7 @@ void tst_QScopedPointer::reset()
QScopedPointer<int> p;
p.reset();
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
/* Call reset() on an active value. */
@@ -120,6 +123,7 @@ void tst_QScopedPointer::reset()
QScopedPointer<int> p(new int(3));
p.reset();
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
/* Call reset() with a value, on an active value. */
@@ -129,6 +133,7 @@ void tst_QScopedPointer::reset()
int *const value = new int(9);
p.reset(value);
QCOMPARE(*p.data(), 9);
+ QCOMPARE(*p.get(), 9);
}
/* Call reset() with a value, on default constructed value. */
@@ -138,6 +143,7 @@ void tst_QScopedPointer::reset()
int *const value = new int(9);
p.reset(value);
QCOMPARE(*p.data(), 9);
+ QCOMPARE(*p.get(), 9);
}
}
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index e1dcdb8407..203d9d8683 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -272,6 +272,7 @@ void tst_QSharedPointer::basics()
QCOMPARE(!ptr, isNull);
QCOMPARE(ptr.data(), aData);
+ QCOMPARE(ptr.get(), aData);
QCOMPARE(ptr.operator->(), aData);
if (!isNull) {
Data &dataReference = *ptr;
@@ -316,6 +317,7 @@ void tst_QSharedPointer::basics()
QCOMPARE(copy.isNull(), isNull);
QCOMPARE(copy.data(), aData);
+ QCOMPARE(copy.get(), aData);
QVERIFY(copy == aData);
}
QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
@@ -349,6 +351,7 @@ void tst_QSharedPointer::basics()
QVERIFY(strong == weak);
QVERIFY(strong == ptr);
QCOMPARE(strong.data(), aData);
+ QCOMPARE(strong.get(), aData);
}
QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
@@ -362,11 +365,14 @@ void tst_QSharedPointer::operators()
QSharedPointer<char> p2(new char);
qptrdiff diff = p2.data() - p1.data();
QVERIFY(p1.data() != p2.data());
+ QVERIFY(p1.get() != p2.get());
QVERIFY(diff != 0);
// operator-
QCOMPARE(p2 - p1.data(), diff);
+ QCOMPARE(p2 - p1.get(), diff);
QCOMPARE(p2.data() - p1, diff);
+ QCOMPARE(p2.get() - p1, diff);
QCOMPARE(p2 - p1, diff);
QCOMPARE(p1 - p2, -diff);
QCOMPARE(p1 - p1, qptrdiff(0));
@@ -374,7 +380,9 @@ void tst_QSharedPointer::operators()
// operator<
QVERIFY(p1 < p2.data());
+ QVERIFY(p1 < p2.get());
QVERIFY(p1.data() < p2);
+ QVERIFY(p1.get() < p2);
QVERIFY(p1 < p2);
QVERIFY(!(p2 < p1));
QVERIFY(!(p2 < p2));
@@ -382,7 +390,9 @@ void tst_QSharedPointer::operators()
// qHash
QCOMPARE(qHash(p1), qHash(p1.data()));
+ QCOMPARE(qHash(p1), qHash(p1.get()));
QCOMPARE(qHash(p2), qHash(p2.data()));
+ QCOMPARE(qHash(p2), qHash(p2.get()));
}
void tst_QSharedPointer::nullptrOps()
@@ -396,11 +406,13 @@ void tst_QSharedPointer::nullptrOps()
QVERIFY(nullptr == p1);
QVERIFY(!p1);
QVERIFY(!p1.data());
+ QVERIFY(!p1.get());
QVERIFY(p2 == null);
QVERIFY(p2 == nullptr);
QVERIFY(nullptr == p2);
QVERIFY(!p2);
QVERIFY(!p2.data());
+ QVERIFY(!p2.get());
QVERIFY(p1 == p2);
QSharedPointer<char> p3 = p1;
@@ -409,6 +421,7 @@ void tst_QSharedPointer::nullptrOps()
QVERIFY(p3 == nullptr);
QVERIFY(nullptr == p3);
QVERIFY(!p3.data());
+ QVERIFY(!p3.get());
p3 = nullptr;
@@ -421,6 +434,7 @@ void tst_QSharedPointer::nullptrOps()
QSharedPointer<char> p4(new char);
QVERIFY(p4);
QVERIFY(p4.data());
+ QVERIFY(p4.get());
QVERIFY(p4 != nullptr);
QVERIFY(nullptr != p4);
QVERIFY(p4 != p1);
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 70ccc72630..f6840e60a8 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -249,7 +249,7 @@ class CharStarContainer
{
const char *str;
public:
- explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = Q_NULLPTR) : str(s) {}
+ explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = nullptr) : str(s) {}
Q_DECL_CONSTEXPR operator const char *() const { return str; }
};
@@ -1483,7 +1483,7 @@ void tst_QString::indexOf()
QRegularExpression re(QRegularExpression::escape(needle), options);
QCOMPARE( haystack.indexOf(re, startpos), resultpos );
- QCOMPARE(haystack.indexOf(re, startpos, Q_NULLPTR), resultpos);
+ QCOMPARE(haystack.indexOf(re, startpos, nullptr), resultpos);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
@@ -1608,7 +1608,7 @@ void tst_QString::indexOfInvalidRegex()
QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object");
QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\")), -1);
QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object");
- QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1);
+ QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
@@ -1706,7 +1706,7 @@ void tst_QString::lastIndexOf()
QRegularExpression re(QRegularExpression::escape(needle), options);
QCOMPARE(haystack.lastIndexOf(re, from), expected);
- QCOMPARE(haystack.lastIndexOf(re, from, Q_NULLPTR), expected);
+ QCOMPARE(haystack.lastIndexOf(re, from, nullptr), expected);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
QCOMPARE(haystack.lastIndexOf(re, from, &match), expected);
@@ -1743,7 +1743,7 @@ void tst_QString::lastIndexOfInvalidRegex()
QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object");
QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1);
QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object");
- QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1);
+ QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
index 473f563f9b..581e9152e6 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
@@ -121,14 +121,6 @@ typedef QList<int> IntList;
#if defined(Q_OS_SOLARIS)
# include <ieeefp.h>
#endif
-#if defined(Q_OS_OSF) && (defined(__DECC) || defined(__DECCXX))
-# define INFINITY DBL_INFINITY
-# define NAN DBL_QNAN
-#endif
-#if defined(Q_OS_IRIX) && defined(Q_CC_GNU)
-# include <ieeefp.h>
-# define isnan(d) isnand(d)
-#endif
enum {
LittleEndian,
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index 9f22c3d51d..6b103d355a 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -1177,7 +1177,8 @@ void tst_QTimeZone::testEpochTranPrivate(const QTimeZonePrivate &tzp)
// Pre-epoch time-zones might not be supported at all:
tran = tzp.nextTransition(QDateTime(QDate(1601, 1, 1), QTime(0, 0),
Qt::UTC).toMSecsSinceEpoch());
- if (tran.atMSecsSinceEpoch != QTimeZonePrivate::invalidSeconds()
+ if (tran.atMSecsSinceEpoch != QTimeZonePrivate::invalidMSecs()
+ // Toronto *did* have a transition before 1970 (DST since 1918):
&& tran.atMSecsSinceEpoch < 0) {
// ... but, if they are, we should be able to search back to them:
tran = tzp.previousTransition(0); // i.e. last before epoch
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 374fec221e..56daea31fe 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -2803,7 +2803,7 @@ void tst_QVector::detachThreadSafety() const
static const uint threadsCount = 5;
struct : QThread {
- void run() Q_DECL_OVERRIDE
+ void run() override
{
QVector<T> copy(*detachThreadSafetyData<T>()->load());
QVERIFY(!copy.isDetached());