Skip to content

Commit

Permalink
add compile-time flag to test ignoring device controller shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
kiel-apple committed Aug 19, 2024
1 parent 465cd3f commit 2761490
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 2761490

Please sign in to comment.