This is an automated email from the ASF dual-hosted git repository.
GitToTheHub pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 01d5288f test: Silence 2 test case warnings (#1702)
01d5288f is described below
commit 01d5288fc10e3db4b4934b9241265a3325f11788
Author: Darryl Pogue <[email protected]>
AuthorDate: Wed Aug 26 09:33:22 2026 -0700
test: Silence 2 test case warnings (#1702)
* test: Ignore a static analyzer warning about a test case
We've annotated CDVPluginResult messageAsString: to only accept a
non-nil argument, but this test is specifically intended to make sure
that if it does get a nil argument it doesn't blow up. The static
analyzer (rightfully) complains about passing nil to a method that
requires non-nil, but we'll just silence that in this specific case.
* test: Fix non-nullable test helper returning nil
---
tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m | 2 ++
tests/CordovaLibTests/CDVSceneDelegateTests.m | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
b/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
index bfdcd7f6..f08d310d 100644
--- a/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
+++ b/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
@@ -149,6 +149,7 @@
XCTAssertTrue([quotedString isEqualToString:[[result argumentsAsJSON]
cdv_JSONFragment]]);
}
+#ifndef __clang_analyzer__ // Silence a static analyzer warning about passing
nil to messageAsString:
- (void)testSerializingMessageAsStringThatIsNil
{
NSString* nilString = nil;
@@ -156,5 +157,6 @@
XCTAssertTrue([[NSNull null] isEqual:[[result argumentsAsJSON]
cdv_JSONFragment]]);
}
+#endif
@end
diff --git a/tests/CordovaLibTests/CDVSceneDelegateTests.m
b/tests/CordovaLibTests/CDVSceneDelegateTests.m
index 7a84acdc..2a106752 100644
--- a/tests/CordovaLibTests/CDVSceneDelegateTests.m
+++ b/tests/CordovaLibTests/CDVSceneDelegateTests.m
@@ -40,7 +40,7 @@
return context;
}
- (NSURL *)URL { return self.fakeURL; }
-- (UISceneOpenURLOptions *)options { return nil; }
+- (UISceneOpenURLOptions *)options { return [[[UISceneOpenURLOptions class]
alloc] init]; }
@end
@interface CDVFakeSceneConnectionOptions : UISceneConnectionOptions
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]