From 1fcc6ba3d92e5b98eb60a1c90a9bd64e4c3ae3a8 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 20 Sep 2011 17:19:26 +1000 Subject: 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 Reviewed-by: Rohan McGovern --- tests/auto/testlib/selftests/expected_warnings.txt | 10 +--------- tests/auto/testlib/selftests/warnings/tst_warnings.cpp | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'tests/auto/testlib/selftests') 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() -- cgit v1.2.3