summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-09-20 17:19:26 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-21 03:59:09 +0200
commit1fcc6ba3d92e5b98eb60a1c90a9bd64e4c3ae3a8 (patch)
tree5f4b2ca813846915ba250c95c6364f332e56424c /tests/auto/testlib
parent1363d5b9eb6815a9ed5d8801c3a5bdc3af762944 (diff)
Remove printf calls from warnings selftest
The warnings selftest verifies that qtestlib correctly handles output sent via qDebug() and friends. The test had a number of printf calls that were used to tell the user what output they should expect to see next, but by bypassing testlib's logging, these made the testlog differ depending on whether the test log was directed to the console or a file. The printf calls are no longer needed, as any regressions in qDebug will be detected by tst_selftests, which compares the output of the warnings test with a reference copy of the expected output. Change-Id: I8c3a3237463141fa494c50ca02062760cb583090 Reviewed-on: http://codereview.qt-project.org/5200 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.txt10
-rw-r--r--tests/auto/testlib/selftests/warnings/tst_warnings.cpp9
2 files changed, 1 insertions, 18 deletions
diff --git a/tests/auto/testlib/selftests/expected_warnings.txt b/tests/auto/testlib/selftests/expected_warnings.txt
index 0a9437f47c..9a68879847 100644
--- a/tests/auto/testlib/selftests/expected_warnings.txt
+++ b/tests/auto/testlib/selftests/expected_warnings.txt
@@ -1,18 +1,10 @@
********* Start testing of tst_Warnings *********
-Config: Using QTest library 4.1.0, Qt 4.1.0
+Config: Using QTest library 5.0.0, Qt 5.0.0
PASS : tst_Warnings::initTestCase()
-testWarnings 1: next line prints "Warning"
QWARN : tst_Warnings::testWarnings() Warning
-testWarnings 2: next line prints nothing
-testWarnings 3: next line prints "Warning"
QWARN : tst_Warnings::testWarnings() Warning
-testWarnings 4: over
-testWarnings 5: next line prints "Debug"
QDEBUG : tst_Warnings::testWarnings() Debug
-testWarnings 6: next line prints nothing
-testWarnings 7: next line prints "Debug"
QDEBUG : tst_Warnings::testWarnings() Debug
-testWarnings 8: next comes "Baba" twice
QDEBUG : tst_Warnings::testWarnings() Baba
QDEBUG : tst_Warnings::testWarnings() Baba
PASS : tst_Warnings::testWarnings()
diff --git a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
index 52a992c763..e14f9c3d98 100644
--- a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
+++ b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
@@ -53,33 +53,24 @@ private slots:
void tst_Warnings::testWarnings()
{
- printf("testWarnings 1: next line prints \"Warning\"\n");
qWarning("Warning");
- printf("testWarnings 2: next line prints nothing\n");
QTest::ignoreMessage(QtWarningMsg, "Warning");
qWarning("Warning");
- printf("testWarnings 3: next line prints \"Warning\"\n");
qWarning("Warning");
- printf("testWarnings 4: over\n");
- printf("testWarnings 5: next line prints \"Debug\"\n");
qDebug("Debug");
- printf("testWarnings 6: next line prints nothing\n");
QTest::ignoreMessage(QtDebugMsg, "Debug");
qDebug("Debug");
- printf("testWarnings 7: next line prints \"Debug\"\n");
qDebug("Debug");
- printf("testWarnings 8: next comes \"Baba\" twice\n");
QTest::ignoreMessage(QtDebugMsg, "Bubu");
qDebug("Baba");
qDebug("Bubu");
qDebug("Baba");
-
}
void tst_Warnings::testMissingWarnings()