aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-04-05 11:52:07 -0400
committerGravatar GitHub <noreply@github.com>2018-04-05 11:52:07 -0400
commitdb717bf6704b444b093d46f53935402c83441854 (patch)
tree11f69c3ba737c7509f620f3660d6c8d6057fc2d7 /Firestore/Example/Tests
parent7257c0d22727a7e94867992aa2f1a3e283dc6bb7 (diff)
Port transform operations to C++ (#1020)
* port FieldMask to C++ * address changes * address changes * fix test * address change * Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++ * address changes * address changes * address changes * address change
Diffstat (limited to 'Firestore/Example/Tests')
-rw-r--r--Firestore/Example/Tests/Util/FSTHelpers.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Firestore/Example/Tests/Util/FSTHelpers.mm b/Firestore/Example/Tests/Util/FSTHelpers.mm
index 8a7306c..cc120a9 100644
--- a/Firestore/Example/Tests/Util/FSTHelpers.mm
+++ b/Firestore/Example/Tests/Util/FSTHelpers.mm
@@ -47,8 +47,10 @@
#include "Firestore/core/src/firebase/firestore/model/field_mask.h"
#include "Firestore/core/src/firebase/firestore/model/field_value.h"
#include "Firestore/core/src/firebase/firestore/model/resource_path.h"
+#include "Firestore/core/src/firebase/firestore/model/transform_operations.h"
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
#include "Firestore/core/test/firebase/firestore/testutil/testutil.h"
+#include "absl/memory/memory.h"
namespace util = firebase::firestore::util;
namespace testutil = firebase::firestore::testutil;
@@ -58,6 +60,8 @@ using firebase::firestore::model::FieldMask;
using firebase::firestore::model::FieldPath;
using firebase::firestore::model::FieldValue;
using firebase::firestore::model::ResourcePath;
+using firebase::firestore::model::ServerTimestampTransform;
+using firebase::firestore::model::TransformOperation;
NS_ASSUME_NONNULL_BEGIN
@@ -277,9 +281,9 @@ FSTTransformMutation *FSTTestTransformMutation(NSString *path,
NSMutableArray<FSTFieldTransform *> *fieldTransforms = [NSMutableArray array];
for (NSString *field in serverTimestampFields) {
const FieldPath fieldPath = testutil::Field(util::MakeStringView(field));
- id<FSTTransformOperation> transformOp = [FSTServerTimestampTransform serverTimestampTransform];
+ auto transformOp = absl::make_unique<ServerTimestampTransform>(ServerTimestampTransform::Get());
FSTFieldTransform *transform =
- [[FSTFieldTransform alloc] initWithPath:fieldPath transform:transformOp];
+ [[FSTFieldTransform alloc] initWithPath:fieldPath transform:std::move(transformOp)];
[fieldTransforms addObject:transform];
}
return [[FSTTransformMutation alloc] initWithKey:key fieldTransforms:fieldTransforms];