From feee5ef23ace0b9daf81c6f8fb02f401029d94c2 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 30 Oct 2019 11:45:21 +0100 Subject: [PATCH] Fix tests --- tests/auto/devices/testdevices.cpp | 6 +++--- tests/auto/jsonrpc/testjsonrpc.cpp | 6 +++--- tests/auto/logging/testlogging.cpp | 6 +++--- tests/auto/rules/testrules.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/auto/devices/testdevices.cpp b/tests/auto/devices/testdevices.cpp index caf121a9..760eb89e 100644 --- a/tests/auto/devices/testdevices.cpp +++ b/tests/auto/devices/testdevices.cpp @@ -371,7 +371,7 @@ void TestDevices::addConfiguredDevice() QVariant response = injectAndWait("Devices.AddConfiguredDevice", params); if (!jsonValidation) { - QCOMPARE(response.toMap().value("status").toString(), "error"); + QCOMPARE(response.toMap().value("status").toString(), QString("error")); return; } verifyDeviceError(response, deviceError); @@ -784,7 +784,7 @@ void TestDevices::getStateTypes() QVariantList stateTypes = response.toMap().value("params").toMap().value("stateTypes").toList(); QCOMPARE(stateTypes.count(), resultCount); if (resultCount > 0) { - QCOMPARE(stateTypes.first().toMap().value("id").toUuid(), mockIntStateTypeId); + QCOMPARE(stateTypes.first().toMap().value("id").toUuid().toString(), mockIntStateTypeId.toString()); } } @@ -814,7 +814,7 @@ void TestDevices::getStateType() QVariantMap stateType = response.toMap().value("params").toMap().value("stateType").toMap(); QVERIFY2(!stateType.isEmpty(), "Got no stateType"); - QCOMPARE(stateType.value("id").toUuid(), stateTypeId); + QCOMPARE(stateType.value("id").toUuid().toString(), stateTypeId.toString()); } void TestDevices::getStateValue_data() diff --git a/tests/auto/jsonrpc/testjsonrpc.cpp b/tests/auto/jsonrpc/testjsonrpc.cpp index cfd83ddf..51a666fd 100644 --- a/tests/auto/jsonrpc/testjsonrpc.cpp +++ b/tests/auto/jsonrpc/testjsonrpc.cpp @@ -841,7 +841,7 @@ void TestJSONRPC::ruleActiveChangedNotifications() notificationVariant = checkNotification(clientSpy, "Rules.RuleActiveChanged"); verifyRuleError(response); - QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid(), ruleId); + QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid().toString(), ruleId.toString()); QCOMPARE(notificationVariant.toMap().value("params").toMap().value("active").toBool(), true); spy.clear(); clientSpy.clear(); @@ -859,7 +859,7 @@ void TestJSONRPC::ruleActiveChangedNotifications() notificationVariant = checkNotification(clientSpy, "Rules.RuleActiveChanged"); verifyRuleError(response); - QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid(), ruleId); + QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid().toString(), ruleId.toString()); QCOMPARE(notificationVariant.toMap().value("params").toMap().value("active").toBool(), false); // now remove the rule and check the RuleRemoved notification @@ -872,7 +872,7 @@ void TestJSONRPC::ruleActiveChangedNotifications() checkNotification(clientSpy, "Logging.LogDatabaseUpdated"); verifyRuleError(response); - QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid(), ruleId); + QCOMPARE(notificationVariant.toMap().value("params").toMap().value("ruleId").toUuid().toString(), ruleId.toString()); } void TestJSONRPC::deviceChangedNotifications() diff --git a/tests/auto/logging/testlogging.cpp b/tests/auto/logging/testlogging.cpp index 34aa2c85..abd0753d 100644 --- a/tests/auto/logging/testlogging.cpp +++ b/tests/auto/logging/testlogging.cpp @@ -253,7 +253,7 @@ void TestLogging::eventLogs() if (logEntry.value("deviceId").toUuid() == device->id()) { found = true; // Make sure the notification contains all the stuff we expect - QCOMPARE(logEntry.value("typeId").toUuid(), mockEvent1EventTypeId); + QCOMPARE(logEntry.value("typeId").toUuid().toString(), mockEvent1EventTypeId.toString()); QCOMPARE(logEntry.value("eventType").toString(), enumValueName(Logging::LoggingEventTypeTrigger)); QCOMPARE(logEntry.value("source").toString(), enumValueName(Logging::LoggingSourceEvents)); QCOMPARE(logEntry.value("loggingLevel").toString(), enumValueName(Logging::LoggingLevelInfo)); @@ -323,7 +323,7 @@ void TestLogging::actionLog() if (logEntry.value("deviceId").toUuid() == m_mockDeviceId) { found = true; // Make sure the notification contains all the stuff we expect - QCOMPARE(logEntry.value("typeId").toUuid(), mockWithParamsActionTypeId); + QCOMPARE(logEntry.value("typeId").toUuid().toString(), mockWithParamsActionTypeId.toString()); QCOMPARE(logEntry.value("eventType").toString(), enumValueName(Logging::LoggingEventTypeTrigger)); QCOMPARE(logEntry.value("source").toString(), enumValueName(Logging::LoggingSourceActions)); QCOMPARE(logEntry.value("loggingLevel").toString(), enumValueName(Logging::LoggingLevelInfo)); @@ -382,7 +382,7 @@ void TestLogging::actionLog() if (logEntry.value("deviceId").toUuid() == m_mockDeviceId) { found = true; // Make sure the notification contains all the stuff we expect - QCOMPARE(logEntry.value("typeId").toUuid(), mockFailingActionTypeId); + QCOMPARE(logEntry.value("typeId").toUuid().toString(), mockFailingActionTypeId.toString()); QCOMPARE(logEntry.value("eventType").toString(), enumValueName(Logging::LoggingEventTypeTrigger)); QCOMPARE(logEntry.value("source").toString(), enumValueName(Logging::LoggingSourceActions)); QCOMPARE(logEntry.value("loggingLevel").toString(), enumValueName(Logging::LoggingLevelAlert)); diff --git a/tests/auto/rules/testrules.cpp b/tests/auto/rules/testrules.cpp index 43ec378b..bb3a36f7 100644 --- a/tests/auto/rules/testrules.cpp +++ b/tests/auto/rules/testrules.cpp @@ -1080,7 +1080,7 @@ void TestRules::findRule() response = injectAndWait("Rules.FindRules", params); QCOMPARE(response.toMap().value("params").toMap().value("ruleIds").toList().count(), 1); - QCOMPARE(response.toMap().value("params").toMap().value("ruleIds").toList().first().toUuid(), ruleId); + QCOMPARE(response.toMap().value("params").toMap().value("ruleIds").toList().first().toUuid().toString(), ruleId.toString()); // REMOVE rule QVariantMap removeParams;