From 133894813fd6b958bf919ff9cf5a4e52272ee10f Mon Sep 17 00:00:00 2001 From: William Hicklin Date: Wed, 2 Aug 2023 10:01:25 +0100 Subject: [PATCH] Renamed TestOperationlStateDelegate to TestOperationalStateClusterObjects. --- .../operational-state-cluster-objects.h | 8 +++++--- src/app/tests/BUILD.gn | 4 ++-- ...elegate.cpp => TestOperationalStateClusterObjects.cpp} | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) rename src/app/tests/{TestOperationalStateDelegate.cpp => TestOperationalStateClusterObjects.cpp} (99%) diff --git a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h index d7159791964915..31fd5f9abe9992 100644 --- a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h +++ b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h @@ -22,6 +22,8 @@ #include #include +#include + namespace chip { namespace app { namespace Clusters { @@ -39,7 +41,7 @@ struct GenericOperationalState : public app::Clusters::detail::Structs::Operatio { GenericOperationalState(uint8_t state = to_underlying(OperationalStateEnum::kStopped), Optional label = NullOptional) { - Set(state, label); + Set(state, std::move(label)); } GenericOperationalState(const GenericOperationalState & op) { *this = op; } @@ -85,7 +87,7 @@ struct GenericOperationalError : public app::Clusters::detail::Structs::ErrorSta GenericOperationalError(uint8_t state, Optional label = NullOptional, Optional details = NullOptional) { - Set(state, label, details); + Set(state, std::move(label), std::move(details)); } GenericOperationalError(const GenericOperationalError & error) { *this = error; } @@ -148,7 +150,7 @@ struct GenericOperationalError : public app::Clusters::detail::Structs::ErrorSta */ struct GenericOperationalPhase { - GenericOperationalPhase(app::DataModel::Nullable name) { Set(name); } + GenericOperationalPhase(app::DataModel::Nullable name) { Set(std::move(name)); } GenericOperationalPhase(const GenericOperationalPhase & ph) { *this = ph; } diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index e62fc9d9fa22b8..b390cc00f5350d 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -98,7 +98,7 @@ source_set("scenes-table-test-srcs") { source_set("operational-state-test-srcs") { sources = [ - "${chip_root}/src/app/clusters/operational-state-server/operational-state-server.h", + "${chip_root}/src/app/clusters/operational-state-server/operational-state-cluster-objects.h", ] public_deps = [ @@ -133,7 +133,7 @@ chip_test_suite("tests") { "TestInteractionModelEngine.cpp", "TestMessageDef.cpp", "TestNumericAttributeTraits.cpp", - "TestOperationalStateDelegate.cpp", + "TestOperationalStateClusterObjects.cpp", "TestPendingNotificationMap.cpp", "TestReadInteraction.cpp", "TestReportingEngine.cpp", diff --git a/src/app/tests/TestOperationalStateDelegate.cpp b/src/app/tests/TestOperationalStateClusterObjects.cpp similarity index 99% rename from src/app/tests/TestOperationalStateDelegate.cpp rename to src/app/tests/TestOperationalStateClusterObjects.cpp index 84c39838bd6e33..493d02f8ae1935 100644 --- a/src/app/tests/TestOperationalStateDelegate.cpp +++ b/src/app/tests/TestOperationalStateClusterObjects.cpp @@ -579,13 +579,13 @@ int TestTearDown(void * inContext) } // namespace -int TestOperationalStateDelegate() +int TestOperationalStateClusterObjects() { - nlTestSuite theSuite = { "Test Operational State delegate tests", &sTests[0], TestSetup, TestTearDown }; + nlTestSuite theSuite = { "Test Operational State Cluster Objects tests", &sTests[0], TestSetup, TestTearDown }; // Run test suit againt one context. nlTestRunner(&theSuite, nullptr); return nlTestRunnerStats(&theSuite); } -CHIP_REGISTER_TEST_SUITE(TestOperationalStateDelegate) +CHIP_REGISTER_TEST_SUITE(TestOperationalStateClusterObjects)