Skip to content

Commit cb27b72

Browse files
committed
Minimize warnings
1 parent b565dc3 commit cb27b72

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

LeanplumSDK/LeanplumSDK/Classes/Utilities/LPUtils.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@
2929
/**
3030
* Checks if the object is null or empty.
3131
*/
32-
+ (BOOL)isNullOrEmpty:(id)obj;
32+
+ (BOOL)isNullOrEmpty:(id _Nullable)obj;
3333

3434
/**
3535
* Checks if the string is empty or have spaces.
3636
*/
37-
+ (BOOL)isBlank:(id)obj;
37+
+ (BOOL)isBlank:(id _Nullable)obj;
3838

3939
/**
4040
* Computes MD5 of NSData. Mostly used for uploading images.
4141
*/
42-
+ (NSString *)md5OfData:(NSData *)data;
42+
+ (NSString * _Nonnull)md5OfData:(NSData * _Nullable)data;
4343

4444
/**
4545
* Returns base64 encoded string from NSData. Convenience method
4646
* that supports iOS6.
4747
*/
48-
+ (NSString *)base64EncodedStringFromData:(NSData *)data;
48+
+ (NSString * _Nonnull)base64EncodedStringFromData:(NSData * _Nonnull)data;
4949

5050
/**
5151
* Initialize exception handling
@@ -55,7 +55,7 @@
5555
/**
5656
* Report an exception
5757
*/
58-
+ (void)handleException:(NSException *)exception;
58+
+ (void)handleException:(NSException * _Nonnull)exception;
5959

6060
/**
6161
* Whether swizzling flag is setup in plist file
@@ -65,21 +65,21 @@
6565
/**
6666
* Returns Leanplum bundle
6767
*/
68-
+ (NSBundle *)leanplumBundle;
68+
+ (NSBundle * _Nullable)leanplumBundle;
6969

7070
/**
7171
* Open URLs from SDK
7272
*/
73-
+ (void)openURL:(NSURL *)url;
73+
+ (void)openURL:(NSURL * _Nonnull)url;
7474

7575
/**
7676
* Open URLs from SDK and calls the completionHandler
7777
*/
78-
+ (void)openURL:(NSURL *)url completionHandler:(void (^ __nullable)(BOOL success))completion;
78+
+ (void)openURL:(NSURL * _Nonnull)url completionHandler:(void (^ __nullable)(BOOL success))completion;
7979

8080
/**
8181
* Checks if given value is a NSNumber with bool value
8282
*/
83-
+ (BOOL)isBoolNumber:(NSNumber *)value;
83+
+ (BOOL)isBoolNumber:(NSNumber * _Nonnull)value;
8484

8585
@end

LeanplumSDKApp/LeanplumSDKTests/Classes/Extensions/Leanplum+Extensions.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#import <Leanplum/LPRequestFactory.h>
2929
#import <Leanplum/Leanplum-Swift.h>
3030

31+
NS_ASSUME_NONNULL_BEGIN
32+
3133
@interface Leanplum(UnitTest)
3234

3335
@property (class, readonly) User* _Nonnull user;
@@ -48,23 +50,25 @@
4850

4951
@end
5052

53+
NS_ASSUME_NONNULL_END
54+
5155
@interface LPActionContext(UnitTest)
5256

53-
+ (LPActionContext *)actionContextWithName:(NSString *)name
54-
args:(NSDictionary *)args
55-
messageId:(NSString *)messageId;
57+
+ (nullable LPActionContext *)actionContextWithName:(nonnull NSString *)name
58+
args:(nullable NSDictionary *)args
59+
messageId:(nullable NSString *)messageId;
5660

57-
-(NSString *)htmlStringContentsOfFile:(NSString *)file;
61+
-(nullable NSString *)htmlStringContentsOfFile:(nonnull NSString *)file;
5862

5963
@end
6064

6165
@interface LPRequestFactory(UnitTest)
62-
+ (LPRequest *)createGetForApiMethod:(NSString *)apiMethod params:(nullable NSDictionary *)params;
66+
+ (nullable LPRequest *)createGetForApiMethod:(nonnull NSString *)apiMethod params:(nullable NSDictionary *)params;
6367
+ (nullable LPRequest *)createPostForApiMethod:(nonnull NSString *)apiMethod params:(nullable NSDictionary *)params;
6468
@end
6569

6670
@interface LPLogManager(UnitTest)
67-
+ (void)maybeSendLog:(NSString *)message;
71+
+ (void)maybeSendLog:(nonnull NSString *)message;
6872
@end
6973

7074

LeanplumSDKApp/LeanplumSDKTests/Classes/LPEventCallbackManagerTest.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ - (void)tearDown {
2424
[super tearDown];
2525
}
2626

27+
#pragma clang diagnostic push
28+
#pragma clang diagnostic ignored "-Wnonnull"
2729
- (void)test_event_callback
2830
{
2931
// Test invoke methods.
@@ -164,5 +166,6 @@ - (void)test_event_callback_manager
164166
[self waitForExpectations:@[response3Expectation] timeout:2];
165167
XCTAssertTrue(eventCallbackMap.count == 0);
166168
}
169+
#pragma clang diagnostic pop
167170

168171
@end

LeanplumSDKApp/LeanplumSDKTests/Classes/Utilities/LeanplumHelper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ extern NSInteger DISPATCH_WAIT_TIME;
7171
/// retrieve data from a file
7272
+ (NSData *)retrieve_data_from_file:(NSString *)file ofType:(NSString *)type;
7373

74-
+ (void)dismissPresentedViewControllers;
75-
7674
+ (void)mockThrowErrorToThrow;
7775

7876
+ (void)stopMockThrowErrorToThrow;

LeanplumSDKApp/LeanplumSDKTests/Classes/Utilities/LeanplumHelper.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,11 @@ + (void)clean_up {
158158
[[LPConstantsState sharedState] setIsInPermanentFailureState:NO];
159159

160160
// Reset values directly
161+
#pragma clang diagnostic push
162+
#pragma clang diagnostic ignored "-Wnonnull"
161163
[ApiConfig shared].appId = nil;
162164
[ApiConfig shared].accessKey = nil;
165+
#pragma clang diagnostic pop
163166

164167
[LPRequest reset];
165168
[LPRequestSender reset];

0 commit comments

Comments
 (0)