Skip to content

Commit 9460b82

Browse files
authored
[Database] Remove outdated FLevelDBStorageEngineTests test (#11478)
The test `testExtremeDoublesAsServerCache` only applies to iOS < 11. Removed the test since our minimum deployment target is already iOS 11. This also resolves the test failure on visionOS.
1 parent 1ef1ea2 commit 9460b82

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

FirebaseDatabase/Tests/Unit/FLevelDBStorageEngineTests.m

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -469,29 +469,6 @@ - (void)testHugeLeafNodeThenDeeperSet {
469469
NODE((@{@"deep" : @"deep-value"})));
470470
}
471471

472-
// Well this is awkward, but NSJSONSerialization fails to deserialize JSON with tiny/huge doubles
473-
// It is kind of bad we raise "invalid" data, but at least we don't crash *trollface*
474-
- (void)testExtremeDoublesAsServerCache {
475-
#ifdef TARGET_OS_IOS
476-
if ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion >= 11) {
477-
// NSJSONSerialization on iOS 11 correctly serializes small and large doubles.
478-
return;
479-
}
480-
#endif
481-
#if TARGET_OS_MACCATALYST || TARGET_OS_OSX || TARGET_OS_WATCH
482-
return;
483-
#endif
484-
485-
FLevelDBStorageEngine *engine = [self cleanStorageEngine];
486-
[engine updateServerCache:NODE((@{@"works" : @"value", @"fails" : @(2.225073858507201e-308)}))
487-
atPath:PATH(@"foo")
488-
merge:NO];
489-
490-
// Will drop the tiny double
491-
XCTAssertEqualObjects([engine serverCacheAtPath:PATH(@"foo")], NODE(@{@"works" : @"value"}));
492-
XCTAssertEqualObjects([engine serverCacheAtPath:PATH(@"foo/fails")], [FEmptyNode emptyNode]);
493-
}
494-
495472
- (void)testLongValuesDontLosePrecision {
496473
id longValue = @1542405709418655810;
497474
id floatValue = @2.47;

0 commit comments

Comments
 (0)