diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-01 11:06:34 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-15 14:22:00 +0000 |
commit | 87265c7ab8743ece92262cd6b79bbba9dddd1fe1 (patch) | |
tree | cb80c853448df0d451233dd15d3f73cb44d96592 /tests/auto | |
parent | 71645c45b9880d1a349c9a41a73d455f31c9de75 (diff) |
Qml Tooling: Test that trace events arrive in chronological order
The QML profiler trace client should resolve any deviations from
chronological order. Trace receivers should not need to deal with this.
Change-Id: I9bbb387bbb5c0b7da9f2b508d228665af9f27d4c
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 9d76158c5b..1783ded9d6 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -69,6 +69,9 @@ public: int numLoadedEventTypes() const override; void addEventType(const QQmlProfilerEventType &type) override; void addEvent(const QQmlProfilerEvent &event) override; + +private: + qint64 lastTimestamp = -1; }; void QQmlProfilerTestClient::startTrace(qint64 timestamp, const QList<int> &engineIds) @@ -102,6 +105,9 @@ void QQmlProfilerTestClient::addEvent(const QQmlProfilerEvent &event) const QQmlProfilerEventType &type = types[typeIndex]; + QVERIFY(event.timestamp() >= lastTimestamp); + lastTimestamp = event.timestamp(); + switch (type.message()) { case Event: { switch (type.detailType()) { |