diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 3459bede85..612ce3cd7e 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1718,6 +1718,14 @@ void tst_Moc::warnings_data() << 1 << QString() << QString("standard input:1: Error: Class contains Q_OBJECT macro but does not inherit from QObject"); + + QTest::newRow("Warning on invalid macro") + << QByteArray("#define Foo(a, b)\n class X : public QObject { Q_OBJECT }; \n Foo(a) \n Foo(a,b,c) \n") + << QStringList() + << 0 + << QString("IGNORE_ALL_STDOUT") + << QString(":3: Warning: Macro argument mismatch.\n:4: Warning: Macro argument mismatch."); + } void tst_Moc::warnings() @@ -1759,7 +1767,7 @@ void tst_Moc::warnings() // magic value "IGNORE_ALL_STDOUT" ignores stdout if (expectedStdOut != "IGNORE_ALL_STDOUT") QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardOutput()).trimmed(), expectedStdOut); - QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()).trimmed(), expectedStdErr); + QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()).trimmed().remove('\r'), expectedStdErr); } class tst_Moc::PrivateClass : public QObject { |