diff options
Diffstat (limited to 'tests/auto/compilerwarnings')
-rw-r--r-- | tests/auto/compilerwarnings/test.cpp | 2 | ||||
-rw-r--r-- | tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/compilerwarnings/test.cpp b/tests/auto/compilerwarnings/test.cpp index ea66ec4..dd8b833 100644 --- a/tests/auto/compilerwarnings/test.cpp +++ b/tests/auto/compilerwarnings/test.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index d5fef1b..6a7580c 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -142,10 +142,11 @@ void tst_CompilerWarnings::warnings() } static QString tmpSourceFile; bool openResult = true; - QString templatePath = QDir::temp().absoluteFilePath("XXXXXX-test.cpp"); - QTemporaryFile tmpQSourceFile(templatePath); + const QString tmpBaseName("XXXXXX-test.cpp"); + QString templatePath = QDir::temp().absoluteFilePath(tmpBaseName); + QFile tmpQSourceFile(templatePath); if (tmpSourceFile.isEmpty()) { - tmpQSourceFile.open(); + tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate); tmpSourceFile = tmpQSourceFile.fileName(); QFile cppSource(":/test.cpp"); bool openResult = cppSource.open(QIODevice::ReadOnly); @@ -156,6 +157,7 @@ void tst_CompilerWarnings::warnings() out << in.readAll(); } } + tmpQSourceFile.close(); QVERIFY2(openResult, "Need resource temporary \"test.cpp\""); QStringList args; @@ -232,8 +234,8 @@ void tst_CompilerWarnings::warnings() #ifdef Q_CC_MSVC QString errs = QString::fromLocal8Bit(proc.readAllStandardOutput().constData()); - if (errs.startsWith(tmpSourceFile)) - errs = errs.mid(10); + if (errs.startsWith(tmpBaseName)) + errs = errs.mid(tmpBaseName.size()).simplified();; #else QString errs = QString::fromLocal8Bit(proc.readAllStandardError().constData()); #endif @@ -247,6 +249,8 @@ void tst_CompilerWarnings::warnings() } QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output QVERIFY(errs.isEmpty()); + + tmpQSourceFile.remove(); } QTEST_APPLESS_MAIN(tst_CompilerWarnings) |