From c5a3623647f4e3f066c872b3ae1f87242bbe5838 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 29 Aug 2023 23:27:44 -0400 Subject: [PATCH] Fix darwin test build when ENABLE_OTA_TESTS == 0. (#28959) --- .../Framework/CHIPTests/MTROTAProviderTests.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m index c464e325ca436d..478a42fdf42ab4 100644 --- a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m +++ b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m @@ -41,6 +41,8 @@ #undef ENABLE_REAL_OTA_UPDATE_TESTS #endif +#if ENABLE_OTA_TESTS + static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static const uint16_t kTimeoutWithUpdateInSeconds = 60; @@ -78,15 +80,12 @@ @class MTROTARequestorAppRunner; @interface MTROTAProviderTests : XCTestCase -#if ENABLE_OTA_TESTS - (NSTask *)createTaskForPath:(NSString *)path; - (NSString *)createImageFromRawImage:(NSString *)rawImage withVersion:(NSNumber *)version; - (MTRDevice *)commissionDeviceWithPayload:(NSString *)payloadString nodeID:(NSNumber *)nodeID; - (void)registerRunningRequestor:(MTROTARequestorAppRunner *)requestor; -#endif // ENABLE_OTA_TESTS @end -#if ENABLE_OTA_TESTS static unsigned sAppRunnerIndex = 1; @interface MTROTARequestorAppRunner : NSObject @@ -173,7 +172,6 @@ - (void)terminate } @end -#endif // ENABLE_OTA_TESTS @interface MTROTAProviderTestControllerDelegate : NSObject @property (nonatomic, readonly) XCTestExpectation * expectation; @@ -583,8 +581,6 @@ @implementation MTROTAProviderTests { NSMutableSet * _runningRequestors; } -#if ENABLE_OTA_TESTS - + (void)tearDown { // Global teardown, runs once @@ -1573,6 +1569,14 @@ - (void)test999_TearDown [[self class] shutdownStack]; } -#endif // ENABLE_OTA_TESTS +@end + +#else // ENABLE_OTA_TESTS + +@interface MTROTAProviderTests : XCTestCase +@end +@implementation MTROTAProviderTests @end + +#endif // ENABLE_OTA_TESTS