diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2012-09-04 12:40:16 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-14 06:24:38 +0200 |
commit | 34cd8fd566cd61385db12112d9515b0d5388dad3 (patch) | |
tree | 0f311e165c03c040f2c32261f96d80965443d4c6 /tests/auto/corelib | |
parent | 6fd1895b918c45d8404ff38319f508f0357cba27 (diff) |
tests: Don't omit the body of a test function with QT_BUILD_INTERNAL
Changing it outside of the test function definition to avoid running
empty/inapplicable test functions.
Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
Diffstat (limited to 'tests/auto/corelib')
6 files changed, 76 insertions, 52 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 5474b9aa3b..0bc2a3fc86 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -58,8 +58,10 @@ private slots: void installMsgHandler(); void installBothHandler(); +#ifdef QT_BUILD_INTERNAL void cleanupFuncinfo_data(); void cleanupFuncinfo(); +#endif void qMessagePattern(); @@ -326,11 +328,9 @@ public: }; +#ifdef QT_BUILD_INTERNAL void tst_qmessagehandler::cleanupFuncinfo_data() { -#ifndef QT_BUILD_INTERNAL - QSKIP("Requires -developer-build"); -#endif QTest::addColumn<QString>("funcinfo"); QTest::addColumn<QString>("expected"); @@ -608,7 +608,9 @@ void tst_qmessagehandler::cleanupFuncinfo_data() QTest::newRow("gcc_39") << "int TestClass1::operator>(int)" - << "TestClass1::operator>";} + << "TestClass1::operator>"; +} +#endif #ifdef QT_BUILD_INTERNAL QT_BEGIN_NAMESPACE @@ -616,16 +618,16 @@ extern QByteArray qCleanupFuncinfo(QByteArray); QT_END_NAMESPACE #endif +#ifdef QT_BUILD_INTERNAL void tst_qmessagehandler::cleanupFuncinfo() { -#ifdef QT_BUILD_INTERNAL QFETCH(QString, funcinfo); // qDebug() << funcinfo.toLatin1(); QByteArray result = qCleanupFuncinfo(funcinfo.toLatin1()); QTEST(QString::fromLatin1(result), "expected"); -#endif } +#endif void tst_qmessagehandler::qMessagePattern() { diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 3dce930f93..7f8385f76a 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -108,7 +108,9 @@ private slots: void iterateResource_data(); void iterateResource(); void stopLinkLoop(); +#ifdef QT_BUILD_INTERNAL void engineWithNoIterator(); +#endif void absoluteFilePathsFromRelativeIteratorPath(); void recurseWithFilters() const; void longPath(); @@ -478,17 +480,15 @@ public: }; #endif +#ifdef QT_BUILD_INTERNAL void tst_QDirIterator::engineWithNoIterator() { -#ifdef QT_BUILD_INTERNAL EngineWithNoIteratorHandler handler; QDir("entrylist").entryList(); QVERIFY(true); // test that the above line doesn't crash -#else - QSKIP("This test requires -developer-build."); -#endif } +#endif void tst_QDirIterator::absoluteFilePathsFromRelativeIteratorPath() { diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index b2cb00b423..984ef474fd 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -178,7 +178,9 @@ private slots: void longFileName_data(); void longFileName(); void fileEngineHandler(); +#ifdef QT_BUILD_INTERNAL void useQFileInAFileHandler(); +#endif void getCharFF(); void remove_and_exists(); void removeOpenFile(); @@ -2091,17 +2093,15 @@ public: }; #endif +#ifdef QT_BUILD_INTERNAL void tst_QFile::useQFileInAFileHandler() { -#ifdef QT_BUILD_INTERNAL // This test should not dead-lock MyRecursiveHandler handler; QFile file(":!tst_qfile.cpp"); QVERIFY(file.exists()); -#else - QSKIP("This test requires -developer-build."); -#endif } +#endif void tst_QFile::getCharFF() { diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 65ab63510c..974fc4a6c9 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -94,33 +94,21 @@ private slots: void setFallbacksEnabled_data(); void fromFile_data(); void fromFile(); - void setIniCodec(); void testArrays_data(); void testArrays(); - void testEscapes(); void testCaseSensitivity_data(); void testCaseSensitivity(); void testErrorHandling_data(); void testErrorHandling(); - void testIniParsing_data(); - void testIniParsing(); void testChildKeysAndGroups_data(); void testChildKeysAndGroups(); void testUpdateRequestEvent(); void testThreadSafety(); - void testNormalizedKey_data(); - void testNormalizedKey(); void testEmptyData(); void testResourceFiles(); void fileName(); void isWritable_data(); void isWritable(); - void childGroups_data(); - void childGroups(); - void childKeys_data(); - void childKeys(); - void allKeys_data(); - void allKeys(); void registerFormat(); void setPath(); void setDefaultFormat(); @@ -132,8 +120,22 @@ private slots: void consistentRegistryStorage(); #endif +#ifdef QT_BUILD_INTERNAL + void allKeys_data(); + void allKeys(); + void childGroups_data(); + void childGroups(); + void childKeys_data(); + void childKeys(); + void setIniCodec(); + void testIniParsing_data(); + void testIniParsing(); + void testEscapes(); + void testNormalizedKey_data(); + void testNormalizedKey(); void testVariantTypes_data(); void testVariantTypes(); +#endif void rainersSyncBugOnMac_data(); void rainersSyncBugOnMac(); void recursionBug(); @@ -664,7 +666,6 @@ void tst_QSettings::testErrorHandling_data() void tst_QSettings::testErrorHandling() { -#ifdef QT_BUILD_INTERNAL #ifdef Q_OS_WIN QSKIP("Windows doesn't support most file modes, including read-only directories, so this test is moot."); #elif defined(Q_OS_UNIX) @@ -730,12 +731,12 @@ void tst_QSettings::testErrorHandling() QCOMPARE((int)settings.status(), statusAfterSetAndSync); } #endif // !Q_OS_WIN -#endif } Q_DECLARE_METATYPE(QVariant) Q_DECLARE_METATYPE(QSettings::Status) +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testIniParsing_data() { QTest::addColumn<QByteArray>("inicontent"); @@ -773,10 +774,11 @@ void tst_QSettings::testIniParsing_data() QTest::newRow("nonterm20") << QByteArray("v=x ") << "v" << QVariant("x") << QSettings::NoError; QTest::newRow("nonterm21") << QByteArray("v=x ;") << "v" << QVariant("x") << QSettings::NoError; } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testIniParsing() { -#ifdef QT_BUILD_INTERNAL qRegisterMetaType<QVariant>("QVariant"); qRegisterMetaType<QSettings::Status>("QSettings::Status"); @@ -810,8 +812,8 @@ void tst_QSettings::testIniParsing() } QCOMPARE(settings.status(), status); -#endif } +#endif /* Tests beginGroup(), endGroup(), and group(). @@ -1012,14 +1014,16 @@ void tst_QSettings::setValue() QCOMPARE(settings.value("key 4").toMap(), map); } +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testVariantTypes_data() { populateWithFormats(); } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testVariantTypes() { -#ifdef QT_BUILD_INTERNAL #define testVal(key, val, tp, rtype) \ { \ QSettings settings1(format, QSettings::UserScope, "software.org", "KillerAPP"); \ @@ -1103,8 +1107,8 @@ void tst_QSettings::testVariantTypes() } #undef testVal -#endif } +#endif void tst_QSettings::remove() { @@ -1733,6 +1737,7 @@ void tst_QSettings::testThreadSafety() QCOMPARE(numThreadSafetyFailures, 0); } +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testNormalizedKey_data() { QTest::addColumn<QString>("inKey"); @@ -1762,10 +1767,11 @@ void tst_QSettings::testNormalizedKey_data() QTest::newRow("ab7") << "/aaa///bbb/" << "aaa/bbb"; QTest::newRow("ab8") << "////aaa///bbb////" << "aaa/bbb"; } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testNormalizedKey() { -#ifdef QT_BUILD_INTERNAL QFETCH(QString, inKey); QFETCH(QString, outKey); @@ -1786,8 +1792,8 @@ void tst_QSettings::testNormalizedKey() QVERIFY(result.isDetached()); } } -#endif } +#endif void tst_QSettings::testEmptyData() { @@ -1941,9 +1947,9 @@ void tst_QSettings::fromFile() } } +#ifdef QT_BUILD_INTERNAL void tst_QSettings::setIniCodec() { -#ifdef QT_BUILD_INTERNAL QByteArray expeContents4, expeContents5; QByteArray actualContents4, actualContents5; @@ -2006,8 +2012,8 @@ void tst_QSettings::setIniCodec() QCOMPARE(settings4.allKeys().first(), settings5.allKeys().first()); QCOMPARE(settings4.value(settings4.allKeys().first()).toString(), settings5.value(settings5.allKeys().first()).toString()); -#endif } +#endif static bool containsSubList(QStringList mom, QStringList son) { @@ -2359,9 +2365,9 @@ QString escapeWeirdChars(const QString &s) return result; } +#ifdef QT_BUILD_INTERNAL void tst_QSettings::testEscapes() { -#ifdef QT_BUILD_INTERNAL QSettings settings(QSettings::UserScope, "software.org", "KillerAPP"); #define testEscapedKey(plainKey, escKey) \ @@ -2483,8 +2489,8 @@ void tst_QSettings::testEscapes() testBadEscape("@Rect)", "@Rect)"); testBadEscape("@Rect(1 2 3)", "@Rect(1 2 3)"); testBadEscape("@@Rect(1 2 3)", "@Rect(1 2 3)"); -#endif } +#endif void tst_QSettings::testCaseSensitivity_data() { @@ -2685,14 +2691,16 @@ void tst_QSettings::isWritable() } } +#ifdef QT_BUILD_INTERNAL void tst_QSettings::childGroups_data() { populateWithFormats(); } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::childGroups() { -#ifdef QT_BUILD_INTERNAL QFETCH(QSettings::Format, format); { @@ -2746,17 +2754,19 @@ void tst_QSettings::childGroups() QCOMPARE(settings.childGroups(), QStringList() << "alpha" << "gamma" << "omicron" << "zeta"); } -#endif } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::childKeys_data() { populateWithFormats(); } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::childKeys() { -#ifdef QT_BUILD_INTERNAL QFETCH(QSettings::Format, format); { @@ -2810,17 +2820,19 @@ void tst_QSettings::childKeys() QCOMPARE(settings.childKeys(), QStringList() << "alpha" << "beta" << "gamma"); } -#endif } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::allKeys_data() { populateWithFormats(); } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QSettings::allKeys() { -#ifdef QT_BUILD_INTERNAL QFETCH(QSettings::Format, format); QStringList allKeys; @@ -2869,8 +2881,8 @@ void tst_QSettings::allKeys() QCOMPARE(settings.allKeys(), allKeys); } -#endif } +#endif void tst_QSettings::registerFormat() { diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index 5e7fc2c7b6..6ebfa9a11f 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -75,12 +75,14 @@ class tst_QUrlInternal : public QObject private Q_SLOTS: // IDNA internals +#ifdef QT_BUILD_INTERNAL void idna_testsuite_data(); void idna_testsuite(); void nameprep_testsuite_data(); void nameprep_testsuite(); void nameprep_highcodes_data(); void nameprep_highcodes(); +#endif void ace_testsuite_data(); void ace_testsuite(); void std3violations_data(); @@ -100,6 +102,7 @@ private Q_SLOTS: }; #include "tst_qurlinternal.moc" +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::idna_testsuite_data() { QTest::addColumn<int>("numchars"); @@ -244,10 +247,11 @@ void tst_QUrlInternal::idna_testsuite_data() << QByteArray(IDNA_ACE_PREFIX "b1abfaaepdrnnbgefbadotcwatmq2g4l") << 0 << 0 << IDNA_SUCCESS << IDNA_SUCCESS; } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::idna_testsuite() { -#ifdef QT_BUILD_INTERNAL QFETCH(int, numchars); QFETCH(ushortarray, unicode); QFETCH(QByteArray, punycode); @@ -256,9 +260,10 @@ void tst_QUrlInternal::idna_testsuite() qt_punycodeEncoder((QChar*)unicode.points, numchars, &result); QCOMPARE(result.toLatin1(), punycode); QCOMPARE(qt_punycodeDecoder(result), QString::fromUtf16(unicode.points, numchars)); -#endif } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::nameprep_testsuite_data() { QTest::addColumn<QString>("in"); @@ -498,10 +503,11 @@ void tst_QUrlInternal::nameprep_testsuite_data() "\xe3\x83\xbc\xe3\x83\x88") << QString() << 0 << 0; } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::nameprep_testsuite() { -#ifdef QT_BUILD_INTERNAL QFETCH(QString, in); QFETCH(QString, out); QFETCH(QString, profile); @@ -514,9 +520,10 @@ void tst_QUrlInternal::nameprep_testsuite() "Investigate further", Continue); qt_nameprep(&in, 0); QCOMPARE(in, out); -#endif } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::nameprep_highcodes_data() { QTest::addColumn<QString>("in"); @@ -550,18 +557,19 @@ void tst_QUrlInternal::nameprep_highcodes_data() << QString() << 0 << 0; } } +#endif +#ifdef QT_BUILD_INTERNAL void tst_QUrlInternal::nameprep_highcodes() { -#ifdef QT_BUILD_INTERNAL QFETCH(QString, in); QFETCH(QString, out); QFETCH(QString, profile); qt_nameprep(&in, 0); QCOMPARE(in, out); -#endif } +#endif void tst_QUrlInternal::ace_testsuite_data() { diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp index 15f23e05cd..fc44998c63 100644 --- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp @@ -98,7 +98,9 @@ class tst_QStateMachine : public QObject private slots: void rootState(); void machineWithParent(); +#ifdef QT_BUILD_INTERNAL void addAndRemoveState(); +#endif void stateEntryAndExit(); void assignProperty(); void assignPropertyWithAnimation(); @@ -1107,9 +1109,9 @@ void tst_QStateMachine::machineWithParent() QCOMPARE(machine->parentState(), static_cast<QState*>(0)); } +#ifdef QT_BUILD_INTERNAL void tst_QStateMachine::addAndRemoveState() { -#ifdef QT_BUILD_INTERNAL QStateMachine machine; QStatePrivate *root_d = QStatePrivate::get(&machine); QCOMPARE(root_d->childStates().size(), 0); @@ -1170,8 +1172,8 @@ void tst_QStateMachine::addAndRemoveState() delete s2; // ### how to deal with this? // machine.removeState(machine.errorState()); -#endif } +#endif void tst_QStateMachine::stateEntryAndExit() { |