Replace Q_WS_ in tests by Q_OS_ or check platform names.
Change-Id: Ica445cf1e83bfaab870ac344d6c02766f047a5cc Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
887607e956
commit
a89c7e4020
@ -149,16 +149,17 @@ void tst_QFont::exactMatch()
|
||||
font = QFont( "BogusFont", 33 );
|
||||
QVERIFY( !font.exactMatch() );
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
QSKIP("Exact matching on windows misses a lot because of the sample chars");
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
QVERIFY(QFont("sans").exactMatch());
|
||||
QVERIFY(QFont("sans-serif").exactMatch());
|
||||
QVERIFY(QFont("serif").exactMatch());
|
||||
QVERIFY(QFont("monospace").exactMatch());
|
||||
#endif
|
||||
|
||||
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
|
||||
QVERIFY(QFont("sans").exactMatch());
|
||||
QVERIFY(QFont("sans-serif").exactMatch());
|
||||
QVERIFY(QFont("serif").exactMatch());
|
||||
QVERIFY(QFont("monospace").exactMatch());
|
||||
}
|
||||
|
||||
QSKIP("This test is bogus on Unix with support for font aliases in fontconfig");
|
||||
|
||||
@ -201,7 +202,7 @@ void tst_QFont::exactMatch()
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef Q_WS_WIN32
|
||||
#ifdef Q_OS_WIN
|
||||
if (font.family().startsWith("MS ") || fontinfo.family().startsWith("MS ")) {
|
||||
/* qDebug("Family matching skipped for MS-Alias font: %s, fontinfo: %s",
|
||||
font.family().latin1(), fontinfo.family().latin1());
|
||||
|
@ -145,9 +145,6 @@ void tst_QFontDatabase::fixedPitch_data()
|
||||
|
||||
void tst_QFontDatabase::fixedPitch()
|
||||
{
|
||||
#ifdef Q_WS_QWS
|
||||
QSKIP("fixedPitch not implemented for Qtopia Core");
|
||||
#endif
|
||||
QFETCH(QString, font);
|
||||
QFETCH(bool, fixedPitch);
|
||||
|
||||
|
@ -901,7 +901,7 @@ void tst_QPrinter::errorReporting()
|
||||
p.setOutputFormat(QPrinter::PdfFormat);
|
||||
QCOMPARE(p.isValid(), true);
|
||||
QPainter painter;
|
||||
#ifndef Q_WS_WIN
|
||||
#ifndef Q_OS_WIN
|
||||
// not sure how to choose a never-writable file on windows. But its QFile behavior anyway, so lets rely on it failing elsewhere
|
||||
p.setOutputFileName("/foobar/nonwritable.pdf");
|
||||
QCOMPARE(painter.begin(&p), false); // it should check the output file is writable
|
||||
|
@ -909,9 +909,6 @@ void tst_QFiledialog::selectFiles()
|
||||
QVERIFY(listView);
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
fd.selectFile(fd.directory().path() + "/" + list.at(i));
|
||||
#if defined(Q_WS_WIN)
|
||||
QEXPECT_FAIL("", "This test does not work on Windows", Abort);
|
||||
#endif
|
||||
QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty());
|
||||
toSelect.append(listView->selectionModel()->selectedRows().last());
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ void tst_QDirModel::mkdir_data()
|
||||
QTest::newRow("outOfTreeDirName") << QString(QDir::currentPath() + "/test5") << false << false;
|
||||
|
||||
// Directory names only illegal on Windows
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
QTest::newRow("illegalDirName") << QString("*") << false << false;
|
||||
QTest::newRow("illegalDirName2") << QString("|") << false << false;
|
||||
QTest::newRow("onlySpace") << QString(" ") << false << false;
|
||||
|
@ -79,7 +79,7 @@
|
||||
#include <QMacStyle>
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QWindowsXPStyle>
|
||||
#include <QWindowsVistaStyle>
|
||||
#endif
|
||||
@ -211,7 +211,7 @@ void tst_QStyle::testStyleFactory()
|
||||
#ifndef QT_NO_STYLE_MOTIF
|
||||
QVERIFY(keys.contains("Motif"));
|
||||
#endif
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP &&
|
||||
(QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
|
||||
QVERIFY(keys.contains("WindowsXP"));
|
||||
@ -416,7 +416,7 @@ void tst_QStyle::testWindowsStyle()
|
||||
#ifndef QT_NO_STYLE_WINDOWSXP
|
||||
void tst_QStyle::testWindowsXPStyle()
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
QWindowsXPStyle xpstyle;
|
||||
QVERIFY(testAllFunctions(&xpstyle));
|
||||
lineUpLayoutTest(&xpstyle);
|
||||
@ -442,7 +442,7 @@ QImage readImage(const QString &fileName)
|
||||
|
||||
void tst_QStyle::testWindowsVistaStyle()
|
||||
{
|
||||
#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
QWindowsVistaStyle vistastyle;
|
||||
QVERIFY(testAllFunctions(&vistastyle));
|
||||
|
||||
|
@ -2582,7 +2582,7 @@ void tst_QLineEdit::setValidator_QIntValidator()
|
||||
void tst_QLineEdit::frame_data()
|
||||
{
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTest::addColumn<QPixmap>("noFrame");
|
||||
QTest::addColumn<QPixmap>("useFrame");
|
||||
|
||||
@ -2598,7 +2598,7 @@ void tst_QLineEdit::frame()
|
||||
testWidget->setFrame(false);
|
||||
// verify that the editor is shown without a frame
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTEST(testWidget, "noFrame");
|
||||
#endif
|
||||
#endif
|
||||
@ -2607,7 +2607,7 @@ void tst_QLineEdit::frame()
|
||||
testWidget->setFrame(true);
|
||||
// verify that the editor is shown with a frame
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTEST(testWidget, "useFrame");
|
||||
#endif
|
||||
#endif
|
||||
@ -2617,7 +2617,7 @@ void tst_QLineEdit::frame()
|
||||
void tst_QLineEdit::setAlignment_data()
|
||||
{
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTest::addColumn<QPixmap>("left");
|
||||
QTest::addColumn<QPixmap>("right");
|
||||
QTest::addColumn<QPixmap>("hcenter");
|
||||
@ -2635,7 +2635,7 @@ void tst_QLineEdit::setAlignment()
|
||||
testWidget->setText("left");
|
||||
testWidget->setAlignment(Qt::AlignLeft);
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTEST(testWidget, "left");
|
||||
#endif
|
||||
#endif
|
||||
@ -2644,7 +2644,7 @@ void tst_QLineEdit::setAlignment()
|
||||
testWidget->setText("hcenter");
|
||||
testWidget->setAlignment(Qt::AlignHCenter);
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTEST(testWidget, "hcenter");
|
||||
#endif
|
||||
#endif
|
||||
@ -2653,7 +2653,7 @@ void tst_QLineEdit::setAlignment()
|
||||
testWidget->setText("right");
|
||||
testWidget->setAlignment(Qt::AlignRight);
|
||||
#ifndef NO_PIXMAP_TESTS
|
||||
#if defined Q_WS_WIN
|
||||
#if defined Q_OS_WIN
|
||||
QTEST(testWidget, "right");
|
||||
#endif
|
||||
#endif
|
||||
|
@ -637,7 +637,7 @@ void tst_QPlainTextEdit::undoRedo()
|
||||
QCOMPARE(ed->toPlainText(), QString());
|
||||
ed->redo();
|
||||
QCOMPARE(ed->toPlainText(), QString("abc d"));
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
// shortcut for undo
|
||||
QTest::keyClick(ed, Qt::Key_Backspace, Qt::AltModifier);
|
||||
QCOMPARE(ed->toPlainText(), QString());
|
||||
|
@ -571,7 +571,7 @@ void tst_QTabWidget::paintEventCount()
|
||||
static const int MaxInitialPaintCount =
|
||||
#if defined(Q_OS_WINCE)
|
||||
4;
|
||||
#elif defined(Q_WS_WIN)
|
||||
#elif defined(Q_OS_WIN)
|
||||
2;
|
||||
#elif defined(Q_OS_MAC)
|
||||
5;
|
||||
|
@ -992,7 +992,7 @@ void tst_QTextEdit::undoRedo()
|
||||
QCOMPARE(ed->toPlainText(), QString());
|
||||
ed->redo();
|
||||
QCOMPARE(ed->toPlainText(), QString("abc d"));
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
// shortcut for undo
|
||||
QTest::keyClick(ed, Qt::Key_Backspace, Qt::AltModifier);
|
||||
QCOMPARE(ed->toPlainText(), QString());
|
||||
|
Loading…
Reference in New Issue
Block a user