aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Util
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-03-05 11:30:59 -0500
committerGravatar GitHub <noreply@github.com>2018-03-05 11:30:59 -0500
commit1c40e7aada6b32bbc621f06fb5f380149606a58d (patch)
tree6dee81f74f8a33d1beae915d9227caf28b8e2598 /Firestore/Example/Tests/Util
parent9b5b4d876eb77e65b3246614855088be101eebf3 (diff)
add converters and port paths to FSTQuery (#869)
* add converters and fix FSTQuery.{h,m} only * address changes * a change forget to address * add a dummy function to make inline-only-library buildable
Diffstat (limited to 'Firestore/Example/Tests/Util')
-rw-r--r--Firestore/Example/Tests/Util/FSTHelpers.mm15
1 files changed, 8 insertions, 7 deletions
diff --git a/Firestore/Example/Tests/Util/FSTHelpers.mm b/Firestore/Example/Tests/Util/FSTHelpers.mm
index 649486a..9b05604 100644
--- a/Firestore/Example/Tests/Util/FSTHelpers.mm
+++ b/Firestore/Example/Tests/Util/FSTHelpers.mm
@@ -183,7 +183,7 @@ FSTDocumentKeyReference *FSTTestRef(const absl::string_view projectID,
}
FSTQuery *FSTTestQuery(NSString *path) {
- return [FSTQuery queryWithPath:FSTTestPath(path)];
+ return [FSTQuery queryWithPath:[FSTTestPath(path) toCPPResourcePath]];
}
id<FSTFilter> FSTTestFilter(NSString *field, NSString *opString, id value) {
@@ -206,12 +206,12 @@ id<FSTFilter> FSTTestFilter(NSString *field, NSString *opString, id value) {
FSTFieldValue *data = FSTTestFieldValue(value);
if ([data isEqual:[FSTDoubleValue nanValue]]) {
FSTCAssert(op == FSTRelationFilterOperatorEqual, @"Must use == with NAN.");
- return [[FSTNanFilter alloc] initWithField:path];
+ return [[FSTNanFilter alloc] initWithField:[path toCPPFieldPath]];
} else if ([data isEqual:[FSTNullValue nullValue]]) {
FSTCAssert(op == FSTRelationFilterOperatorEqual, @"Must use == with Null.");
- return [[FSTNullFilter alloc] initWithField:path];
+ return [[FSTNullFilter alloc] initWithField:[path toCPPFieldPath]];
} else {
- return [FSTRelationFilter filterWithField:path filterOperator:op value:data];
+ return [FSTRelationFilter filterWithField:[path toCPPFieldPath] filterOperator:op value:data];
}
}
@@ -225,13 +225,14 @@ FSTSortOrder *FSTTestOrderBy(NSString *field, NSString *direction) {
} else {
FSTCFail(@"Unsupported direction: %@", direction);
}
- return [FSTSortOrder sortOrderWithFieldPath:path ascending:ascending];
+ return [FSTSortOrder sortOrderWithFieldPath:[path toCPPFieldPath] ascending:ascending];
}
NSComparator FSTTestDocComparator(NSString *fieldPath) {
FSTQuery *query = [FSTTestQuery(@"docs")
- queryByAddingSortOrder:[FSTSortOrder sortOrderWithFieldPath:FSTTestFieldPath(fieldPath)
- ascending:YES]];
+ queryByAddingSortOrder:[FSTSortOrder
+ sortOrderWithFieldPath:[FSTTestFieldPath(fieldPath) toCPPFieldPath]
+ ascending:YES]];
return [query comparator];
}