diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2014-03-31 17:45:37 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-31 17:45:37 +0200 |
commit | bd822bedfea5126b12c32523a68c3a1ac7a8931d (patch) | |
tree | 0fafd5ac037e3b62ad45e8808989ec89155618b4 /tests/auto/corelib | |
parent | 84c10500b1730e8d947732728d190fde612fc840 (diff) | |
parent | 3b5c0bc0780f1749fed7c07bd8b691400a0282b7 (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/corelib')
8 files changed, 29 insertions, 20 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 77ac4bcd86..60d1517ed3 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -181,7 +181,7 @@ private slots: void writeTextFile_data(); void writeTextFile(); /* void largeFileSupport(); */ -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) void largeUncFileSupport(); #endif void flush(); @@ -480,7 +480,7 @@ void tst_QFile::exists() file.remove(); QVERIFY(!file.exists()); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) QFile unc("//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt"); QVERIFY(unc.exists()); #endif @@ -605,7 +605,7 @@ void tst_QFile::size_data() QTest::addColumn<qint64>("size"); QTest::newRow( "exist01" ) << m_testFile << (qint64)245; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) // Only test UNC on Windows./ QTest::newRow("unc") << "//" + QString(QtNetworkSettings::winServerName() + "/testshare/test.pri") << (qint64)34; #endif @@ -1539,7 +1539,7 @@ void tst_QFile::writeTextFile() QCOMPARE(file.readAll(), out); } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) void tst_QFile::largeUncFileSupport() { qint64 size = Q_INT64_C(8589934592); @@ -2245,7 +2245,7 @@ void tst_QFile::writeLargeDataBlock_data() QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd; QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(QT_NO_NETWORK) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && !defined(QT_NO_NETWORK) // Some semi-randomness to avoid collisions. QTest::newRow("unc file") << QString("//" + QtNetworkSettings::winServerName() + "/TESTSHAREWRITABLE/largefile-%1-%2.txt") @@ -2605,7 +2605,7 @@ void tst_QFile::appendAndRead() void tst_QFile::miscWithUncPathAsCurrentDir() { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) QString current = QDir::currentPath(); QVERIFY(QDir::setCurrent("//" + QtNetworkSettings::winServerName() + "/testshare")); QFile file("test.pri"); diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index b31b6631f4..6c147d68c8 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -378,7 +378,7 @@ void tst_QFileInfo::isRoot_data() QTest::newRow("drive 3") << "p:/" << false; #endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true; QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true; QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << false; @@ -418,7 +418,7 @@ void tst_QFileInfo::exists_data() QTest::newRow("simple dir") << m_resourcesDir << true; QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << true; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true; QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true; QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true; diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index 4318396bd4..3064fd1320 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -172,7 +172,7 @@ private slots: QLoggingRule rule(QStringRef(&pattern), true); LoggingRuleState state = Invalid; - if (rule.flags != QLoggingRule::Invalid) { + if (rule.flags != 0) { switch (rule.pass(category, msgType)) { case -1: QFAIL("Shoudn't happen, we set pattern to true"); break; case 0: state = NoMatch; break; @@ -302,6 +302,16 @@ private slots: QVERIFY(!cat.isWarningEnabled()); } + + void QLoggingRegistry_checkErrors() + { + QLoggingSettingsParser parser; + QString warnMsg = QString("Ignoring malformed logging rule: '***=false'"); + QTest::ignoreMessage(QtWarningMsg, warnMsg.toLocal8Bit().constData()); + parser.setContent("[Rules]\n" + "***=false\n"); + QVERIFY(parser.rules().isEmpty()); + } }; QTEST_MAIN(tst_QLoggingRegistry) diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro index b9e17f7418..b7606eb3fc 100644 --- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro +++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro @@ -14,12 +14,5 @@ PRE_TARGETDEPS += $${runtime_resource.target} TESTDATA += \ parentdir.txt \ testqrc/* - -# Special case needed for runtime_resource.rcc installation, -# since it does not exist at qmake runtime. -load(testcase) # to get value of target.path -runtime_resource_install.CONFIG = no_check_exist -runtime_resource_install.files = $$OUT_PWD/$${runtime_resource.target} -runtime_resource_install.path = $${target.path} -INSTALLS += runtime_resource_install +GENERATED_TESTDATA = $${runtime_resource.target} DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 0e3ea86165..959c79ed60 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -278,15 +278,21 @@ void tst_QMetaType::threadSafety() namespace TestSpace { struct Foo { double d; }; - + struct QungTfu {}; } Q_DECLARE_METATYPE(TestSpace::Foo) +#define ADD_TESTSPACE(F) TestSpace::F +Q_DECLARE_METATYPE(ADD_TESTSPACE(QungTfu)) + void tst_QMetaType::namespaces() { TestSpace::Foo nf = { 11.12 }; QVariant v = QVariant::fromValue(nf); QCOMPARE(qvariant_cast<TestSpace::Foo>(v).d, 11.12); + + int qungTfuId = qRegisterMetaType<ADD_TESTSPACE(QungTfu)>(); + QCOMPARE(QMetaType::typeName(qungTfuId), "TestSpace::QungTfu"); } void tst_QMetaType::qMetaTypeId() diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 859cd1b36a..0c91c419cc 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -381,6 +381,7 @@ void tst_QThreadPool::expiryTimeoutRace() // QTBUG-3786 threadPool.start(&task); QThread::msleep(50); // exactly the same as the expiry timeout } + QVERIFY(task.semaphore.tryAcquire(numTasks, 10000)); QCOMPARE(task.runCount.load(), numTasks); QVERIFY(threadPool.waitForDone(2000)); } diff --git a/tests/auto/corelib/tools/qchar/qchar.pro b/tests/auto/corelib/tools/qchar/qchar.pro index 7b36b2e45e..0738abad3a 100644 --- a/tests/auto/corelib/tools/qchar/qchar.pro +++ b/tests/auto/corelib/tools/qchar/qchar.pro @@ -3,5 +3,5 @@ TARGET = tst_qchar QT = core-private testlib SOURCES = tst_qchar.cpp -TESTDATA += NormalizationTest.txt +TESTDATA += data/NormalizationTest.txt DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro b/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro index 1ea23915b7..afd0c1176d 100644 --- a/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro +++ b/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro @@ -3,5 +3,4 @@ TARGET = tst_qmessageauthenticationcode QT = core testlib SOURCES = tst_qmessageauthenticationcode.cpp -TESTDATA += data/* DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 |