mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use the modern spelling for the nullability attributes in the test mock headers. Currently, this was relying on the predefined macros from clang to work. However, those are only available on Darwin targets. This is needed to make the mock environments more portable.
29 lines
755 B
Objective-C
29 lines
755 B
Objective-C
@import Foundation;
|
|
|
|
#pragma clang assume_nonnull begin
|
|
|
|
@protocol ErrorTest
|
|
- (nullable id)succeedAndReturnError:(NSError **)error;
|
|
- (nullable id)failAndReturnError:(NSError **)error;
|
|
@end
|
|
|
|
static id _Nullable testSucceed(id<ErrorTest> _Nonnull testObj) {
|
|
NSError *error = nil;
|
|
return [testObj succeedAndReturnError:&error];
|
|
}
|
|
|
|
static id _Nullable testSucceedIgnoringError(id<ErrorTest> _Nonnull testObj) {
|
|
return [testObj succeedAndReturnError:NULL];
|
|
}
|
|
|
|
static id _Nullable testFail(id<ErrorTest> _Nonnull testObj) {
|
|
NSError *error = nil;
|
|
return [testObj failAndReturnError:&error];
|
|
}
|
|
|
|
static id _Nullable testFailIgnoringError(id<ErrorTest> _Nonnull testObj) {
|
|
return [testObj failAndReturnError:NULL];
|
|
}
|
|
|
|
#pragma clang assume_nonnull end
|