File tree 2 files changed +4
-6
lines changed
src/darwin/Framework/CHIPTests
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ @implementation MTRPerControllerStorageTests {
187
187
188
188
- (void )setUp
189
189
{
190
+ // Set detectLeaks true first, in case our superclass wants to do something
191
+ // in setUp when it's set.
192
+ self.detectLeaks = YES ;
193
+
190
194
// Per-test setup, runs before each test.
191
195
[super setUp ];
192
196
[self setContinueAfterFailure: NO ];
@@ -353,8 +357,6 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo
353
357
354
358
- (void )test001_BasicControllerStartup
355
359
{
356
- self.detectLeaks = YES ;
357
-
358
360
__auto_type * factory = [MTRDeviceControllerFactory sharedInstance ];
359
361
XCTAssertNotNil (factory);
360
362
@@ -403,8 +405,6 @@ - (void)test001_BasicControllerStartup
403
405
404
406
- (void )test002_TryStartingTwoControllersWithSameNodeID
405
407
{
406
- self.detectLeaks = YES ;
407
-
408
408
__auto_type * rootKeys = [[MTRTestKeys alloc ] init ];
409
409
XCTAssertNotNil (rootKeys);
410
410
Original file line number Diff line number Diff line change @@ -27,15 +27,13 @@ @implementation MTRTestCase
27
27
*/
28
28
- (void )tearDown
29
29
{
30
- #if 0
31
30
#if defined(ENABLE_LEAK_DETECTION) && ENABLE_LEAK_DETECTION
32
31
if (_detectLeaks) {
33
32
int pid = getpid ();
34
33
__auto_type * cmd = [NSString stringWithFormat: @" leaks %d " , pid];
35
34
int ret = system (cmd.UTF8String );
36
35
XCTAssertEqual (ret, 0 , " LEAKS DETECTED" );
37
36
}
38
- #endif
39
37
#endif
40
38
41
39
[super tearDown ];
You can’t perform that action at this time.
0 commit comments