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