summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp28
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp11
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp2
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp61
6 files changed, 84 insertions, 26 deletions
diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
index 3b2cd84749..8fc1b07502 100644
--- a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
+++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
@@ -2,3 +2,5 @@
osx-10.9
[pauseAndPropertyAnimations]
*
+[multipleSequentialGroups]
+osx
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index a13ff0358a..d2f345feb5 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -34,6 +34,7 @@
#include <qsysinfo.h>
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
#include <unistd.h>
+#include <sys/time.h>
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <qt_windows.h>
#endif
@@ -59,6 +60,7 @@ private slots:
void noPermissions();
void noPermissionsWindows();
void corruptedLockFile();
+ void corruptedLockFileInTheFuture();
private:
static bool overwritePidInLockFile(const QString &filePath, qint64 pid);
@@ -521,6 +523,32 @@ void tst_QLockFile::corruptedLockFile()
QCOMPARE(int(secondLock.error()), int(QLockFile::NoError));
}
+void tst_QLockFile::corruptedLockFileInTheFuture()
+{
+#if !defined(Q_OS_UNIX)
+ QSKIP("This tests needs utimes");
+#else
+ // This test is the same as the previous one, but the corruption was so there is a corrupted
+ // .rmlock whose timestamp is in the future
+
+ const QString fileName = dir.path() + "/corruptedLockFile.rmlock";
+
+ {
+ QFile file(fileName);
+ QVERIFY(file.open(QFile::WriteOnly));
+ }
+
+ struct timeval times[2];
+ gettimeofday(times, 0);
+ times[1].tv_sec = (times[0].tv_sec += 600);
+ times[1].tv_usec = times[0].tv_usec;
+ utimes(fileName.toLocal8Bit(), times);
+
+ QTest::ignoreMessage(QtInfoMsg, "QLockFile: Lock file '" + fileName.toUtf8() + "' has a modification time in the future");
+ corruptedLockFile();
+#endif
+}
+
bool tst_QLockFile::overwritePidInLockFile(const QString &filePath, qint64 pid)
{
QFile f(filePath);
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index ee18151e4a..ebc240c285 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -3088,7 +3088,11 @@ void tst_QUrl::fromUserInputWithCwd_data()
}
// Existing files
- for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt "}) {
+ for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt "
+#ifndef Q_OS_WIN
+ , "file:colon.txt"
+#endif
+ }) {
const QString filePath = base + '/' + fileName;
QFile file(filePath);
QVERIFY2(file.open(QIODevice::WriteOnly), qPrintable(filePath));
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index f693d14029..143bf2f95d 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1563,7 +1563,6 @@ DECLARE_NONSTREAMABLE(QJsonArray)
DECLARE_NONSTREAMABLE(QJsonDocument)
DECLARE_NONSTREAMABLE(QObject*)
DECLARE_NONSTREAMABLE(QWidget*)
-DECLARE_NONSTREAMABLE(std::nullptr_t)
#define DECLARE_GUI_CLASS_NONSTREAMABLE(MetaTypeName, MetaTypeId, RealType) \
DECLARE_NONSTREAMABLE(RealType)
@@ -1602,7 +1601,10 @@ void tst_QMetaType::saveAndLoadBuiltin()
if (isStreamable) {
QVERIFY(QMetaType::load(stream, type, value)); // Hmmm, shouldn't it return false?
- QCOMPARE(stream.status(), QDataStream::ReadPastEnd);
+
+ // std::nullptr_t is nullary: it doesn't actually read anything
+ if (type != QMetaType::Nullptr)
+ QCOMPARE(stream.status(), QDataStream::ReadPastEnd);
}
stream.device()->seek(0);
@@ -1612,7 +1614,10 @@ void tst_QMetaType::saveAndLoadBuiltin()
if (isStreamable) {
QVERIFY(QMetaType::load(stream, type, value)); // Hmmm, shouldn't it return false?
- QCOMPARE(stream.status(), QDataStream::ReadPastEnd);
+
+ // std::nullptr_t is nullary: it doesn't actually read anything
+ if (type != QMetaType::Nullptr)
+ QCOMPARE(stream.status(), QDataStream::ReadPastEnd);
}
QMetaType::destroy(type, value);
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 02ba987ccd..280e3f77a4 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -861,7 +861,7 @@ void tst_QMimeDatabase::fromThreads()
#if QT_CONFIG(process)
enum {
- UpdateMimeDatabaseTimeout = 120 * 1000 // 2min
+ UpdateMimeDatabaseTimeout = 4 * 60 * 1000 // 4min
};
static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDatabase method?
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index 13898ace7b..e5a6e953d3 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -36,7 +36,7 @@ class tst_QChar : public QObject
{
Q_OBJECT
private slots:
- void operator_eqeq_int();
+ void operator_eqeq_null();
void operators_data();
void operators();
void toUpper();
@@ -72,35 +72,54 @@ private slots:
void unicodeVersion();
};
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-
-void tst_QChar::operator_eqeq_int()
+void tst_QChar::operator_eqeq_null()
{
{
const QChar ch = QLatin1Char(' ');
- QVERIFY(ch != 0);
- QVERIFY(!(ch == 0));
-
- QVERIFY(ch == 0x20);
- QVERIFY(!(ch != 0x20));
- QVERIFY(0x20 == ch);
- QVERIFY(!(0x20 != ch));
+#define CHECK(NUL) \
+ do { \
+ QVERIFY(!(ch == NUL)); \
+ QVERIFY( ch != NUL ); \
+ QVERIFY(!(ch < NUL)); \
+ QVERIFY( ch > NUL ); \
+ QVERIFY(!(ch <= NUL)); \
+ QVERIFY( ch >= NUL ); \
+ QVERIFY(!(NUL == ch )); \
+ QVERIFY( NUL != ch ); \
+ QVERIFY( NUL < ch ); \
+ QVERIFY(!(NUL > ch )); \
+ QVERIFY( NUL <= ch ); \
+ QVERIFY(!(NUL >= ch )); \
+ } while (0)
+
+ CHECK(0);
+ CHECK('\0');
+#undef CHECK
}
{
const QChar ch = QLatin1Char('\0');
- QVERIFY(ch == 0);
- QVERIFY(!(ch != 0));
-
- QVERIFY(ch != 0x20);
- QVERIFY(!(ch == 0x20));
- QVERIFY(0x20 != ch);
- QVERIFY(!(0x20 == ch));
+#define CHECK(NUL) \
+ do { \
+ QVERIFY( ch == NUL ); \
+ QVERIFY(!(ch != NUL)); \
+ QVERIFY(!(ch < NUL)); \
+ QVERIFY(!(ch > NUL)); \
+ QVERIFY( ch <= NUL ); \
+ QVERIFY( ch >= NUL ); \
+ QVERIFY( NUL == ch ); \
+ QVERIFY(!(NUL != ch )); \
+ QVERIFY(!(NUL < ch )); \
+ QVERIFY(!(NUL > ch )); \
+ QVERIFY( NUL <= ch ); \
+ QVERIFY( NUL >= ch ); \
+ } while (0)
+
+ CHECK(0);
+ CHECK('\0');
+#undef CHECK
}
}
-QT_WARNING_POP
-
void tst_QChar::operators_data()
{
QTest::addColumn<QChar>("lhs");