From b8eaedb0dcf0daeae55fd2c2c6e31588c43613bf Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 30 Jan 2014 18:21:18 +0100 Subject: [PATCH] Be stricter about the number of messages when testing profiler service It's better to fail a test than to crash on invalid array access later. Change-Id: Ia3d24218eba80f362908979720657312c8c6cd67 Reviewed-by: Simon Hausmann --- .../debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index a122846220..14a6178b09 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -413,7 +413,7 @@ void tst_QQmlProfilerService::pixmapCacheData() m_client->setTraceState(false); QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time."); - QVERIFY(m_client->traceMessages.count()); + QVERIFY(m_client->traceMessages.count() >= 20); // must start with "StartTrace" QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event); @@ -486,6 +486,7 @@ void tst_QQmlProfilerService::profileOnExit() m_client->setTraceState(true); QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time."); + QVERIFY(m_client->traceMessages.count() >= 2); // must start with "StartTrace" QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event); @@ -504,6 +505,7 @@ void tst_QQmlProfilerService::controlFromJS() m_client->setTraceState(false); QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time."); + QVERIFY(m_client->traceMessages.count() >= 2); // must start with "StartTrace" QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event); @@ -526,6 +528,7 @@ void tst_QQmlProfilerService::signalSourceLocation() m_client->setTraceState(false); QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time."); + QVERIFY(m_client->traceMessages.count() >= 17); // must start with "StartTrace" QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event); QCOMPARE(m_client->traceMessages.first().detailType, (int)QQmlProfilerClient::StartTrace);