-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.7.0
-
None
-
aaaa7a063 (dev), 28bcc7ca9 (6.10), 2cbea6584 (6.9)
http://doc.qt.io/qt-5/qml-qttest-signalspy.html#clear-method says:
Clears count to 0, resets valid to false and clears the signalArguments to empty.
However, the following code works fine:
import QtQuick 2.0 import QtTest 1.0 TestCase { name: "Untitled" Item { id: item signal test } SignalSpy { id: spy } function test_tryVerify() { spy.target = item; spy.signalName = "test"; item.test(); compare(spy.count, 1) spy.clear(); compare(spy.count, 0); compare(spy.signalArguments.length, 0); verify(spy.valid); print(spy.target, spy.signalName) item.test(); compare(spy.count, 1) } }