@@ -419,6 +419,7 @@ - (void)readAttributeCacheWithController:(id _Nullable)controller
419
419
static const uint16_t kTimeoutInSeconds = 3 ;
420
420
static const uint64_t kDeviceId = 0x12344321 ;
421
421
static NSString * kOnboardingPayload = @" MT:Y.K90SO527JA0648G00" ;
422
+ static NSString * _Nullable sLogContentFilePath ;
422
423
static NSString * kSimpleLogContent = @" This is a simple log\n " ;
423
424
static const uint16_t kLocalPort = 5541 ;
424
425
@@ -516,14 +517,14 @@ + (void)setUp
516
517
[super setUp ];
517
518
518
519
__auto_type * uniqueName = [[NSUUID UUID ] UUIDString ];
519
- __auto_type * uniquePath = [NSTemporaryDirectory () stringByAppendingPathComponent: uniqueName];
520
- [[NSFileManager defaultManager ] createFileAtPath: uniquePath
520
+ sLogContentFilePath = [NSTemporaryDirectory () stringByAppendingPathComponent: uniqueName];
521
+ [[NSFileManager defaultManager ] createFileAtPath: sLogContentFilePath
521
522
contents: [kSimpleLogContent dataUsingEncoding: NSUTF8StringEncoding]
522
523
attributes: nil ];
523
524
BOOL started = [self startAppWithName: @" all-clusters"
524
525
arguments: @[
525
526
@" --end_user_support_log" ,
526
- uniquePath ,
527
+ sLogContentFilePath ,
527
528
]
528
529
payload: kOnboardingPayload ];
529
530
XCTAssertTrue (started);
@@ -532,6 +533,10 @@ + (void)setUp
532
533
+ (void )tearDown
533
534
{
534
535
// Global teardown, runs once
536
+ if (sLogContentFilePath != nil ) {
537
+ [[NSFileManager defaultManager ] removeItemAtPath: sLogContentFilePath error: nil ];
538
+ }
539
+
535
540
[self shutdownStack ];
536
541
[super tearDown ];
537
542
}
0 commit comments