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>
This commit is contained in:
Sergio Ahumada 2012-09-04 12:40:16 +02:00 committed by Qt by Nokia
parent 6fd1895b91
commit 34cd8fd566
16 changed files with 189 additions and 120 deletions

View File

@ -58,8 +58,10 @@ private slots:
void installMsgHandler(); void installMsgHandler();
void installBothHandler(); void installBothHandler();
#ifdef QT_BUILD_INTERNAL
void cleanupFuncinfo_data(); void cleanupFuncinfo_data();
void cleanupFuncinfo(); void cleanupFuncinfo();
#endif
void qMessagePattern(); void qMessagePattern();
@ -326,11 +328,9 @@ public:
}; };
#ifdef QT_BUILD_INTERNAL
void tst_qmessagehandler::cleanupFuncinfo_data() void tst_qmessagehandler::cleanupFuncinfo_data()
{ {
#ifndef QT_BUILD_INTERNAL
QSKIP("Requires -developer-build");
#endif
QTest::addColumn<QString>("funcinfo"); QTest::addColumn<QString>("funcinfo");
QTest::addColumn<QString>("expected"); QTest::addColumn<QString>("expected");
@ -608,7 +608,9 @@ void tst_qmessagehandler::cleanupFuncinfo_data()
QTest::newRow("gcc_39") QTest::newRow("gcc_39")
<< "int TestClass1::operator>(int)" << "int TestClass1::operator>(int)"
<< "TestClass1::operator>";} << "TestClass1::operator>";
}
#endif
#ifdef QT_BUILD_INTERNAL #ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -616,16 +618,16 @@ extern QByteArray qCleanupFuncinfo(QByteArray);
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_qmessagehandler::cleanupFuncinfo() void tst_qmessagehandler::cleanupFuncinfo()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QString, funcinfo); QFETCH(QString, funcinfo);
// qDebug() << funcinfo.toLatin1(); // qDebug() << funcinfo.toLatin1();
QByteArray result = qCleanupFuncinfo(funcinfo.toLatin1()); QByteArray result = qCleanupFuncinfo(funcinfo.toLatin1());
QTEST(QString::fromLatin1(result), "expected"); QTEST(QString::fromLatin1(result), "expected");
#endif
} }
#endif
void tst_qmessagehandler::qMessagePattern() void tst_qmessagehandler::qMessagePattern()
{ {

View File

@ -108,7 +108,9 @@ private slots:
void iterateResource_data(); void iterateResource_data();
void iterateResource(); void iterateResource();
void stopLinkLoop(); void stopLinkLoop();
#ifdef QT_BUILD_INTERNAL
void engineWithNoIterator(); void engineWithNoIterator();
#endif
void absoluteFilePathsFromRelativeIteratorPath(); void absoluteFilePathsFromRelativeIteratorPath();
void recurseWithFilters() const; void recurseWithFilters() const;
void longPath(); void longPath();
@ -478,17 +480,15 @@ public:
}; };
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QDirIterator::engineWithNoIterator() void tst_QDirIterator::engineWithNoIterator()
{ {
#ifdef QT_BUILD_INTERNAL
EngineWithNoIteratorHandler handler; EngineWithNoIteratorHandler handler;
QDir("entrylist").entryList(); QDir("entrylist").entryList();
QVERIFY(true); // test that the above line doesn't crash QVERIFY(true); // test that the above line doesn't crash
#else
QSKIP("This test requires -developer-build.");
#endif
} }
#endif
void tst_QDirIterator::absoluteFilePathsFromRelativeIteratorPath() void tst_QDirIterator::absoluteFilePathsFromRelativeIteratorPath()
{ {

View File

@ -178,7 +178,9 @@ private slots:
void longFileName_data(); void longFileName_data();
void longFileName(); void longFileName();
void fileEngineHandler(); void fileEngineHandler();
#ifdef QT_BUILD_INTERNAL
void useQFileInAFileHandler(); void useQFileInAFileHandler();
#endif
void getCharFF(); void getCharFF();
void remove_and_exists(); void remove_and_exists();
void removeOpenFile(); void removeOpenFile();
@ -2091,17 +2093,15 @@ public:
}; };
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QFile::useQFileInAFileHandler() void tst_QFile::useQFileInAFileHandler()
{ {
#ifdef QT_BUILD_INTERNAL
// This test should not dead-lock // This test should not dead-lock
MyRecursiveHandler handler; MyRecursiveHandler handler;
QFile file(":!tst_qfile.cpp"); QFile file(":!tst_qfile.cpp");
QVERIFY(file.exists()); QVERIFY(file.exists());
#else
QSKIP("This test requires -developer-build.");
#endif
} }
#endif
void tst_QFile::getCharFF() void tst_QFile::getCharFF()
{ {

View File

@ -94,33 +94,21 @@ private slots:
void setFallbacksEnabled_data(); void setFallbacksEnabled_data();
void fromFile_data(); void fromFile_data();
void fromFile(); void fromFile();
void setIniCodec();
void testArrays_data(); void testArrays_data();
void testArrays(); void testArrays();
void testEscapes();
void testCaseSensitivity_data(); void testCaseSensitivity_data();
void testCaseSensitivity(); void testCaseSensitivity();
void testErrorHandling_data(); void testErrorHandling_data();
void testErrorHandling(); void testErrorHandling();
void testIniParsing_data();
void testIniParsing();
void testChildKeysAndGroups_data(); void testChildKeysAndGroups_data();
void testChildKeysAndGroups(); void testChildKeysAndGroups();
void testUpdateRequestEvent(); void testUpdateRequestEvent();
void testThreadSafety(); void testThreadSafety();
void testNormalizedKey_data();
void testNormalizedKey();
void testEmptyData(); void testEmptyData();
void testResourceFiles(); void testResourceFiles();
void fileName(); void fileName();
void isWritable_data(); void isWritable_data();
void isWritable(); void isWritable();
void childGroups_data();
void childGroups();
void childKeys_data();
void childKeys();
void allKeys_data();
void allKeys();
void registerFormat(); void registerFormat();
void setPath(); void setPath();
void setDefaultFormat(); void setDefaultFormat();
@ -132,8 +120,22 @@ private slots:
void consistentRegistryStorage(); void consistentRegistryStorage();
#endif #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_data();
void testVariantTypes(); void testVariantTypes();
#endif
void rainersSyncBugOnMac_data(); void rainersSyncBugOnMac_data();
void rainersSyncBugOnMac(); void rainersSyncBugOnMac();
void recursionBug(); void recursionBug();
@ -664,7 +666,6 @@ void tst_QSettings::testErrorHandling_data()
void tst_QSettings::testErrorHandling() void tst_QSettings::testErrorHandling()
{ {
#ifdef QT_BUILD_INTERNAL
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QSKIP("Windows doesn't support most file modes, including read-only directories, so this test is moot."); QSKIP("Windows doesn't support most file modes, including read-only directories, so this test is moot.");
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
@ -730,12 +731,12 @@ void tst_QSettings::testErrorHandling()
QCOMPARE((int)settings.status(), statusAfterSetAndSync); QCOMPARE((int)settings.status(), statusAfterSetAndSync);
} }
#endif // !Q_OS_WIN #endif // !Q_OS_WIN
#endif
} }
Q_DECLARE_METATYPE(QVariant) Q_DECLARE_METATYPE(QVariant)
Q_DECLARE_METATYPE(QSettings::Status) Q_DECLARE_METATYPE(QSettings::Status)
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testIniParsing_data() void tst_QSettings::testIniParsing_data()
{ {
QTest::addColumn<QByteArray>("inicontent"); 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("nonterm20") << QByteArray("v=x ") << "v" << QVariant("x") << QSettings::NoError;
QTest::newRow("nonterm21") << 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() void tst_QSettings::testIniParsing()
{ {
#ifdef QT_BUILD_INTERNAL
qRegisterMetaType<QVariant>("QVariant"); qRegisterMetaType<QVariant>("QVariant");
qRegisterMetaType<QSettings::Status>("QSettings::Status"); qRegisterMetaType<QSettings::Status>("QSettings::Status");
@ -810,8 +812,8 @@ void tst_QSettings::testIniParsing()
} }
QCOMPARE(settings.status(), status); QCOMPARE(settings.status(), status);
#endif
} }
#endif
/* /*
Tests beginGroup(), endGroup(), and group(). Tests beginGroup(), endGroup(), and group().
@ -1012,14 +1014,16 @@ void tst_QSettings::setValue()
QCOMPARE(settings.value("key 4").toMap(), map); QCOMPARE(settings.value("key 4").toMap(), map);
} }
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testVariantTypes_data() void tst_QSettings::testVariantTypes_data()
{ {
populateWithFormats(); populateWithFormats();
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testVariantTypes() void tst_QSettings::testVariantTypes()
{ {
#ifdef QT_BUILD_INTERNAL
#define testVal(key, val, tp, rtype) \ #define testVal(key, val, tp, rtype) \
{ \ { \
QSettings settings1(format, QSettings::UserScope, "software.org", "KillerAPP"); \ QSettings settings1(format, QSettings::UserScope, "software.org", "KillerAPP"); \
@ -1103,8 +1107,8 @@ void tst_QSettings::testVariantTypes()
} }
#undef testVal #undef testVal
#endif
} }
#endif
void tst_QSettings::remove() void tst_QSettings::remove()
{ {
@ -1733,6 +1737,7 @@ void tst_QSettings::testThreadSafety()
QCOMPARE(numThreadSafetyFailures, 0); QCOMPARE(numThreadSafetyFailures, 0);
} }
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testNormalizedKey_data() void tst_QSettings::testNormalizedKey_data()
{ {
QTest::addColumn<QString>("inKey"); QTest::addColumn<QString>("inKey");
@ -1762,10 +1767,11 @@ void tst_QSettings::testNormalizedKey_data()
QTest::newRow("ab7") << "/aaa///bbb/" << "aaa/bbb"; QTest::newRow("ab7") << "/aaa///bbb/" << "aaa/bbb";
QTest::newRow("ab8") << "////aaa///bbb////" << "aaa/bbb"; QTest::newRow("ab8") << "////aaa///bbb////" << "aaa/bbb";
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testNormalizedKey() void tst_QSettings::testNormalizedKey()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QString, inKey); QFETCH(QString, inKey);
QFETCH(QString, outKey); QFETCH(QString, outKey);
@ -1786,8 +1792,8 @@ void tst_QSettings::testNormalizedKey()
QVERIFY(result.isDetached()); QVERIFY(result.isDetached());
} }
} }
#endif
} }
#endif
void tst_QSettings::testEmptyData() void tst_QSettings::testEmptyData()
{ {
@ -1941,9 +1947,9 @@ void tst_QSettings::fromFile()
} }
} }
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::setIniCodec() void tst_QSettings::setIniCodec()
{ {
#ifdef QT_BUILD_INTERNAL
QByteArray expeContents4, expeContents5; QByteArray expeContents4, expeContents5;
QByteArray actualContents4, actualContents5; QByteArray actualContents4, actualContents5;
@ -2006,8 +2012,8 @@ void tst_QSettings::setIniCodec()
QCOMPARE(settings4.allKeys().first(), settings5.allKeys().first()); QCOMPARE(settings4.allKeys().first(), settings5.allKeys().first());
QCOMPARE(settings4.value(settings4.allKeys().first()).toString(), QCOMPARE(settings4.value(settings4.allKeys().first()).toString(),
settings5.value(settings5.allKeys().first()).toString()); settings5.value(settings5.allKeys().first()).toString());
#endif
} }
#endif
static bool containsSubList(QStringList mom, QStringList son) static bool containsSubList(QStringList mom, QStringList son)
{ {
@ -2359,9 +2365,9 @@ QString escapeWeirdChars(const QString &s)
return result; return result;
} }
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::testEscapes() void tst_QSettings::testEscapes()
{ {
#ifdef QT_BUILD_INTERNAL
QSettings settings(QSettings::UserScope, "software.org", "KillerAPP"); QSettings settings(QSettings::UserScope, "software.org", "KillerAPP");
#define testEscapedKey(plainKey, escKey) \ #define testEscapedKey(plainKey, escKey) \
@ -2483,8 +2489,8 @@ void tst_QSettings::testEscapes()
testBadEscape("@Rect)", "@Rect)"); testBadEscape("@Rect)", "@Rect)");
testBadEscape("@Rect(1 2 3)", "@Rect(1 2 3)"); testBadEscape("@Rect(1 2 3)", "@Rect(1 2 3)");
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() void tst_QSettings::testCaseSensitivity_data()
{ {
@ -2685,14 +2691,16 @@ void tst_QSettings::isWritable()
} }
} }
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::childGroups_data() void tst_QSettings::childGroups_data()
{ {
populateWithFormats(); populateWithFormats();
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::childGroups() void tst_QSettings::childGroups()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QSettings::Format, format); QFETCH(QSettings::Format, format);
{ {
@ -2746,17 +2754,19 @@ void tst_QSettings::childGroups()
QCOMPARE(settings.childGroups(), QStringList() << "alpha" << "gamma" << "omicron" << "zeta"); QCOMPARE(settings.childGroups(), QStringList() << "alpha" << "gamma" << "omicron" << "zeta");
} }
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::childKeys_data() void tst_QSettings::childKeys_data()
{ {
populateWithFormats(); populateWithFormats();
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::childKeys() void tst_QSettings::childKeys()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QSettings::Format, format); QFETCH(QSettings::Format, format);
{ {
@ -2810,17 +2820,19 @@ void tst_QSettings::childKeys()
QCOMPARE(settings.childKeys(), QStringList() << "alpha" << "beta" << "gamma"); QCOMPARE(settings.childKeys(), QStringList() << "alpha" << "beta" << "gamma");
} }
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::allKeys_data() void tst_QSettings::allKeys_data()
{ {
populateWithFormats(); populateWithFormats();
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QSettings::allKeys() void tst_QSettings::allKeys()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QSettings::Format, format); QFETCH(QSettings::Format, format);
QStringList allKeys; QStringList allKeys;
@ -2869,8 +2881,8 @@ void tst_QSettings::allKeys()
QCOMPARE(settings.allKeys(), allKeys); QCOMPARE(settings.allKeys(), allKeys);
} }
#endif
} }
#endif
void tst_QSettings::registerFormat() void tst_QSettings::registerFormat()
{ {

View File

@ -75,12 +75,14 @@ class tst_QUrlInternal : public QObject
private Q_SLOTS: private Q_SLOTS:
// IDNA internals // IDNA internals
#ifdef QT_BUILD_INTERNAL
void idna_testsuite_data(); void idna_testsuite_data();
void idna_testsuite(); void idna_testsuite();
void nameprep_testsuite_data(); void nameprep_testsuite_data();
void nameprep_testsuite(); void nameprep_testsuite();
void nameprep_highcodes_data(); void nameprep_highcodes_data();
void nameprep_highcodes(); void nameprep_highcodes();
#endif
void ace_testsuite_data(); void ace_testsuite_data();
void ace_testsuite(); void ace_testsuite();
void std3violations_data(); void std3violations_data();
@ -100,6 +102,7 @@ private Q_SLOTS:
}; };
#include "tst_qurlinternal.moc" #include "tst_qurlinternal.moc"
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::idna_testsuite_data() void tst_QUrlInternal::idna_testsuite_data()
{ {
QTest::addColumn<int>("numchars"); QTest::addColumn<int>("numchars");
@ -244,10 +247,11 @@ void tst_QUrlInternal::idna_testsuite_data()
<< QByteArray(IDNA_ACE_PREFIX "b1abfaaepdrnnbgefbadotcwatmq2g4l") << QByteArray(IDNA_ACE_PREFIX "b1abfaaepdrnnbgefbadotcwatmq2g4l")
<< 0 << 0 << IDNA_SUCCESS << IDNA_SUCCESS; << 0 << 0 << IDNA_SUCCESS << IDNA_SUCCESS;
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::idna_testsuite() void tst_QUrlInternal::idna_testsuite()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(int, numchars); QFETCH(int, numchars);
QFETCH(ushortarray, unicode); QFETCH(ushortarray, unicode);
QFETCH(QByteArray, punycode); QFETCH(QByteArray, punycode);
@ -256,9 +260,10 @@ void tst_QUrlInternal::idna_testsuite()
qt_punycodeEncoder((QChar*)unicode.points, numchars, &result); qt_punycodeEncoder((QChar*)unicode.points, numchars, &result);
QCOMPARE(result.toLatin1(), punycode); QCOMPARE(result.toLatin1(), punycode);
QCOMPARE(qt_punycodeDecoder(result), QString::fromUtf16(unicode.points, numchars)); QCOMPARE(qt_punycodeDecoder(result), QString::fromUtf16(unicode.points, numchars));
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::nameprep_testsuite_data() void tst_QUrlInternal::nameprep_testsuite_data()
{ {
QTest::addColumn<QString>("in"); QTest::addColumn<QString>("in");
@ -498,10 +503,11 @@ void tst_QUrlInternal::nameprep_testsuite_data()
"\xe3\x83\xbc\xe3\x83\x88") "\xe3\x83\xbc\xe3\x83\x88")
<< QString() << 0 << 0; << QString() << 0 << 0;
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::nameprep_testsuite() void tst_QUrlInternal::nameprep_testsuite()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QString, in); QFETCH(QString, in);
QFETCH(QString, out); QFETCH(QString, out);
QFETCH(QString, profile); QFETCH(QString, profile);
@ -514,9 +520,10 @@ void tst_QUrlInternal::nameprep_testsuite()
"Investigate further", Continue); "Investigate further", Continue);
qt_nameprep(&in, 0); qt_nameprep(&in, 0);
QCOMPARE(in, out); QCOMPARE(in, out);
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::nameprep_highcodes_data() void tst_QUrlInternal::nameprep_highcodes_data()
{ {
QTest::addColumn<QString>("in"); QTest::addColumn<QString>("in");
@ -550,18 +557,19 @@ void tst_QUrlInternal::nameprep_highcodes_data()
<< QString() << 0 << 0; << QString() << 0 << 0;
} }
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QUrlInternal::nameprep_highcodes() void tst_QUrlInternal::nameprep_highcodes()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QString, in); QFETCH(QString, in);
QFETCH(QString, out); QFETCH(QString, out);
QFETCH(QString, profile); QFETCH(QString, profile);
qt_nameprep(&in, 0); qt_nameprep(&in, 0);
QCOMPARE(in, out); QCOMPARE(in, out);
#endif
} }
#endif
void tst_QUrlInternal::ace_testsuite_data() void tst_QUrlInternal::ace_testsuite_data()
{ {

View File

@ -98,7 +98,9 @@ class tst_QStateMachine : public QObject
private slots: private slots:
void rootState(); void rootState();
void machineWithParent(); void machineWithParent();
#ifdef QT_BUILD_INTERNAL
void addAndRemoveState(); void addAndRemoveState();
#endif
void stateEntryAndExit(); void stateEntryAndExit();
void assignProperty(); void assignProperty();
void assignPropertyWithAnimation(); void assignPropertyWithAnimation();
@ -1107,9 +1109,9 @@ void tst_QStateMachine::machineWithParent()
QCOMPARE(machine->parentState(), static_cast<QState*>(0)); QCOMPARE(machine->parentState(), static_cast<QState*>(0));
} }
#ifdef QT_BUILD_INTERNAL
void tst_QStateMachine::addAndRemoveState() void tst_QStateMachine::addAndRemoveState()
{ {
#ifdef QT_BUILD_INTERNAL
QStateMachine machine; QStateMachine machine;
QStatePrivate *root_d = QStatePrivate::get(&machine); QStatePrivate *root_d = QStatePrivate::get(&machine);
QCOMPARE(root_d->childStates().size(), 0); QCOMPARE(root_d->childStates().size(), 0);
@ -1170,8 +1172,8 @@ void tst_QStateMachine::addAndRemoveState()
delete s2; delete s2;
// ### how to deal with this? // ### how to deal with this?
// machine.removeState(machine.errorState()); // machine.removeState(machine.errorState());
#endif
} }
#endif
void tst_QStateMachine::stateEntryAndExit() void tst_QStateMachine::stateEntryAndExit()
{ {

View File

@ -131,7 +131,9 @@ private slots:
void useCase3(); void useCase3();
void rootItemFlags(); void rootItemFlags();
#ifdef QT_BUILD_INTERNAL
void treeDragAndDrop(); void treeDragAndDrop();
#endif
void removeRowsAndColumns(); void removeRowsAndColumns();
void itemRoleNames(); void itemRoleNames();
@ -1471,9 +1473,9 @@ struct FriendlyTreeView : public QTreeView
}; };
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QStandardItemModel::treeDragAndDrop() void tst_QStandardItemModel::treeDragAndDrop()
{ {
#ifdef QT_BUILD_INTERNAL
const int nRow = 5; const int nRow = 5;
const int nCol = 3; const int nCol = 3;
@ -1611,8 +1613,8 @@ void tst_QStandardItemModel::treeDragAndDrop()
QVERIFY(compareModels(&model, &checkModel)); QVERIFY(compareModels(&model, &checkModel));
} }
#endif
} }
#endif
void tst_QStandardItemModel::removeRowsAndColumns() void tst_QStandardItemModel::removeRowsAndColumns()
{ {

View File

@ -131,7 +131,9 @@ private slots:
void parseString(); void parseString();
void fromString_data(); void fromString_data();
void fromString(); void fromString();
#ifdef QT_BUILD_INTERNAL
void ensureSorted(); void ensureSorted();
#endif
void standardKeys_data(); void standardKeys_data();
void standardKeys(); void standardKeys();
void keyBindings(); void keyBindings();
@ -299,9 +301,9 @@ void tst_QKeySequence::checkMultipleCodes()
* We must ensure that the keyBindings data is always sorted * We must ensure that the keyBindings data is always sorted
* so that we can safely perform binary searches. * so that we can safely perform binary searches.
*/ */
#ifdef QT_BUILD_INTERNAL
void tst_QKeySequence::ensureSorted() void tst_QKeySequence::ensureSorted()
{ {
#if defined(QT_BUILD_INTERNAL)
uint N = QKeySequencePrivate::numberOfKeyBindings; uint N = QKeySequencePrivate::numberOfKeyBindings;
uint val = QKeySequencePrivate::keyBindings[0].shortcut; uint val = QKeySequencePrivate::keyBindings[0].shortcut;
for ( uint i = 1 ; i < N ; ++i) { for ( uint i = 1 ; i < N ; ++i) {
@ -311,8 +313,8 @@ void tst_QKeySequence::ensureSorted()
QVERIFY(nextval >= val); QVERIFY(nextval >= val);
val = nextval; val = nextval;
} }
#endif
} }
#endif
void tst_QKeySequence::standardKeys_data() void tst_QKeySequence::standardKeys_data()
{ {

View File

@ -96,8 +96,10 @@ private slots:
void regionFromPath(); void regionFromPath();
#ifdef QT_BUILD_INTERNAL
void regionToPath_data(); void regionToPath_data();
void regionToPath(); void regionToPath();
#endif
}; };
Q_DECLARE_METATYPE(QPolygon) Q_DECLARE_METATYPE(QPolygon)
@ -910,6 +912,7 @@ void tst_QRegion::regionFromPath()
Q_DECLARE_METATYPE(QPainterPath) Q_DECLARE_METATYPE(QPainterPath)
#ifdef QT_BUILD_INTERNAL
void tst_QRegion::regionToPath_data() void tst_QRegion::regionToPath_data()
{ {
QTest::addColumn<QPainterPath>("path"); QTest::addColumn<QPainterPath>("path");
@ -957,6 +960,7 @@ void tst_QRegion::regionToPath_data()
QTest::newRow("Grid") << path; QTest::newRow("Grid") << path;
} }
} }
#endif
#ifdef QT_BUILD_INTERNAL #ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -964,9 +968,9 @@ extern QPainterPath qt_regionToPath(const QRegion &region);
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QRegion::regionToPath() void tst_QRegion::regionToPath()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QPainterPath, path); QFETCH(QPainterPath, path);
@ -1001,8 +1005,8 @@ void tst_QRegion::regionToPath()
QCOMPARE(ia, ib); QCOMPARE(ia, ib);
QCOMPARE(a.boundingRect(), b.boundingRect()); QCOMPARE(a.boundingRect(), b.boundingRect());
} }
#endif
} }
#endif
QTEST_MAIN(tst_QRegion) QTEST_MAIN(tst_QRegion)
#include "tst_qregion.moc" #include "tst_qregion.moc"

View File

@ -297,13 +297,17 @@ private Q_SLOTS:
void httpCanReadLine(); void httpCanReadLine();
#ifdef QT_BUILD_INTERNAL
void rateControl_data(); void rateControl_data();
void rateControl(); void rateControl();
#endif
void downloadProgress_data(); void downloadProgress_data();
void downloadProgress(); void downloadProgress();
#ifdef QT_BUILD_INTERNAL
void uploadProgress_data(); void uploadProgress_data();
void uploadProgress(); void uploadProgress();
#endif
void chaining_data(); void chaining_data();
void chaining(); void chaining();
@ -399,12 +403,14 @@ private Q_SLOTS:
void ftpAuthentication_data(); void ftpAuthentication_data();
void ftpAuthentication(); void ftpAuthentication();
#ifdef QT_BUILD_INTERNAL
void backgroundRequest_data(); void backgroundRequest_data();
void backgroundRequest(); void backgroundRequest();
void backgroundRequestInterruption_data(); void backgroundRequestInterruption_data();
void backgroundRequestInterruption(); void backgroundRequestInterruption();
void backgroundRequestConnectInBackground_data(); void backgroundRequestConnectInBackground_data();
void backgroundRequestConnectInBackground(); void backgroundRequestConnectInBackground();
#endif
// NOTE: This test must be last! // NOTE: This test must be last!
void parentingRepliesToTheApp(); void parentingRepliesToTheApp();
@ -4670,6 +4676,7 @@ void tst_QNetworkReply::httpCanReadLine()
QVERIFY(!reply->canReadLine()); QVERIFY(!reply->canReadLine());
} }
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::rateControl_data() void tst_QNetworkReply::rateControl_data()
{ {
QTest::addColumn<int>("rate"); QTest::addColumn<int>("rate");
@ -4682,7 +4689,9 @@ void tst_QNetworkReply::rateControl_data()
QTest::newRow("250") << 250; QTest::newRow("250") << 250;
QTest::newRow("1024") << 1024; QTest::newRow("1024") << 1024;
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::rateControl() void tst_QNetworkReply::rateControl()
{ {
QSKIP("Test disabled -- only for manual purposes"); QSKIP("Test disabled -- only for manual purposes");
@ -4690,10 +4699,6 @@ void tst_QNetworkReply::rateControl()
// faster than the data is being consumed. // faster than the data is being consumed.
QFETCH(int, rate); QFETCH(int, rate);
#if !defined(QT_BUILD_INTERNAL)
QSKIP("backend for testing not available!");
#endif
// ask for 20 seconds worth of data // ask for 20 seconds worth of data
FastSender sender(20 * rate * 1024); FastSender sender(20 * rate * 1024);
@ -4731,6 +4736,7 @@ void tst_QNetworkReply::rateControl()
QVERIFY(sender.transferRate >= minRate); QVERIFY(sender.transferRate >= minRate);
QVERIFY(sender.transferRate <= maxRate); QVERIFY(sender.transferRate <= maxRate);
} }
#endif
void tst_QNetworkReply::downloadProgress_data() void tst_QNetworkReply::downloadProgress_data()
{ {
@ -4803,17 +4809,17 @@ void tst_QNetworkReply::downloadProgress()
} }
} }
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::uploadProgress_data() void tst_QNetworkReply::uploadProgress_data()
{ {
putToFile_data(); putToFile_data();
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::uploadProgress() void tst_QNetworkReply::uploadProgress()
{ {
QFETCH(QByteArray, data); QFETCH(QByteArray, data);
#if !defined(QT_BUILD_INTERNAL)
QSKIP("backend for testing not available!");
#endif
QTcpServer server; QTcpServer server;
QVERIFY(server.listen()); QVERIFY(server.listen());
@ -4843,6 +4849,7 @@ void tst_QNetworkReply::uploadProgress()
QCOMPARE(args.at(0).toInt(), data.size()); QCOMPARE(args.at(0).toInt(), data.size());
QCOMPARE(args.at(1).toInt(), data.size()); QCOMPARE(args.at(1).toInt(), data.size());
} }
#endif
void tst_QNetworkReply::chaining_data() void tst_QNetworkReply::chaining_data()
{ {
@ -6822,6 +6829,7 @@ void tst_QNetworkReply::ftpAuthentication()
QCOMPARE(reply->error(), QNetworkReply::NetworkError(error)); QCOMPARE(reply->error(), QNetworkReply::NetworkError(error));
} }
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequest_data() void tst_QNetworkReply::backgroundRequest_data()
{ {
QTest::addColumn<QUrl>("url"); QTest::addColumn<QUrl>("url");
@ -6851,11 +6859,12 @@ void tst_QNetworkReply::backgroundRequest_data()
QTest::newRow("ftp, bg, nobg") << ftpurl << true << (int)QNetworkSession::NoBackgroundTrafficPolicy << QNetworkReply::BackgroundRequestNotAllowedError; QTest::newRow("ftp, bg, nobg") << ftpurl << true << (int)QNetworkSession::NoBackgroundTrafficPolicy << QNetworkReply::BackgroundRequestNotAllowedError;
} }
#endif
//test purpose: background requests can't be started when not allowed //test purpose: background requests can't be started when not allowed
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequest() void tst_QNetworkReply::backgroundRequest()
{ {
#ifdef QT_BUILD_INTERNAL
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
QFETCH(QUrl, url); QFETCH(QUrl, url);
QFETCH(bool, background); QFETCH(bool, background);
@ -6889,9 +6898,10 @@ void tst_QNetworkReply::backgroundRequest()
QVERIFY(reply->isFinished()); QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), error); QCOMPARE(reply->error(), error);
#endif #endif
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequestInterruption_data() void tst_QNetworkReply::backgroundRequestInterruption_data()
{ {
QTest::addColumn<QUrl>("url"); QTest::addColumn<QUrl>("url");
@ -6914,11 +6924,12 @@ void tst_QNetworkReply::backgroundRequestInterruption_data()
QTest::newRow("ftp, bg, nobg") << ftpurl << true << QNetworkReply::BackgroundRequestNotAllowedError; QTest::newRow("ftp, bg, nobg") << ftpurl << true << QNetworkReply::BackgroundRequestNotAllowedError;
} }
#endif
//test purpose: background requests in progress are aborted when policy changes to disallow them //test purpose: background requests in progress are aborted when policy changes to disallow them
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequestInterruption() void tst_QNetworkReply::backgroundRequestInterruption()
{ {
#ifdef QT_BUILD_INTERNAL
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
QFETCH(QUrl, url); QFETCH(QUrl, url);
QFETCH(bool, background); QFETCH(bool, background);
@ -6961,9 +6972,10 @@ void tst_QNetworkReply::backgroundRequestInterruption()
QVERIFY(reply->isFinished()); QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), error); QCOMPARE(reply->error(), error);
#endif #endif
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequestConnectInBackground_data() void tst_QNetworkReply::backgroundRequestConnectInBackground_data()
{ {
QTest::addColumn<QUrl>("url"); QTest::addColumn<QUrl>("url");
@ -6978,11 +6990,12 @@ void tst_QNetworkReply::backgroundRequestConnectInBackground_data()
QTest::newRow("ftp, fg") << ftpurl << false; QTest::newRow("ftp, fg") << ftpurl << false;
QTest::newRow("ftp, bg") << ftpurl << true; QTest::newRow("ftp, bg") << ftpurl << true;
} }
#endif
//test purpose: check that backgroundness is propagated to the network session //test purpose: check that backgroundness is propagated to the network session
#ifdef QT_BUILD_INTERNAL
void tst_QNetworkReply::backgroundRequestConnectInBackground() void tst_QNetworkReply::backgroundRequestConnectInBackground()
{ {
#ifdef QT_BUILD_INTERNAL
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
QFETCH(QUrl, url); QFETCH(QUrl, url);
QFETCH(bool, background); QFETCH(bool, background);
@ -7023,8 +7036,8 @@ void tst_QNetworkReply::backgroundRequestConnectInBackground()
QVERIFY(reply->isFinished()); QVERIFY(reply->isFinished());
#endif #endif
#endif
} }
#endif
// NOTE: This test must be last testcase in tst_qnetworkreply! // NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp() void tst_QNetworkReply::parentingRepliesToTheApp()

View File

@ -72,7 +72,12 @@ public:
private slots: private slots:
void initTestCase(); void initTestCase();
void getSetCheck(); void getSetCheck();
#ifdef QT_BUILD_INTERNAL
void qglContextDefaultBindTexture();
void openGLVersionCheck(); void openGLVersionCheck();
void shareRegister();
void textureCleanup();
#endif
void graphicsViewClipping(); void graphicsViewClipping();
void partialGLWidgetUpdates_data(); void partialGLWidgetUpdates_data();
void partialGLWidgetUpdates(); void partialGLWidgetUpdates();
@ -91,9 +96,6 @@ private slots:
void replaceClipping(); void replaceClipping();
void clipTest(); void clipTest();
void destroyFBOAfterContext(); void destroyFBOAfterContext();
void shareRegister();
void qglContextDefaultBindTexture();
void textureCleanup();
void threadImages(); void threadImages();
void nullRectCrash(); void nullRectCrash();
}; };
@ -654,9 +656,9 @@ extern QGLFormat::OpenGLVersionFlags qOpenGLVersionFlagsFromString(const QString
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QGL::openGLVersionCheck() void tst_QGL::openGLVersionCheck()
{ {
#ifdef QT_BUILD_INTERNAL
QString versionString; QString versionString;
QGLFormat::OpenGLVersionFlags expectedFlag; QGLFormat::OpenGLVersionFlags expectedFlag;
QGLFormat::OpenGLVersionFlags versionFlag; QGLFormat::OpenGLVersionFlags versionFlag;
@ -751,8 +753,8 @@ void tst_QGL::openGLVersionCheck()
#else #else
QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_1); QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_1);
#endif //defined(QT_OPENGL_ES_1) #endif //defined(QT_OPENGL_ES_1)
#endif //QT_BUILD_INTERNAL
} }
#endif //QT_BUILD_INTERNAL
static bool fuzzyComparePixels(const QRgb testPixel, const QRgb refPixel, const char* file, int line, int x = -1, int y = -1) static bool fuzzyComparePixels(const QRgb testPixel, const QRgb refPixel, const char* file, int line, int x = -1, int y = -1)
{ {
@ -1817,12 +1819,12 @@ int tst_QGLResource::deletions = 0;
#ifdef TODO #ifdef TODO
Q_GLOBAL_STATIC(QOpenGLContextGroupResource<tst_QGLResource>, qt_shared_test) Q_GLOBAL_STATIC(QOpenGLContextGroupResource<tst_QGLResource>, qt_shared_test)
#endif //TODO #endif //TODO
#endif #endif // QT_BUILD_INTERNAL
#ifdef QT_BUILD_INTERNAL
void tst_QGL::shareRegister() void tst_QGL::shareRegister()
{ {
#ifdef TODO #ifdef TODO
#ifdef QT_BUILD_INTERNAL
// Create a context. // Create a context.
QGLWidget *glw1 = new QGLWidget(); QGLWidget *glw1 = new QGLWidget();
glw1->makeCurrent(); glw1->makeCurrent();
@ -1932,14 +1934,14 @@ void tst_QGL::shareRegister()
QVERIFY(guard.id() == 0); QVERIFY(guard.id() == 0);
QVERIFY(guard3.context() == 0); QVERIFY(guard3.context() == 0);
QVERIFY(guard3.id() == 0); QVERIFY(guard3.id() == 0);
#endif
#endif //TODO #endif //TODO
} }
#endif
// Tests QGLContext::bindTexture with default options // Tests QGLContext::bindTexture with default options
#ifdef QT_BUILD_INTERNAL
void tst_QGL::qglContextDefaultBindTexture() void tst_QGL::qglContextDefaultBindTexture()
{ {
#ifdef QT_BUILD_INTERNAL
QGLWidget w; QGLWidget w;
w.makeCurrent(); w.makeCurrent();
QGLContext *ctx = const_cast<QGLContext*>(w.context()); QGLContext *ctx = const_cast<QGLContext*>(w.context());
@ -1981,12 +1983,12 @@ void tst_QGL::qglContextDefaultBindTexture()
ctx->deleteTexture(boundPixmapTextureId); ctx->deleteTexture(boundPixmapTextureId);
QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_FALSE); QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_FALSE);
QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_FALSE); QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_FALSE);
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QGL::textureCleanup() void tst_QGL::textureCleanup()
{ {
#ifdef QT_BUILD_INTERNAL
QGLWidget w; QGLWidget w;
w.resize(200,200); w.resize(200,200);
w.show(); w.show();
@ -2176,8 +2178,8 @@ void tst_QGL::textureCleanup()
copyOfPixmap = QPixmap(); copyOfPixmap = QPixmap();
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount); QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
#endif
} }
#endif
namespace ThreadImages { namespace ThreadImages {

View File

@ -101,7 +101,9 @@ public slots:
private slots: private slots:
void currentChangedSignal(); void currentChangedSignal();
#ifdef QT_BUILD_INTERNAL
void directoryEnteredSignal(); void directoryEnteredSignal();
#endif
void filesSelectedSignal_data(); void filesSelectedSignal_data();
void filesSelectedSignal(); void filesSelectedSignal();
void filterSelectedSignal(); void filterSelectedSignal();
@ -141,8 +143,10 @@ private slots:
void enableChooseButton(); void enableChooseButton();
void hooks(); void hooks();
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#ifdef QT_BUILD_INTERNAL
void tildeExpansion_data(); void tildeExpansion_data();
void tildeExpansion(); void tildeExpansion();
#endif // QT_BUILD_INTERNAL
#endif #endif
private: private:
@ -213,9 +217,9 @@ void tst_QFiledialog::currentChangedSignal()
} }
// only emitted from the views, sidebar, or lookin combo // only emitted from the views, sidebar, or lookin combo
#if defined QT_BUILD_INTERNAL
void tst_QFiledialog::directoryEnteredSignal() void tst_QFiledialog::directoryEnteredSignal()
{ {
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd(0, "", QDir::root().path()); QNonNativeFileDialog fd(0, "", QDir::root().path());
fd.setOptions(QFileDialog::DontUseNativeDialog); fd.setOptions(QFileDialog::DontUseNativeDialog);
fd.show(); fd.show();
@ -259,8 +263,8 @@ void tst_QFiledialog::directoryEnteredSignal()
QTest::mouseDClick(listView->viewport(), Qt::LeftButton, 0, listView->visualRect(folder).center()); QTest::mouseDClick(listView->viewport(), Qt::LeftButton, 0, listView->visualRect(folder).center());
QTRY_COMPARE(spyDirectoryEntered.count(), 1); QTRY_COMPARE(spyDirectoryEntered.count(), 1);
*/ */
#endif
} }
#endif
Q_DECLARE_METATYPE(QFileDialog::FileMode) Q_DECLARE_METATYPE(QFileDialog::FileMode)
void tst_QFiledialog::filesSelectedSignal_data() void tst_QFiledialog::filesSelectedSignal_data()
@ -1313,6 +1317,7 @@ void tst_QFiledialog::hooks()
} }
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#ifdef QT_BUILD_INTERNAL
void tst_QFiledialog::tildeExpansion_data() void tst_QFiledialog::tildeExpansion_data()
{ {
QTest::addColumn<QString>("tildePath"); QTest::addColumn<QString>("tildePath");
@ -1328,18 +1333,17 @@ void tst_QFiledialog::tildeExpansion_data()
QString invalid = QString::fromLatin1("~thisIsNotAValidUserName"); QString invalid = QString::fromLatin1("~thisIsNotAValidUserName");
QTest::newRow("invalid user name") << invalid << invalid; QTest::newRow("invalid user name") << invalid << invalid;
} }
#endif // QT_BUILD_INTERNAL
#ifdef QT_BUILD_INTERNAL
void tst_QFiledialog::tildeExpansion() void tst_QFiledialog::tildeExpansion()
{ {
#ifndef QT_BUILD_INTERNAL
QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)");
#else
QFETCH(QString, tildePath); QFETCH(QString, tildePath);
QFETCH(QString, expandedPath); QFETCH(QString, expandedPath);
QCOMPARE(qt_tildeExpansion(tildePath), expandedPath); QCOMPARE(qt_tildeExpansion(tildePath), expandedPath);
#endif
} }
#endif // QT_BUILD_INTERNAL
#endif #endif
QTEST_MAIN(tst_QFiledialog) QTEST_MAIN(tst_QFiledialog)

View File

@ -99,9 +99,16 @@ public slots:
void cleanup(); void cleanup();
private slots: private slots:
void listRoot(); #ifdef QT_BUILD_INTERNAL
void heapCorruption();
void deleteDirAndFiles(); void deleteDirAndFiles();
void listRoot();
void task227304_proxyOnFileDialog();
void task236402_dontWatchDeletedDir();
void task251321_sideBarHiddenEntries();
void task251341_sideBarRemoveEntries();
void task257579_sideBarWithNonCleanUrls();
#endif
void heapCorruption();
void filter(); void filter();
void showNameFilterDetails(); void showNameFilterDetails();
void unc(); void unc();
@ -110,7 +117,6 @@ private slots:
void task178897_minimumSize(); void task178897_minimumSize();
void task180459_lastDirectory_data(); void task180459_lastDirectory_data();
void task180459_lastDirectory(); void task180459_lastDirectory();
void task227304_proxyOnFileDialog();
void task227930_correctNavigationKeyboardBehavior(); void task227930_correctNavigationKeyboardBehavior();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void task226366_lowerCaseHardDriveWindows(); void task226366_lowerCaseHardDriveWindows();
@ -118,15 +124,11 @@ private slots:
void completionOnLevelAfterRoot(); void completionOnLevelAfterRoot();
void task233037_selectingDirectory(); void task233037_selectingDirectory();
void task235069_hideOnEscape(); void task235069_hideOnEscape();
void task236402_dontWatchDeletedDir();
void task203703_returnProperSeparator(); void task203703_returnProperSeparator();
void task228844_ensurePreviousSorting(); void task228844_ensurePreviousSorting();
void task239706_editableFilterCombo(); void task239706_editableFilterCombo();
void task218353_relativePaths(); void task218353_relativePaths();
void task251321_sideBarHiddenEntries();
void task251341_sideBarRemoveEntries();
void task254490_selectFileMultipleTimes(); void task254490_selectFileMultipleTimes();
void task257579_sideBarWithNonCleanUrls();
void task259105_filtersCornerCases(); void task259105_filtersCornerCases();
void QTBUG4419_lineEditSelectAll(); void QTBUG4419_lineEditSelectAll();
@ -176,9 +178,9 @@ void tst_QFileDialog2::cleanup()
settings.setValue(QLatin1String("filedialog"), userSettings); settings.setValue(QLatin1String("filedialog"), userSettings);
} }
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::listRoot() void tst_QFileDialog2::listRoot()
{ {
#if defined QT_BUILD_INTERNAL
QFileInfoGatherer fileInfoGatherer; QFileInfoGatherer fileInfoGatherer;
fileInfoGatherer.start(); fileInfoGatherer.start();
QTest::qWait(1500); QTest::qWait(1500);
@ -194,8 +196,8 @@ void tst_QFileDialog2::listRoot()
QTest::qWait(500); QTest::qWait(500);
#endif #endif
QCOMPARE(qt_test_isFetchedRoot(),true); QCOMPARE(qt_test_isFetchedRoot(),true);
#endif
} }
#endif
void tst_QFileDialog2::heapCorruption() void tst_QFileDialog2::heapCorruption()
{ {
@ -214,9 +216,9 @@ struct FriendlyQFileDialog : public QNonNativeFileDialog
}; };
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::deleteDirAndFiles() void tst_QFileDialog2::deleteDirAndFiles()
{ {
#if defined QT_BUILD_INTERNAL
QString tempPath = tempDir.path() + "/QFileDialogTestDir4FullDelete"; QString tempPath = tempDir.path() + "/QFileDialogTestDir4FullDelete";
QDir dir; QDir dir;
QVERIFY(dir.mkpath(tempPath + "/foo")); QVERIFY(dir.mkpath(tempPath + "/foo"));
@ -243,8 +245,8 @@ void tst_QFileDialog2::deleteDirAndFiles()
QFileInfo info(tempPath); QFileInfo info(tempPath);
QTest::qWait(2000); QTest::qWait(2000);
QVERIFY(!info.exists()); QVERIFY(!info.exists());
#endif
} }
#endif
void tst_QFileDialog2::filter() void tst_QFileDialog2::filter()
{ {
@ -453,9 +455,9 @@ QString &dir, const QString &filter)
} }
}; };
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::task227304_proxyOnFileDialog() void tst_QFileDialog2::task227304_proxyOnFileDialog()
{ {
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd(0, "", QDir::currentPath(), 0); QNonNativeFileDialog fd(0, "", QDir::currentPath(), 0);
fd.setProxyModel(new FilterDirModel(QDir::currentPath())); fd.setProxyModel(new FilterDirModel(QDir::currentPath()));
fd.show(); fd.show();
@ -489,8 +491,8 @@ void tst_QFileDialog2::task227304_proxyOnFileDialog()
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(1, 0)).center()); QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(1, 0)).center());
QTest::qWait(250); QTest::qWait(250);
//We shouldn't crash //We shouldn't crash
#endif
} }
#endif
void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior() void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
{ {
@ -670,9 +672,9 @@ void tst_QFileDialog2::task235069_hideOnEscape()
QCOMPARE(fd2.isVisible(), false); QCOMPARE(fd2.isVisible(), false);
} }
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::task236402_dontWatchDeletedDir() void tst_QFileDialog2::task236402_dontWatchDeletedDir()
{ {
#if defined QT_BUILD_INTERNAL
//THIS TEST SHOULD NOT DISPLAY WARNINGS //THIS TEST SHOULD NOT DISPLAY WARNINGS
QDir current = QDir::currentPath(); QDir current = QDir::currentPath();
//make sure it is the first on the list //make sure it is the first on the list
@ -692,8 +694,8 @@ void tst_QFileDialog2::task236402_dontWatchDeletedDir()
QTest::qWait(200); QTest::qWait(200);
fd.d_func()->removeDirectory(current.absolutePath() + "/aaaaaaaaaa/"); fd.d_func()->removeDirectory(current.absolutePath() + "/aaaaaaaaaa/");
QTest::qWait(1000); QTest::qWait(1000);
#endif
} }
#endif
void tst_QFileDialog2::task203703_returnProperSeparator() void tst_QFileDialog2::task203703_returnProperSeparator()
{ {
@ -862,9 +864,9 @@ void tst_QFileDialog2::task218353_relativePaths()
appDir.rmdir("test"); appDir.rmdir("test");
} }
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::task251321_sideBarHiddenEntries() void tst_QFileDialog2::task251321_sideBarHiddenEntries()
{ {
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd; QNonNativeFileDialog fd;
QDir current = QDir::currentPath(); QDir current = QDir::currentPath();
@ -899,8 +901,8 @@ void tst_QFileDialog2::task251321_sideBarHiddenEntries()
hiddenSubDir.rmdir("happy"); hiddenSubDir.rmdir("happy");
hiddenDir.rmdir("subdir"); hiddenDir.rmdir("subdir");
current.rmdir(".hidden"); current.rmdir(".hidden");
#endif
} }
#endif
#if defined QT_BUILD_INTERNAL #if defined QT_BUILD_INTERNAL
class MyQSideBar : public QSidebar class MyQSideBar : public QSidebar
@ -922,9 +924,9 @@ public :
}; };
#endif #endif
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::task251341_sideBarRemoveEntries() void tst_QFileDialog2::task251341_sideBarRemoveEntries()
{ {
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd; QNonNativeFileDialog fd;
QDir current = QDir::currentPath(); QDir current = QDir::currentPath();
@ -984,8 +986,8 @@ void tst_QFileDialog2::task251341_sideBarRemoveEntries()
QCOMPARE(mySideBar.urls(), expected); QCOMPARE(mySideBar.urls(), expected);
current.rmdir("testDir"); current.rmdir("testDir");
#endif
} }
#endif
void tst_QFileDialog2::task254490_selectFileMultipleTimes() void tst_QFileDialog2::task254490_selectFileMultipleTimes()
{ {
@ -1019,9 +1021,9 @@ void tst_QFileDialog2::task254490_selectFileMultipleTimes()
t->deleteLater(); t->deleteLater();
} }
#ifdef QT_BUILD_INTERNAL
void tst_QFileDialog2::task257579_sideBarWithNonCleanUrls() void tst_QFileDialog2::task257579_sideBarWithNonCleanUrls()
{ {
#if defined QT_BUILD_INTERNAL
QDir dir(tempDir.path()); QDir dir(tempDir.path());
QLatin1String dirname("autotest_task257579"); QLatin1String dirname("autotest_task257579");
dir.rmdir(dirname); //makes sure it doesn't exist any more dir.rmdir(dirname); //makes sure it doesn't exist any more
@ -1042,8 +1044,8 @@ void tst_QFileDialog2::task257579_sideBarWithNonCleanUrls()
//all tests are finished, we can remove the temporary dir //all tests are finished, we can remove the temporary dir
QVERIFY(dir.rmdir(dirname)); QVERIFY(dir.rmdir(dirname));
#endif
} }
#endif
void tst_QFileDialog2::task259105_filtersCornerCases() void tst_QFileDialog2::task259105_filtersCornerCases()
{ {

View File

@ -83,8 +83,10 @@ private slots:
void indexPath(); void indexPath();
void rootPath(); void rootPath();
#ifdef QT_BUILD_INTERNAL
void naturalCompare_data(); void naturalCompare_data();
void naturalCompare(); void naturalCompare();
#endif
void readOnly(); void readOnly();
void iconProvider(); void iconProvider();
@ -231,6 +233,7 @@ void tst_QFileSystemModel::rootPath()
} }
} }
#ifdef QT_BUILD_INTERNAL
void tst_QFileSystemModel::naturalCompare_data() void tst_QFileSystemModel::naturalCompare_data()
{ {
QTest::addColumn<QString>("s1"); QTest::addColumn<QString>("s1");
@ -277,10 +280,11 @@ void tst_QFileSystemModel::naturalCompare_data()
} }
#undef ROWNAME #undef ROWNAME
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QFileSystemModel::naturalCompare() void tst_QFileSystemModel::naturalCompare()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(QString, s1); QFETCH(QString, s1);
QFETCH(QString, s2); QFETCH(QString, s2);
QFETCH(int, caseSensitive); QFETCH(int, caseSensitive);
@ -298,8 +302,8 @@ void tst_QFileSystemModel::naturalCompare()
// created. The scheduler takes its time to recognize ended threads. // created. The scheduler takes its time to recognize ended threads.
QTest::qWait(300); QTest::qWait(300);
#endif #endif
#endif
} }
#endif
void tst_QFileSystemModel::readOnly() void tst_QFileSystemModel::readOnly()
{ {

View File

@ -115,7 +115,6 @@ private slots:
void iconSize(); void iconSize();
void toolButtonStyle(); void toolButtonStyle();
void menuBar(); void menuBar();
void statusBar();
void centralWidget(); void centralWidget();
void corner(); void corner();
void addToolBarBreak(); void addToolBarBreak();
@ -132,8 +131,11 @@ private slots:
void restoreStateFromPreviousVersion(); void restoreStateFromPreviousVersion();
void createPopupMenu(); void createPopupMenu();
void hideBeforeLayout(); void hideBeforeLayout();
#ifdef QT_BUILD_INTERNAL
void saveRestore(); void saveRestore();
void saveRestore_data(); void saveRestore_data();
void statusBar();
#endif
void isSeparator(); void isSeparator();
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
void setCursor(); void setCursor();
@ -653,6 +655,7 @@ void tst_QMainWindow::menuBar()
} }
} }
#ifdef QT_BUILD_INTERNAL
void tst_QMainWindow::statusBar() void tst_QMainWindow::statusBar()
{ {
{ {
@ -734,6 +737,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(indexOfSb == -1); QVERIFY(indexOfSb == -1);
} }
} }
#endif
void tst_QMainWindow::centralWidget() void tst_QMainWindow::centralWidget()
{ {
@ -1510,9 +1514,9 @@ QMap<QString, QRect> dockWidgetGeometries(QMainWindow *mw)
QCOMPARE(__newGeos, __oldGeos); \ QCOMPARE(__newGeos, __oldGeos); \
} }
#ifdef QT_BUILD_INTERNAL
void tst_QMainWindow::saveRestore_data() void tst_QMainWindow::saveRestore_data()
{ {
#ifdef QT_BUILD_INTERNAL
QTest::addColumn<AddList >("addList"); QTest::addColumn<AddList >("addList");
QTest::addColumn<MoveList >("moveList"); QTest::addColumn<MoveList >("moveList");
@ -1547,12 +1551,12 @@ void tst_QMainWindow::saveRestore_data()
<< MoveSeparator(-30, "right1") << MoveSeparator(-30, "right1")
<< MoveSeparator(30, "right2a") << MoveSeparator(30, "right2a")
); );
#endif
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QMainWindow::saveRestore() void tst_QMainWindow::saveRestore()
{ {
#ifdef QT_BUILD_INTERNAL
QFETCH(AddList, addList); QFETCH(AddList, addList);
QFETCH(MoveList, moveList); QFETCH(MoveList, moveList);
@ -1613,8 +1617,8 @@ void tst_QMainWindow::saveRestore()
mainWindow.show(); mainWindow.show();
COMPARE_DOCK_WIDGET_GEOS(dockWidgetGeos, dockWidgetGeometries(&mainWindow)); COMPARE_DOCK_WIDGET_GEOS(dockWidgetGeos, dockWidgetGeometries(&mainWindow));
} }
#endif
} }
#endif
void tst_QMainWindow::isSeparator() void tst_QMainWindow::isSeparator()
{ {

View File

@ -189,11 +189,13 @@ private slots:
void selectionChanged(); void selectionChanged();
void copyPasteBackgroundImage(); void copyPasteBackgroundImage();
void setText(); void setText();
void cursorRect();
#ifdef QT_BUILD_INTERNAL
void fullWidthSelection_data(); void fullWidthSelection_data();
void fullWidthSelection(); void fullWidthSelection();
void fullWidthSelection2(); void fullWidthSelection2();
void cursorRect();
void setDocumentPreservesPalette(); void setDocumentPreservesPalette();
#endif
void pasteFromQt3RichText(); void pasteFromQt3RichText();
void noWrapBackgrounds(); void noWrapBackgrounds();
void preserveCharFormatAfterUnchangingSetPosition(); void preserveCharFormatAfterUnchangingSetPosition();
@ -1939,6 +1941,7 @@ QT_BEGIN_NAMESPACE
extern void qt_setQtEnableTestFont(bool value); extern void qt_setQtEnableTestFont(bool value);
QT_END_NAMESPACE QT_END_NAMESPACE
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::fullWidthSelection_data() void tst_QTextEdit::fullWidthSelection_data()
{ {
QTest::addColumn<int>("cursorFrom"); QTest::addColumn<int>("cursorFrom");
@ -1958,7 +1961,9 @@ void tst_QTextEdit::fullWidthSelection_data()
QTest::newRow("single full width line") QTest::newRow("single full width line")
<< 20 << 30 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/single-full-width-line.png")); << 20 << 30 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/single-full-width-line.png"));
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::fullWidthSelection() void tst_QTextEdit::fullWidthSelection()
{ {
QFETCH(int, cursorFrom); QFETCH(int, cursorFrom);
@ -2024,7 +2029,9 @@ void tst_QTextEdit::fullWidthSelection()
compareWidgetAndImage(widget, imageFileName); compareWidgetAndImage(widget, imageFileName);
} }
#endif
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::fullWidthSelection2() void tst_QTextEdit::fullWidthSelection2()
{ {
QPalette myPalette; QPalette myPalette;
@ -2060,6 +2067,7 @@ void tst_QTextEdit::fullWidthSelection2()
compareWidgetAndImage(widget, "fullWidthSelection/nowrap_long.png"); compareWidgetAndImage(widget, "fullWidthSelection/nowrap_long.png");
} }
#endif
void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imageFileName) void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imageFileName)
{ {
@ -2120,9 +2128,9 @@ void tst_QTextEdit::cursorRect()
QCOMPARE(ed->cursorRect().width(), 10); QCOMPARE(ed->cursorRect().width(), 10);
} }
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::setDocumentPreservesPalette() void tst_QTextEdit::setDocumentPreservesPalette()
{ {
#ifdef QT_BUILD_INTERNAL
QWidgetTextControl *control = qFindChild<QWidgetTextControl *>(ed); QWidgetTextControl *control = qFindChild<QWidgetTextControl *>(ed);
QVERIFY(control); QVERIFY(control);
@ -2143,8 +2151,8 @@ void tst_QTextEdit::setDocumentPreservesPalette()
QVERIFY(control->document() == newDoc); QVERIFY(control->document() == newDoc);
QVERIFY(whitePal.color(QPalette::Active, QPalette::Text) QVERIFY(whitePal.color(QPalette::Active, QPalette::Text)
== control->palette().color(QPalette::Active, QPalette::Text)); == control->palette().color(QPalette::Active, QPalette::Text));
#endif
} }
#endif
class PublicTextEdit : public QTextEdit class PublicTextEdit : public QTextEdit
{ {