From 1766cec6b6c6ec1b377bea2ae5dc3ee940e4fe10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 10 Oct 2017 11:08:43 +0200 Subject: [PATCH] clean up debug outputs --- libguh/plugin/deviceplugin.cpp | 26 +++++++++++++------------- tests/auto/auto.pro | 1 + tests/auto/rules/testrules.cpp | 6 +++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/libguh/plugin/deviceplugin.cpp b/libguh/plugin/deviceplugin.cpp index ff6531e9..03471f18 100644 --- a/libguh/plugin/deviceplugin.cpp +++ b/libguh/plugin/deviceplugin.cpp @@ -492,24 +492,24 @@ QList DevicePlugin::supportedDevices() const StateType stateType = stateTypes.findByName(stateVariant.toMap().value("name").toString()); QVariantMap stateMap = stateVariant.toMap(); if (stateType.id().isNull()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement state" << stateMap.value("name").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement state" << stateMap.value("name").toString(); valid = false; continue; } if (QVariant::nameToType(stateMap.value("type").toByteArray().data()) != stateType.type()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching type" << stateMap.value("type").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching type" << stateMap.value("type").toString(); valid = false; continue; } if (stateMap.contains("minimumValue")) { if (stateMap.value("minimumValue").toString() == "any") { if (stateType.minValue().isNull()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no minimum value defined."; + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no minimum value defined."; valid = false; continue; } } else if (stateMap.value("minimumValue") != stateType.minValue()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching minimum value:" << stateMap.value("minimumValue") << "!=" << stateType.minValue(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching minimum value:" << stateMap.value("minimumValue") << "!=" << stateType.minValue(); valid = false; continue; } @@ -517,23 +517,23 @@ QList DevicePlugin::supportedDevices() const if (stateMap.contains("maximumValue")) { if (stateMap.value("maximumValue").toString() == "any") { if (stateType.maxValue().isNull()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no maximum value defined."; + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no maximum value defined."; valid = false; continue; } } else if (stateMap.value("maximumValue") != stateType.maxValue()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching maximum value:" << stateMap.value("maximumValue") << "!=" << stateType.minValue(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching maximum value:" << stateMap.value("maximumValue") << "!=" << stateType.minValue(); valid = false; continue; } } if (stateMap.contains("allowedValues") && stateMap.value("allowedValues") != stateType.possibleValues()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching allowed values" << stateMap.value("allowedValues") << "!=" << stateType.possibleValues(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching allowed values" << stateMap.value("allowedValues") << "!=" << stateType.possibleValues(); valid = false; continue; } if (stateMap.contains("writable") && stateMap.value("writable").toBool() && actionTypes.findById(ActionTypeId(stateType.id().toString())).id().isNull()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "is not writable while it should be"; + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "is not writable while it should be"; valid = false; continue; } @@ -543,14 +543,14 @@ QList DevicePlugin::supportedDevices() const QVariantMap actionMap = actionVariant.toMap(); ActionType actionType = actionTypes.findByName(actionMap.value("name").toString()); if (actionType.id().isNull()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action" << actionMap.value("name").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action" << actionMap.value("name").toString(); valid = false; } QVariantList params = actionMap.value("params").toList(); foreach (const QVariant ¶mVariant, params) { ParamType paramType = actionType.paramTypes().findByName(paramVariant.toMap().value("name").toString()); if (!paramType.isValid()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << actionMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << actionMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString(); valid = false; } else { if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) { @@ -565,18 +565,18 @@ QList DevicePlugin::supportedDevices() const QVariantMap eventMap = eventVariant.toMap(); EventType eventType = eventTypes.findByName(eventMap.value("name").toString()); if (eventType.isValid()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement event" << eventMap.value("name").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement event" << eventMap.value("name").toString(); valid = false; } QVariantList params = eventMap.value("params").toList(); foreach (const QVariant ¶mVariant, params) { ParamType paramType = eventType.paramTypes().findByName(paramVariant.toMap().value("name").toString()); if (!paramType.isValid()) { - //qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << eventMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString(); + qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << eventMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString(); valid = false; } else { if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) { - //qCWarning(dcDeviceManager()) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but param" << paramType.name() << "is of wrong type:" << QVariant::typeToName(paramType.type()) << "expected:" << paramVariant.toMap().value("type").toString(); + qCWarning(dcDeviceManager()) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but param" << paramType.name() << "is of wrong type:" << QVariant::typeToName(paramType.type()) << "expected:" << paramVariant.toMap().value("type").toString(); valid = false; } } diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 23e92a51..3d4556f4 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -20,3 +20,4 @@ SUBDIRS = versioning \ #coap \ # temporary removed until fixed configurations \ timemanager \ + settings \ diff --git a/tests/auto/rules/testrules.cpp b/tests/auto/rules/testrules.cpp index 1faa21da..649fa6ca 100644 --- a/tests/auto/rules/testrules.cpp +++ b/tests/auto/rules/testrules.cpp @@ -61,9 +61,6 @@ private slots: void emptyRule(); void getInvalidRule(); - void testChildEvaluator_data(); - void testChildEvaluator(); - void addRemoveRules_data(); void addRemoveRules(); @@ -87,6 +84,9 @@ private slots: void testStateEvaluator2_data(); void testStateEvaluator2(); + void testChildEvaluator_data(); + void testChildEvaluator(); + void testStateChange(); void enableDisableRule();