From 346ee6df3560b753d36151a06664a43db6bf48e8 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 15 Jun 2014 01:16:57 +0200 Subject: [PATCH] add event params to rules test --- plugins/deviceplugins/mock/devicepluginmock.cpp | 4 ++++ tests/auto/rules/testrules.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/deviceplugins/mock/devicepluginmock.cpp b/plugins/deviceplugins/mock/devicepluginmock.cpp index b6034581..86e0e656 100644 --- a/plugins/deviceplugins/mock/devicepluginmock.cpp +++ b/plugins/deviceplugins/mock/devicepluginmock.cpp @@ -96,6 +96,10 @@ QList DevicePluginMock::supportedDevices() const EventType event2(mockEvent2Id); event2.setName("Mock Event 2"); + QList event2ParamTypes; + ParamType event2Param1Type("mockParamInt", QVariant::Int, 42); + event2ParamTypes.append(event2Param1Type); + event2.setParameters(event2ParamTypes); mockEvents.append(event2); deviceClassMock.setEventTypes(mockEvents); diff --git a/tests/auto/rules/testrules.cpp b/tests/auto/rules/testrules.cpp index 315cda6d..4ea02ec5 100644 --- a/tests/auto/rules/testrules.cpp +++ b/tests/auto/rules/testrules.cpp @@ -60,7 +60,11 @@ void TestRules::addRules_data() QVariantMap validEventDescriptor2; validEventDescriptor2.insert("eventTypeId", mockEvent2Id); validEventDescriptor2.insert("deviceId", m_mockDeviceId); - validEventDescriptor2.insert("paramDescriptors", QVariantList()); + QVariantList params; + QVariantMap param1; + param1.insert("mockParamInt", 3); + params.append(param1); + validEventDescriptor2.insert("paramDescriptors", param1); QVariantList eventDescriptorList; eventDescriptorList.append(validEventDescriptor1);