From 7ee7ef4bf6d06368e96e6c4d776b3535bd7d6c3d Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 5 Dec 2024 13:01:45 -0800 Subject: [PATCH] Mock function for linking --- src/app/tests/TestAclAttribute.cpp | 3 +++ src/app/tests/TestAclEvent.cpp | 3 +++ src/app/tests/TestAttributePathExpandIterator.cpp | 3 +++ src/app/tests/TestCommandInteraction.cpp | 3 +++ src/app/tests/TestInteractionModelEngine.cpp | 5 ++++- src/app/tests/TestReadInteraction.cpp | 3 +++ src/app/tests/TestReportScheduler.cpp | 4 ++++ src/app/tests/TestReportingEngine.cpp | 3 +++ src/app/tests/TestWriteInteraction.cpp | 3 +++ src/app/tests/test-interaction-model-api.h | 2 ++ src/controller/tests/data_model/DataModelFixtures.h | 2 ++ src/controller/tests/data_model/TestCommands.cpp | 3 +++ src/controller/tests/data_model/TestRead.cpp | 3 +++ src/controller/tests/data_model/TestWrite.cpp | 3 +++ 14 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/app/tests/TestAclAttribute.cpp b/src/app/tests/TestAclAttribute.cpp index 0325760959f5de..a79b8b934e78db 100644 --- a/src/app/tests/TestAclAttribute.cpp +++ b/src/app/tests/TestAclAttribute.cpp @@ -41,6 +41,9 @@ #include #include +// Mock function for linking +void InitDataModelHandler() {} + namespace { using namespace chip; using namespace chip::Access; diff --git a/src/app/tests/TestAclEvent.cpp b/src/app/tests/TestAclEvent.cpp index 4607d48d618ccc..e1f30378c35292 100644 --- a/src/app/tests/TestAclEvent.cpp +++ b/src/app/tests/TestAclEvent.cpp @@ -42,6 +42,9 @@ #include #include +// Mock function for linking +void InitDataModelHandler() {} + namespace { using namespace chip; using namespace chip::Access; diff --git a/src/app/tests/TestAttributePathExpandIterator.cpp b/src/app/tests/TestAttributePathExpandIterator.cpp index fb8fa9b2c9621f..b6498ee8ea220e 100644 --- a/src/app/tests/TestAttributePathExpandIterator.cpp +++ b/src/app/tests/TestAttributePathExpandIterator.cpp @@ -36,6 +36,9 @@ using namespace chip; using namespace chip::Test; using namespace chip::app; +// Mock function for linking +void InitDataModelHandler() {} + namespace { using P = app::ConcreteAttributePath; diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index 363b43ccb4d5cf..3705e81b2e0871 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -53,6 +53,9 @@ using namespace chip::Protocols; +// Mock function for linking +void InitDataModelHandler() {} + namespace { void CheckForInvalidAction(chip::Test::MessageCapturer & messageLog) diff --git a/src/app/tests/TestInteractionModelEngine.cpp b/src/app/tests/TestInteractionModelEngine.cpp index 2778d924abee78..ce263096d17149 100644 --- a/src/app/tests/TestInteractionModelEngine.cpp +++ b/src/app/tests/TestInteractionModelEngine.cpp @@ -39,8 +39,11 @@ #if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS #include #include - #endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS + +// Mock function for linking +void InitDataModelHandler() {} + namespace { class NullReadHandlerCallback : public chip::app::ReadHandler::ManagementCallback diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 564320b67f17ce..3eb06d9cdd4c87 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -43,6 +43,9 @@ #include #include +// Mock function for linking +void InitDataModelHandler() {} + namespace { uint8_t gDebugEventBuffer[128]; uint8_t gInfoEventBuffer[128]; diff --git a/src/app/tests/TestReportScheduler.cpp b/src/app/tests/TestReportScheduler.cpp index 49cd2ba07230a9..d43469a222d98b 100644 --- a/src/app/tests/TestReportScheduler.cpp +++ b/src/app/tests/TestReportScheduler.cpp @@ -25,6 +25,10 @@ #include #include #include + +// Mock function for linking +void InitDataModelHandler() {} + namespace { class NullReadHandlerCallback : public chip::app::ReadHandler::ManagementCallback diff --git a/src/app/tests/TestReportingEngine.cpp b/src/app/tests/TestReportingEngine.cpp index dc33e30c042a53..3300507df7546e 100644 --- a/src/app/tests/TestReportingEngine.cpp +++ b/src/app/tests/TestReportingEngine.cpp @@ -43,6 +43,9 @@ #include #include +// Mock function for linking +void InitDataModelHandler() {} + namespace chip { constexpr ClusterId kTestClusterId = 6; diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 6500b5fe0db6a8..c89b6a04ce6f92 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -37,6 +37,9 @@ #include #include +// Mock function for linking +void InitDataModelHandler() {} + namespace { constexpr chip::DataVersion kAcceptedDataVersion = 5; diff --git a/src/app/tests/test-interaction-model-api.h b/src/app/tests/test-interaction-model-api.h index 2120ec4304eb8e..a93c9f6ff984e1 100644 --- a/src/app/tests/test-interaction-model-api.h +++ b/src/app/tests/test-interaction-model-api.h @@ -101,6 +101,8 @@ class TestImCustomDataModel : public DataModel::Provider public: static TestImCustomDataModel & Instance(); + void InitDataModel() override {} + CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, diff --git a/src/controller/tests/data_model/DataModelFixtures.h b/src/controller/tests/data_model/DataModelFixtures.h index 181bdf8fa3bb5c..a27536ef572996 100644 --- a/src/controller/tests/data_model/DataModelFixtures.h +++ b/src/controller/tests/data_model/DataModelFixtures.h @@ -113,6 +113,8 @@ class CustomDataModel : public DataModel::Provider public: static CustomDataModel & Instance(); + void InitDataModel() override {} + CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, diff --git a/src/controller/tests/data_model/TestCommands.cpp b/src/controller/tests/data_model/TestCommands.cpp index c54e458ad81dde..ef7fae7f53c04c 100644 --- a/src/controller/tests/data_model/TestCommands.cpp +++ b/src/controller/tests/data_model/TestCommands.cpp @@ -48,6 +48,9 @@ using namespace chip::app::Clusters; using namespace chip::app::DataModelTests; using namespace chip::Protocols; +// Mock function for linking +void InitDataModelHandler() {} + namespace { const chip::Test::MockNodeConfig & TestMockNodeConfig() diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 136fbc243db340..ceb9710137bc62 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -46,6 +46,9 @@ using namespace chip::app::DataModelTests; using namespace chip::Protocols; using namespace chip::Test; +// Mock function for linking +void InitDataModelHandler() {} + namespace { const MockNodeConfig & TestMockNodeConfig() diff --git a/src/controller/tests/data_model/TestWrite.cpp b/src/controller/tests/data_model/TestWrite.cpp index 218832702b230f..7ab7003f6a72ae 100644 --- a/src/controller/tests/data_model/TestWrite.cpp +++ b/src/controller/tests/data_model/TestWrite.cpp @@ -40,6 +40,9 @@ using namespace chip::app::Clusters::UnitTesting; using namespace chip::app::DataModelTests; using namespace chip::Protocols; +// Mock function for linking +void InitDataModelHandler() {} + namespace { class SingleWriteCallback : public WriteClient::Callback