diff --git a/src/controller/tests/TestServerCommandDispatch.cpp b/src/controller/tests/TestServerCommandDispatch.cpp index f3ddf882d5d311..f4457c0013ef34 100644 --- a/src/controller/tests/TestServerCommandDispatch.cpp +++ b/src/controller/tests/TestServerCommandDispatch.cpp @@ -148,9 +148,9 @@ class DispatchTestDataModel : public CodegenDataModelProvider } protected: - // Since the current unit tests do not involve any cluster implementations, we override InitDataModel + // Since the current unit tests do not involve any cluster implementations, we override InitDataModelForTesting // to do nothing, thereby preventing calls to the Ember-specific InitDataModelHandler. - void InitDataModel() override {} + void InitDataModelForTesting() override {} }; class TestServerCommandDispatch : public chip::Test::AppContext diff --git a/src/data-model-providers/codegen/CodegenDataModelProvider.cpp b/src/data-model-providers/codegen/CodegenDataModelProvider.cpp index 98d2d4d5edb5a5..6b58f9dee9e129 100644 --- a/src/data-model-providers/codegen/CodegenDataModelProvider.cpp +++ b/src/data-model-providers/codegen/CodegenDataModelProvider.cpp @@ -438,7 +438,7 @@ CHIP_ERROR CodegenDataModelProvider::Startup(DataModel::InteractionModelContext } } - InitDataModel(); + InitDataModelForTesting(); return CHIP_NO_ERROR; } @@ -882,7 +882,7 @@ ConcreteCommandPath CodegenDataModelProvider::NextGeneratedCommand(const Concret return ConcreteCommandPath(before.mEndpointId, before.mClusterId, commandId); } -void CodegenDataModelProvider::InitDataModel() +void CodegenDataModelProvider::InitDataModelForTesting() { // Call the Ember-specific InitDataModelHandler InitDataModelHandler(); diff --git a/src/data-model-providers/codegen/CodegenDataModelProvider.h b/src/data-model-providers/codegen/CodegenDataModelProvider.h index 60b3b3b5ef75e5..e3455d5ce03a1b 100644 --- a/src/data-model-providers/codegen/CodegenDataModelProvider.h +++ b/src/data-model-providers/codegen/CodegenDataModelProvider.h @@ -188,7 +188,10 @@ class CodegenDataModelProvider : public DataModel::Provider void Temporary_ReportAttributeChanged(const AttributePathParams & path) override; protected: - virtual void InitDataModel(); + // Temporary hack for a test: Initializes the data model for testing purposes only. + // This method serves as a placeholder and should NOT be used outside of specific tests. + // It is expected to be removed or replaced with a proper implementation in the future.TODO:(#36837). + virtual void InitDataModelForTesting(); private: // Iteration is often done in a tight loop going through all values.