diff --git a/src/platform/fake/BUILD.gn b/src/platform/fake/BUILD.gn index 93d4425e604f66..9c4d008f11300f 100644 --- a/src/platform/fake/BUILD.gn +++ b/src/platform/fake/BUILD.gn @@ -21,6 +21,7 @@ assert(chip_device_platform == "fake") static_library("fake") { sources = [ "CHIPDevicePlatformEvent.h", + "ConfigurationManagerImpl.cpp", "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", diff --git a/src/platform/fake/ConfigurationManagerImpl.cpp b/src/platform/fake/ConfigurationManagerImpl.cpp new file mode 100644 index 00000000000000..abfaecbbe6dd44 --- /dev/null +++ b/src/platform/fake/ConfigurationManagerImpl.cpp @@ -0,0 +1,30 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * limitations under the License. + */ + +#include + +namespace chip { +namespace DeviceLayer { + +ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance() +{ + static ConfigurationManagerImpl sInstance; + return sInstance; +} + +ConfigurationManager & ConfigurationMgr() +{ + return ConfigurationManagerImpl::GetDefaultInstance(); +} + +void SetConfigurationMgr(ConfigurationManager * configurationManager) {} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index cee37e551605a1..4d4cce0a0b9397 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -29,6 +29,9 @@ class ConfigurationManagerImpl : public ConfigurationManager { public: virtual ~ConfigurationManagerImpl() = default; + // NOTE: This method is required by the tests. + // This returns an instance of this class. + static ConfigurationManagerImpl & GetDefaultInstance(); private: CHIP_ERROR Init() override { return CHIP_NO_ERROR; } @@ -105,13 +108,5 @@ class ConfigurationManagerImpl : public ConfigurationManager // NOTE: Other public interface methods are implemented by GenericConfigurationManagerImpl<>. }; -ConfigurationManager & ConfigurationMgr() -{ - static ConfigurationManagerImpl sInstance; - return sInstance; -} - -void SetConfigurationMgr(ConfigurationManagerImpl * configurationManager) {} - } // namespace DeviceLayer } // namespace chip