diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-08-24 18:20:44 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-29 06:48:18 +0200 |
commit | 39f9fd29526ae8f6803314d9fdc8dcf1cb9bd2bc (patch) | |
tree | a6f242113e0411ce061289502bb92052ea67ffde /src/testlib/qtestlog.cpp | |
parent | 603a5025d8b671185c6fcf8672970a4e2881d64d (diff) |
Add missing assertions.
For both QTestLog::addFail() and QTestLog::addIgnoreMessage(), passing
a null message does not make sense and is therefore an error that
should be brought to the developer's attention.
Change-Id: Ib09ad90b70d74f7432c08708db8a70dee008cce4
Reviewed-on: http://codereview.qt.nokia.com/3470
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/testlib/qtestlog.cpp')
-rw-r--r-- | src/testlib/qtestlog.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 855f8fd69c..9990bbdb46 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -251,6 +251,7 @@ void QTestLog::addPass(const char *msg) void QTestLog::addFail(const char *msg, const char *file, int line) { QTEST_ASSERT(QTest::testLogger); + QTEST_ASSERT(msg); QTest::testLogger->addIncident(QAbstractTestLogger::Fail, msg, file, line); } @@ -353,6 +354,8 @@ int QTestLog::verboseLevel() void QTestLog::addIgnoreMessage(QtMsgType type, const char *msg) { + QTEST_ASSERT(msg); + QTest::IgnoreResultList *item = new QTest::IgnoreResultList(type, msg); QTest::IgnoreResultList *list = QTest::ignoreResultList; |