From 27614902862f4e27a0366b3e6edd58c6196b3422 Mon Sep 17 00:00:00 2001 From: Kiel Oleson Date: Mon, 19 Aug 2024 12:01:39 -0700 Subject: [PATCH] add compile-time flag to test ignoring device controller shutdown --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 11fd481b48b2fc..c433fc1c63acf8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -311,8 +311,15 @@ - (BOOL)isRunning return _cppCommissioner != nullptr; } + +//#define TESTING_IGNORE_MTRDEVICECONTROLLER_SHUTDOWN + - (void)shutdown { +#ifdef TESTING_IGNORE_MTRDEVICECONTROLLER_SHUTDOWN + MTR_LOG("****** IGNORING call to shutdown in %@", self); + return; +#else MTR_LOG("%@ shutdown called", self); if (_cppCommissioner == nullptr) { // Already shut down. @@ -321,6 +328,7 @@ - (void)shutdown MTR_LOG("Shutting down %@: %@", NSStringFromClass(self.class), self); [self cleanupAfterStartup]; +#endif // TESTING_IGNORE_MTRDEVICECONTROLLER_SHUTDOWN } // Clean up from a state where startup was called.