aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2012-01-31 17:05:01 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-02 10:17:03 +0100
commit76ed62fb836ea3e3e5236f8ed567f7ac64dd63fc (patch)
treebe31fe04e21216d93f0190584154245b53aab3de /tests/auto/declarative
parent897ab4f34156b928ff5b59965cfb8d708db232d7 (diff)
Debugger Test Case: Fix failures
Fix test cases related to verifying debug messages. Task-number: QTBUG-23977 Change-Id: Ieab6a5975bff1ef7fcee3eb1befe0c544a63ea1f Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
index bcd76e0ba9..8b38d26127 100644
--- a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
+++ b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
@@ -86,6 +86,11 @@ struct LogEntry {
QString toString() const { return QString::number(type) + ": " + message; }
};
+bool operator==(const LogEntry &t1, const LogEntry &t2)
+{
+ return t1.type == t2.type && t1.message == t2.message;
+}
+
class QDeclarativeDebugMsgClient : public QDeclarativeDebugClient
{
Q_OBJECT
@@ -206,12 +211,10 @@ void tst_QDebugMessageService::retrieveDebugOutput()
&& (maxTries-- > 0))
QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput())));
- QCOMPARE(m_client->logBuffer.size(), 2);
+ QVERIFY(m_client->logBuffer.size() >= 2);
- QCOMPARE(m_client->logBuffer.at(0).toString(),
- LogEntry(QtDebugMsg, QLatin1String("console.log")).toString());
- QCOMPARE(m_client->logBuffer.at(1).toString(),
- LogEntry(QtDebugMsg, QLatin1String("console.count: 1")).toString());
+ QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, QLatin1String("console.log"))));
+ QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, QLatin1String("console.count: 1"))));
}
void tst_QDebugMessageService::retrieveDebugOutputExtended()
@@ -223,7 +226,7 @@ void tst_QDebugMessageService::retrieveDebugOutputExtended()
&& (maxTries-- > 0))
QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput()));
- QCOMPARE(m_client->logBuffer.size(), 2);
+ QVERIFY(m_client->logBuffer.size() >= 2);
const QString path =
QUrl::fromLocalFile(QDeclarativeDataTest::instance()->testFile(QMLFILE)).toString();
@@ -231,10 +234,8 @@ void tst_QDebugMessageService::retrieveDebugOutputExtended()
QString logMsg = QString::fromLatin1("console.log (%1:%2)").arg(path).arg(48);
QString countMsg = QString::fromLatin1("console.count: 1 (%1:%2)").arg(path).arg(49);
- QCOMPARE(m_client->logBuffer.at(0).toString(),
- LogEntry(QtDebugMsg, logMsg).toString());
- QCOMPARE(m_client->logBuffer.at(1).toString(),
- LogEntry(QtDebugMsg, countMsg).toString());
+ QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, logMsg)));
+ QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, countMsg)));
}
QTEST_MAIN(tst_QDebugMessageService)