fix event tests
This commit is contained in:
parent
a4cffced68
commit
99cf429335
@ -67,12 +67,14 @@ void TestEvents::triggerEvent()
|
|||||||
|
|
||||||
// Lets wait for the notification
|
// Lets wait for the notification
|
||||||
spy.wait();
|
spy.wait();
|
||||||
QCOMPARE(spy.count(), 1);
|
QVERIFY(spy.count() > 0);
|
||||||
|
for (int i = 0; i < spy.count(); i++ ){
|
||||||
// Make sure the event contains all the stuff we expect
|
Event event = spy.at(i).at(0).value<Event>();
|
||||||
Event event = spy.at(0).at(0).value<Event>();
|
if (event.deviceId() == device->id()) {
|
||||||
QCOMPARE(event.eventTypeId(), mockEvent1Id);
|
// Make sure the event contains all the stuff we expect
|
||||||
QCOMPARE(event.deviceId(), device->id());
|
QCOMPARE(event.eventTypeId(), mockEvent1Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestEvents::triggerStateChangeEvent()
|
void TestEvents::triggerStateChangeEvent()
|
||||||
@ -94,13 +96,15 @@ void TestEvents::triggerStateChangeEvent()
|
|||||||
|
|
||||||
// Lets wait for the notification
|
// Lets wait for the notification
|
||||||
spy.wait();
|
spy.wait();
|
||||||
QCOMPARE(spy.count(), 1);
|
QVERIFY(spy.count() > 0);
|
||||||
|
for (int i = 0; i < spy.count(); i++ ){
|
||||||
// Make sure the event contains all the stuff we expect
|
Event event = spy.at(i).at(0).value<Event>();
|
||||||
Event event = spy.at(0).at(0).value<Event>();
|
if (event.deviceId() == device->id()) {
|
||||||
QCOMPARE(event.eventTypeId().toString(), mockIntStateId.toString());
|
// Make sure the event contains all the stuff we expect
|
||||||
QCOMPARE(event.deviceId(), device->id());
|
QCOMPARE(event.eventTypeId().toString(), mockIntStateId.toString());
|
||||||
QCOMPARE(event.param("value").value().toInt(), 11);
|
QCOMPARE(event.param("value").value().toInt(), 11);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestEvents::params()
|
void TestEvents::params()
|
||||||
|
|||||||
Reference in New Issue
Block a user