From 66736b4b99d9a16c7ef1a19f0f967df8fc965e29 Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Tue, 2 Jul 2024 11:49:02 -0700 Subject: [PATCH] Add nullability annotations to the objective-c header files --- Sources/Quick/Async/AsyncSpec.swift | 4 ++-- Sources/QuickObjCRuntime/include/QuickSpecBase.h | 4 ++++ Sources/QuickObjectiveC/Configuration/QuickConfiguration.h | 4 ++++ Sources/QuickObjectiveC/DSL/QCKDSL.h | 7 ++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Sources/Quick/Async/AsyncSpec.swift b/Sources/Quick/Async/AsyncSpec.swift index 1f6139975..ec2a94598 100644 --- a/Sources/Quick/Async/AsyncSpec.swift +++ b/Sources/Quick/Async/AsyncSpec.swift @@ -65,13 +65,13 @@ open class AsyncSpec: AsyncSpecBase { } #if SWIFT_PACKAGE - open override class func _qck_testMethodSelectors() -> [String]! { + open override class func _qck_testMethodSelectors() -> [String] { darwinXCTestMethodSelectors() } #endif // SWIFT_PACKAGE @objc - internal class func darwinXCTestMethodSelectors() -> [String]! { + internal class func darwinXCTestMethodSelectors() -> [String] { let examples = AsyncWorld.sharedWorld.examples(forSpecClass: self) var selectorNames = Set() diff --git a/Sources/QuickObjCRuntime/include/QuickSpecBase.h b/Sources/QuickObjCRuntime/include/QuickSpecBase.h index 2ee00e73d..73344dc1a 100644 --- a/Sources/QuickObjCRuntime/include/QuickSpecBase.h +++ b/Sources/QuickObjCRuntime/include/QuickSpecBase.h @@ -1,7 +1,11 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @interface _QuickSpecBase : XCTestCase + (NSArray *)_qck_testMethodSelectors; - (instancetype)init NS_DESIGNATED_INITIALIZER; @end + +NS_ASSUME_NONNULL_END diff --git a/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h b/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h index dbd0d80d8..ee8b74807 100644 --- a/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h +++ b/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h @@ -2,6 +2,8 @@ @class QCKConfiguration; +NS_ASSUME_NONNULL_BEGIN + /** Subclass QuickConfiguration and override the +[QuickConfiguration configure:] method in order to configure how Quick behaves when running specs, or to define @@ -28,3 +30,5 @@ + (void)configure:(QCKConfiguration *)configuration; @end + +NS_ASSUME_NONNULL_END diff --git a/Sources/QuickObjectiveC/DSL/QCKDSL.h b/Sources/QuickObjectiveC/DSL/QCKDSL.h index f2d52e739..5632f21f5 100644 --- a/Sources/QuickObjectiveC/DSL/QCKDSL.h +++ b/Sources/QuickObjectiveC/DSL/QCKDSL.h @@ -2,6 +2,8 @@ @class ExampleMetadata; +NS_ASSUME_NONNULL_BEGIN + /** Provides a hook for Quick to be configured before any examples are run. Within this scope, override the +[QuickConfiguration configure:] method @@ -45,7 +47,7 @@ } \ @end \ -typedef NSDictionary *(^QCKDSLSharedExampleContext)(void); +typedef NSDictionary *_Nonnull(^QCKDSLSharedExampleContext)(void); typedef void (^QCKDSLSharedExampleBlock)(QCKDSLSharedExampleContext); typedef void (^QCKDSLEmptyBlock)(void); typedef void (^QCKDSLExampleMetadataBlock)(ExampleMetadata *exampleMetadata); @@ -274,3 +276,6 @@ QUICK_EXPORT QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSString *file, NSU QUICK_EXPORT QCKItBehavesLikeBlock qck_xitBehavesLike_builder(NSString *file, NSUInteger line) NS_SWIFT_UNAVAILABLE(""); QUICK_EXPORT QCKItBehavesLikeBlock qck_fitBehavesLike_builder(NSString *file, NSUInteger line) NS_SWIFT_UNAVAILABLE(""); QUICK_EXPORT QCKItBlock qck_pending_builder(NSString *file, NSUInteger line) NS_SWIFT_UNAVAILABLE(""); + +NS_ASSUME_NONNULL_END +