Remove #ifdef from outside test functions

It's usually a bad idea to surround slots or signals with #ifdef since
moc may not parse it the same way the compiler does.

Change-Id: I6a3623ed7cb9fbc1b966df9d60f71b7fdf91acfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Thiago Macieira 2014-01-09 18:54:46 -08:00 committed by The Qt Project
parent e1f89037c3
commit 9598448758
2 changed files with 13 additions and 12 deletions

View File

@ -121,9 +121,7 @@ private slots:
// Map/unmap large file // Map/unmap large file
void mapFile(); void mapFile();
#ifndef Q_OS_MAC
void mapOffsetOverflow(); void mapOffsetOverflow();
#endif
void closeFile() { largeFile.close(); } void closeFile() { largeFile.close(); }
@ -513,9 +511,9 @@ void tst_LargeFile::mapFile()
} }
//Mac: memory-mapping beyond EOF may succeed but it could generate bus error on access //Mac: memory-mapping beyond EOF may succeed but it could generate bus error on access
#ifndef Q_OS_MAC
void tst_LargeFile::mapOffsetOverflow() void tst_LargeFile::mapOffsetOverflow()
{ {
#ifndef Q_OS_MAC
// Out-of-range mappings should fail, and not silently clip the offset // Out-of-range mappings should fail, and not silently clip the offset
for (int i = 50; i < 63; ++i) { for (int i = 50; i < 63; ++i) {
uchar *address = 0; uchar *address = 0;
@ -529,8 +527,8 @@ void tst_LargeFile::mapOffsetOverflow()
address = largeFile.map(((qint64)1 << i) + blockSize, blockSize); address = largeFile.map(((qint64)1 << i) + blockSize, blockSize);
QVERIFY( !address ); QVERIFY( !address );
} }
}
#endif #endif
}
QTEST_APPLESS_MAIN(tst_LargeFile) QTEST_APPLESS_MAIN(tst_LargeFile)
#include "tst_largefile.moc" #include "tst_largefile.moc"

View File

@ -120,10 +120,8 @@ private slots:
void symetricConstructors(); void symetricConstructors();
void checkMultipleNames(); void checkMultipleNames();
void checkMultipleCodes(); void checkMultipleCodes();
#ifndef Q_OS_MAC
void mnemonic_data(); void mnemonic_data();
void mnemonic(); void mnemonic();
#endif
void toString_data(); void toString_data();
void toString(); void toString();
void toStringFromKeycode_data(); void toStringFromKeycode_data();
@ -144,10 +142,8 @@ private slots:
void standardKeys_data(); void standardKeys_data();
void standardKeys(); void standardKeys();
void keyBindings(); void keyBindings();
#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
void translated_data(); void translated_data();
void translated(); void translated();
#endif
void i18nKeys_data(); void i18nKeys_data();
void i18nKeys(); void i18nKeys();
@ -405,9 +401,11 @@ void tst_QKeySequence::keyBindings()
QCOMPARE(bindings, expected); QCOMPARE(bindings, expected);
} }
#ifndef Q_OS_MAC
void tst_QKeySequence::mnemonic_data() void tst_QKeySequence::mnemonic_data()
{ {
#ifdef Q_OS_MAC
QSKIP("Test not applicable to Mac OS X");
#endif
QTest::addColumn<QString>("string"); QTest::addColumn<QString>("string");
QTest::addColumn<QString>("key"); QTest::addColumn<QString>("key");
QTest::addColumn<bool>("warning"); QTest::addColumn<bool>("warning");
@ -427,6 +425,7 @@ void tst_QKeySequence::mnemonic_data()
void tst_QKeySequence::mnemonic() void tst_QKeySequence::mnemonic()
{ {
#ifndef Q_OS_MAC
QFETCH(QString, string); QFETCH(QString, string);
QFETCH(QString, key); QFETCH(QString, key);
QFETCH(bool, warning); QFETCH(bool, warning);
@ -444,8 +443,8 @@ void tst_QKeySequence::mnemonic()
QKeySequence res = QKeySequence(key); QKeySequence res = QKeySequence(key);
QCOMPARE(seq, res); QCOMPARE(seq, res);
}
#endif #endif
}
void tst_QKeySequence::toString_data() void tst_QKeySequence::toString_data()
{ {
@ -734,9 +733,12 @@ void tst_QKeySequence::listFromString()
QCOMPARE(QKeySequence::listFromString(strSequences), sequences); QCOMPARE(QKeySequence::listFromString(strSequences), sequences);
} }
#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
void tst_QKeySequence::translated_data() void tst_QKeySequence::translated_data()
{ {
#if defined (Q_OS_MAC) || defined (Q_OS_WINCE)
QSKIP("Test not applicable");
#endif
qApp->installTranslator(ourTranslator); qApp->installTranslator(ourTranslator);
qApp->installTranslator(qtTranslator); qApp->installTranslator(qtTranslator);
@ -764,6 +766,7 @@ void tst_QKeySequence::translated_data()
void tst_QKeySequence::translated() void tst_QKeySequence::translated()
{ {
#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
QFETCH(QString, transKey); QFETCH(QString, transKey);
QFETCH(QString, compKey); QFETCH(QString, compKey);
@ -775,8 +778,8 @@ void tst_QKeySequence::translated()
qApp->removeTranslator(ourTranslator); qApp->removeTranslator(ourTranslator);
qApp->removeTranslator(qtTranslator); qApp->removeTranslator(qtTranslator);
}
#endif #endif
}
void tst_QKeySequence::i18nKeys_data() void tst_QKeySequence::i18nKeys_data()
{ {