From e44d3416feb64ad282b990ca8d024911540e23c4 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 29 Mar 2024 14:31:31 +0900 Subject: [PATCH] fixed errors by using the same name for member variables and parameters Change-Id: Ib36e16df41fd1025674c862673ae94dad4442f3a --- src/common/mmi-plugin-module-event.h | 4 +- src/common/mmi-workflow-event.h | 4 +- src/common/mmi-workflow-output-event.h | 4 +- src/mmi-cli/mmi-cli-node-tester.cpp | 4 +- src/mmi-manager/mmi-node-instance.h | 2 +- src/mmi-manager/mmi-port-instance.h | 2 +- .../mmi-workflow-instance-tests.cpp | 72 +++++++++---------- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/common/mmi-plugin-module-event.h b/src/common/mmi-plugin-module-event.h index 5d784c5..a5edd9d 100644 --- a/src/common/mmi-plugin-module-event.h +++ b/src/common/mmi-plugin-module-event.h @@ -31,10 +31,10 @@ enum class PLUGIN_MODULE_EVENT_TYPE { }; struct PluginModuleEvent { - PluginModuleEvent(PLUGIN_MODULE_EVENT_TYPE type) : type(type) {} + PluginModuleEvent(PLUGIN_MODULE_EVENT_TYPE type) : type_(type) {} virtual ~PluginModuleEvent() = default; - PLUGIN_MODULE_EVENT_TYPE type; + PLUGIN_MODULE_EVENT_TYPE type_; }; struct PluginModuleEventOutputGenerated : public PluginModuleEvent { diff --git a/src/common/mmi-workflow-event.h b/src/common/mmi-workflow-event.h index e9d6a55..7f8ed6c 100644 --- a/src/common/mmi-workflow-event.h +++ b/src/common/mmi-workflow-event.h @@ -26,10 +26,10 @@ enum class WORKFLOW_EVENT_TYPE { }; struct WorkflowEvent { - WorkflowEvent(WORKFLOW_EVENT_TYPE type) : type(type) {} + WorkflowEvent(WORKFLOW_EVENT_TYPE type) : type_(type) {} virtual ~WorkflowEvent() = default; - WORKFLOW_EVENT_TYPE type; + WORKFLOW_EVENT_TYPE type_; }; struct WorkflowEventWorkflowCreated : public WorkflowEvent { diff --git a/src/common/mmi-workflow-output-event.h b/src/common/mmi-workflow-output-event.h index af09d14..774f10f 100644 --- a/src/common/mmi-workflow-output-event.h +++ b/src/common/mmi-workflow-output-event.h @@ -29,10 +29,10 @@ enum class WORKFLOW_OUTPUT_EVENT_TYPE { }; struct WorkflowOutputEvent { - WorkflowOutputEvent(WORKFLOW_OUTPUT_EVENT_TYPE type) : type(type) {} + WorkflowOutputEvent(WORKFLOW_OUTPUT_EVENT_TYPE type) : type_(type) {} virtual ~WorkflowOutputEvent() = default; - WORKFLOW_OUTPUT_EVENT_TYPE type; + WORKFLOW_OUTPUT_EVENT_TYPE type_; }; struct WorkflowOutputEventOutputGenerated : public WorkflowOutputEvent { diff --git a/src/mmi-cli/mmi-cli-node-tester.cpp b/src/mmi-cli/mmi-cli-node-tester.cpp index 4f86290..c0d659e 100644 --- a/src/mmi-cli/mmi-cli-node-tester.cpp +++ b/src/mmi-cli/mmi-cli-node-tester.cpp @@ -26,14 +26,14 @@ struct PortInstance std::string m_name; mmi_port_type_e m_port_type; mmi_data_type_e m_data_type; - mmi_port_callbacks m_callbacks{nullptr,}; + mmi_port_callbacks m_callbacks{{nullptr}, {nullptr}}; }; struct NodeInstance { mmi_node_type_e m_node_type; - mmi_node_callbacks m_callbacks{nullptr,}; + mmi_node_callbacks m_callbacks{{nullptr}, {nullptr}, {nullptr}, {nullptr}, {nullptr}, {nullptr}}; std::vector m_ports; }; diff --git a/src/mmi-manager/mmi-node-instance.h b/src/mmi-manager/mmi-node-instance.h index 2f56da1..6e4ee01 100644 --- a/src/mmi-manager/mmi-node-instance.h +++ b/src/mmi-manager/mmi-node-instance.h @@ -80,7 +80,7 @@ protected: mmi_node_type_e m_node_type; mmi_node_sub_type_e m_node_sub_type; - mmi_node_callbacks m_callbacks{nullptr,}; + mmi_node_callbacks m_callbacks{{nullptr}, {nullptr}, {nullptr}, {nullptr}, {nullptr}, {nullptr}}; bool m_suspended{false}; bool m_activated{false}; diff --git a/src/mmi-manager/mmi-port-instance.h b/src/mmi-manager/mmi-port-instance.h index e508a6b..f270b08 100644 --- a/src/mmi-manager/mmi-port-instance.h +++ b/src/mmi-manager/mmi-port-instance.h @@ -51,7 +51,7 @@ public: void on_output_data_received(mmi_data_h data); private: std::string m_name; - mmi_port_callbacks m_callbacks{nullptr,}; + mmi_port_callbacks m_callbacks{{nullptr}, {nullptr}}; std::vector> m_linked_port_instances; std::vector> m_data_gateways; diff --git a/tests/mmi-manager/workflow-instance/mmi-workflow-instance-tests.cpp b/tests/mmi-manager/workflow-instance/mmi-workflow-instance-tests.cpp index 63bc62e..04e3280 100644 --- a/tests/mmi-manager/workflow-instance/mmi-workflow-instance-tests.cpp +++ b/tests/mmi-manager/workflow-instance/mmi-workflow-instance-tests.cpp @@ -90,32 +90,32 @@ class NodeAttributeSetHistoryItem { public: NodeAttributeSetHistoryItem() {} ~NodeAttributeSetHistoryItem() { - if (attribute) { - mmi_attribute_destroy(attribute); + if (m_attribute) { + mmi_attribute_destroy(m_attribute); } } void reset() { - type = MMI_NODE_TYPE_NONE; - sub_type = std::monostate(); - if (attribute) { - mmi_attribute_destroy(attribute); - attribute = nullptr; + m_type = MMI_NODE_TYPE_NONE; + m_sub_type = std::monostate(); + if (m_attribute) { + mmi_attribute_destroy(m_attribute); + m_attribute = nullptr; } } void set_item( mmi_node_type_e type, mmi_node_sub_type_e sub_type, mmi_attribute_h attribute) { - this->type = type; - this->sub_type = sub_type; - if (this->attribute) { - mmi_attribute_destroy(this->attribute); + m_type = type; + m_sub_type = sub_type; + if (m_attribute) { + mmi_attribute_destroy(m_attribute); } - mmi_attribute_clone(attribute, &(this->attribute)); + mmi_attribute_clone(attribute, &(m_attribute)); } - mmi_node_type_e type{MMI_NODE_TYPE_NONE}; - mmi_node_sub_type_e sub_type{std::monostate()}; - mmi_attribute_h attribute{nullptr}; + mmi_node_type_e m_type{MMI_NODE_TYPE_NONE}; + mmi_node_sub_type_e m_sub_type{std::monostate()}; + mmi_attribute_h m_attribute{nullptr}; }; static NodeAttributeSetHistoryItem g_last_node_attribute_set_history; @@ -238,14 +238,14 @@ TEST_F(WorkflowInstanceTest, WorkflowAttributePassedToNodeAttribute_p) { mmi_attribute_h attribute = nullptr; mmi_attribute_create(value, "COMMAND", &attribute); EXPECT_TRUE(workflow_instance->set_attribute(attribute)); - EXPECT_EQ(g_last_node_attribute_set_history.type, MMI_NODE_TYPE_PROCESSOR); - EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.sub_type)); - EXPECT_EQ(std::get(g_last_node_attribute_set_history.sub_type), + EXPECT_EQ(g_last_node_attribute_set_history.m_type, MMI_NODE_TYPE_PROCESSOR); + EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.m_sub_type)); + EXPECT_EQ(std::get(g_last_node_attribute_set_history.m_sub_type), MMI_NODE_PROCESSOR_TYPE_ASR); - EXPECT_TRUE(g_last_node_attribute_set_history.attribute != nullptr); + EXPECT_TRUE(g_last_node_attribute_set_history.m_attribute != nullptr); mmi_primitive_value_h history_item_value; - mmi_attribute_get_value(g_last_node_attribute_set_history.attribute, &history_item_value); + mmi_attribute_get_value(g_last_node_attribute_set_history.m_attribute, &history_item_value); mmi_primitive_value_type_e type; mmi_primitive_value_get_type(history_item_value, &type); @@ -280,14 +280,14 @@ TEST_F(WorkflowInstanceTest, WorkflowAttributePassedProperlyAfter2ndInitializati mmi_attribute_h attribute = nullptr; mmi_attribute_create(value, "COMMAND", &attribute); EXPECT_TRUE(workflow_instance->set_attribute(attribute)); - EXPECT_EQ(g_last_node_attribute_set_history.type, MMI_NODE_TYPE_PROCESSOR); - EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.sub_type)); - EXPECT_EQ(std::get(g_last_node_attribute_set_history.sub_type), + EXPECT_EQ(g_last_node_attribute_set_history.m_type, MMI_NODE_TYPE_PROCESSOR); + EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.m_sub_type)); + EXPECT_EQ(std::get(g_last_node_attribute_set_history.m_sub_type), MMI_NODE_PROCESSOR_TYPE_ASR); - EXPECT_TRUE(g_last_node_attribute_set_history.attribute != nullptr); + EXPECT_TRUE(g_last_node_attribute_set_history.m_attribute != nullptr); mmi_primitive_value_h history_item_value; - mmi_attribute_get_value(g_last_node_attribute_set_history.attribute, &history_item_value); + mmi_attribute_get_value(g_last_node_attribute_set_history.m_attribute, &history_item_value); mmi_primitive_value_type_e type; mmi_primitive_value_get_type(history_item_value, &type); @@ -309,14 +309,14 @@ TEST_F(WorkflowInstanceTest, WorkflowDefaultAttributePassedToNodeAttribute_p) { EXPECT_NE(workflow_instance, nullptr); workflow_instance->initialize(); - EXPECT_EQ(g_last_node_attribute_set_history.type, MMI_NODE_TYPE_PROCESSOR); - EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.sub_type)); - EXPECT_EQ(std::get(g_last_node_attribute_set_history.sub_type), + EXPECT_EQ(g_last_node_attribute_set_history.m_type, MMI_NODE_TYPE_PROCESSOR); + EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.m_sub_type)); + EXPECT_EQ(std::get(g_last_node_attribute_set_history.m_sub_type), MMI_NODE_PROCESSOR_TYPE_ASR); - EXPECT_TRUE(g_last_node_attribute_set_history.attribute != nullptr); + EXPECT_TRUE(g_last_node_attribute_set_history.m_attribute != nullptr); mmi_primitive_value_h history_item_value; - mmi_attribute_get_value(g_last_node_attribute_set_history.attribute, &history_item_value); + mmi_attribute_get_value(g_last_node_attribute_set_history.m_attribute, &history_item_value); mmi_primitive_value_type_e type; mmi_primitive_value_get_type(history_item_value, &type); @@ -341,19 +341,19 @@ TEST_F(WorkflowInstanceTest, WorkflowDefaultAttributePassedProperlyAfter2ndIniti EXPECT_NE(workflow_instance, nullptr); workflow_instance->initialize(); - EXPECT_EQ(g_last_node_attribute_set_history.type, MMI_NODE_TYPE_PROCESSOR); - EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.sub_type)); - EXPECT_EQ(std::get(g_last_node_attribute_set_history.sub_type), + EXPECT_EQ(g_last_node_attribute_set_history.m_type, MMI_NODE_TYPE_PROCESSOR); + EXPECT_TRUE(std::holds_alternative(g_last_node_attribute_set_history.m_sub_type)); + EXPECT_EQ(std::get(g_last_node_attribute_set_history.m_sub_type), MMI_NODE_PROCESSOR_TYPE_ASR); - EXPECT_TRUE(g_last_node_attribute_set_history.attribute != nullptr); + EXPECT_TRUE(g_last_node_attribute_set_history.m_attribute != nullptr); char *name = nullptr; - mmi_attribute_get_name(g_last_node_attribute_set_history.attribute, &name); + mmi_attribute_get_name(g_last_node_attribute_set_history.m_attribute, &name); EXPECT_STREQ(name, "CANDIDATE"); free(name); mmi_primitive_value_h history_item_value; - mmi_attribute_get_value(g_last_node_attribute_set_history.attribute, &history_item_value); + mmi_attribute_get_value(g_last_node_attribute_set_history.m_attribute, &history_item_value); mmi_primitive_value_type_e type; mmi_primitive_value_get_type(history_item_value, &type); -- 2.34.1