Skip to content

Commit 52ebbbf

Browse files
Sum and average (#11108)
This is implementation but not public release of sum and average. The sum/avg API is not made public. There are no API changes in this PR.
1 parent 34932ce commit 52ebbbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4317
-171
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 36 additions & 20 deletions
Large diffs are not rendered by default.

Firestore/Example/Tests/API/FSTAPIHelpers.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,12 @@ FIRQuerySnapshot *FSTTestQuerySnapshot(
7373
} // extern "C"
7474
#endif
7575

76+
@interface FSTNSExceptionUtil : NSObject
77+
78+
+ (BOOL)testForException:(void (^)(void))methodToTry
79+
reasonContains:(nonnull NSString *)message
80+
NS_SWIFT_NAME(testForException(_:reasonContains:));
81+
82+
@end
83+
7684
NS_ASSUME_NONNULL_END

Firestore/Example/Tests/API/FSTAPIHelpers.mm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,18 @@
163163
metadata:std::move(metadata)];
164164
}
165165

166+
@implementation FSTNSExceptionUtil
167+
168+
+ (BOOL)testForException:(nonnull void (^)())methodToTry
169+
reasonContains:(nonnull NSString *)substring {
170+
@try {
171+
methodToTry();
172+
return NO;
173+
} @catch (NSException *exception) {
174+
return [[exception reason] containsString:substring];
175+
}
176+
}
177+
178+
@end
179+
166180
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)