From 17bbfafcd988e82d0116a05a7daaf08cd093afa9 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 29 Apr 2021 10:56:11 -0600 Subject: [PATCH 1/2] TestUtil methods that create value types --- .../Firestore.xcodeproj/project.pbxproj | 14 -- Firestore/core/test/unit/testutil/testutil.cc | 215 ++++++++++-------- Firestore/core/test/unit/testutil/testutil.h | 145 ++++++------ 3 files changed, 204 insertions(+), 170 deletions(-) diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 4ff61bb45aa..01dcb53ec67 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -54,12 +54,10 @@ 0A4E1B5E3E853763AE6ED7AE /* grpc_stream_tester.cc in Sources */ = {isa = PBXBuildFile; fileRef = 87553338E42B8ECA05BA987E /* grpc_stream_tester.cc */; }; 0A52B47C43B7602EE64F53A7 /* cc_compilation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1B342370EAE3AA02393E33EB /* cc_compilation_test.cc */; }; 0A6FBE65A7FE048BAD562A15 /* FSTGoogleTestTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */; }; - 0A800CA749750B01E36A6787 /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0ABCE06A0D96EA3899B3A259 /* query_engine_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A853940305237AFDA8050B /* query_engine_test.cc */; }; 0AE084A7886BC11B8C305122 /* string_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380CFC201A2EE200D97691 /* string_util_test.cc */; }; 0B002E2E2012B32EB801C6D5 /* bundle_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 79EAA9F7B1B9592B5F053923 /* bundle_spec_test.json */; }; 0B071E9044CEEF666D829354 /* field_filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = E8551D6C6FB0B1BACE9E5BAD /* field_filter_test.cc */; }; - 0B4D2668C1E81DF6D62BA9BF /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0B55CD5CB8DFEBF2D22A2332 /* byte_stream_cpp_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01D10113ECC5B446DB35E96D /* byte_stream_cpp_test.cc */; }; 0B7B24194E2131F5C325FE0E /* async_queue_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6FB467B208E9A8200554BA2 /* async_queue_test.cc */; }; 0B9BD73418289EFF91917934 /* bits_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380D01201BC69F00D97691 /* bits_test.cc */; }; @@ -77,7 +75,6 @@ 0E4C94369FFF7EC0C9229752 /* iterator_adaptors_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54A0353420A3D8CB003E0143 /* iterator_adaptors_test.cc */; }; 0EA40EDACC28F445F9A3F32F /* pretty_printing_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB323F9553050F4F6490F9FF /* pretty_printing_test.cc */; }; 0EDFC8A6593477E1D17CDD8F /* leveldb_bundle_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8E9CD82E60893DDD7757B798 /* leveldb_bundle_cache_test.cc */; }; - 0EF74A344612147DE4261A4B /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0F54634745BA07B09BDC14D7 /* FSTIntegrationTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5491BC711FB44593008B3588 /* FSTIntegrationTestCase.mm */; }; 0F99BB63CE5B3CFE35F9027E /* event_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F57521E161450FAF89075ED /* event_manager_test.cc */; }; 0FA4D5601BE9F0CB5EC2882C /* local_serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F8043813A5D16963EC02B182 /* local_serializer_test.cc */; }; @@ -739,7 +736,6 @@ 856A1EAAD674ADBDAAEDAC37 /* bundle_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F5B96F3ABCD2CA901DB1CD4 /* bundle_builder.cc */; }; 85B8918FC8C5DC62482E39C3 /* resource_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2B02024FFD70028D6BE /* resource_path_test.cc */; }; 85BC2AB572A400114BF59255 /* limbo_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA129E1F315EE100DD57A1 /* limbo_spec_test.json */; }; - 85D301119D7175F82E12892E /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 85D61BDC7FB99B6E0DD3AFCA /* mutation.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE8220B89AAC00B5BCE7 /* mutation.pb.cc */; }; 85D7C370C7812166A467FEE9 /* string_apple_benchmark.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C73C0CC6F62A90D8573F383 /* string_apple_benchmark.mm */; }; 86004E06C088743875C13115 /* load_bundle_task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8F1A7B4158D9DD76EE4836BF /* load_bundle_task_test.cc */; }; @@ -1030,7 +1026,6 @@ C524026444E83EEBC1773650 /* objc_type_traits_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A0CF41BA5AED6049B0BEB2C /* objc_type_traits_apple_test.mm */; }; C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D421C2DDC800EFB9CC /* firestore.pb.cc */; }; C57B15CADD8C3E806B154C19 /* task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 899FC22684B0F7BEEAE13527 /* task_test.cc */; }; - C591407ABE1394B4042AB7CA /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; C5F1E2220E30ED5EAC9ABD9E /* mutation.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE8220B89AAC00B5BCE7 /* mutation.pb.cc */; }; C663A8B74B57FD84717DEA21 /* delayed_constructor_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D0A6E9136804A41CEC9D55D4 /* delayed_constructor_test.cc */; }; C6BF529243414C53DF5F1012 /* memory_local_store_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F6CA0C5638AB6627CB5B4CF4 /* memory_local_store_test.cc */; }; @@ -1080,7 +1075,6 @@ D43F7601F3F3DE3125346D42 /* user_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB38D93220239654000A432D /* user_test.cc */; }; D4572060A0FD4D448470D329 /* leveldb_transaction_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 88CF09277CFA45EE1273E3BA /* leveldb_transaction_test.cc */; }; D4D8BA32ACC5C2B1B29711C0 /* memory_lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9765D47FA12FA283F4EFAD02 /* memory_lru_garbage_collector_test.cc */; }; - D541EA6C61FBB8913BA5C3C3 /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; D550446303227FB1B381133C /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; D57F4CB3C92CE3D4DF329B78 /* serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61F72C5520BC48FD001A68CB /* serializer_test.cc */; }; D59FAEE934987D4C4B2A67B2 /* FIRFirestoreTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5467FAFF203E56F8009C9584 /* FIRFirestoreTests.mm */; }; @@ -1525,7 +1519,6 @@ 666324E85D5F68788F781776 /* FSTUserDataReaderTests.mm */ = {isa = PBXFileReference; includeInIndex = 1; path = FSTUserDataReaderTests.mm; sourceTree = ""; }; 69E6C311558EC77729A16CF1 /* Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; sourceTree = ""; }; 6AE927CDFC7A72BF825BE4CB /* Pods-Firestore_Tests_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Tests_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Tests_tvOS/Pods-Firestore_Tests_tvOS.release.xcconfig"; sourceTree = ""; }; - 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = field_value_benchmark.cc; sourceTree = ""; }; 6E8302DE210222ED003E1EA3 /* FSTFuzzTestFieldPath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FSTFuzzTestFieldPath.h; sourceTree = ""; }; 6E8302DF21022309003E1EA3 /* FSTFuzzTestFieldPath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTFuzzTestFieldPath.mm; sourceTree = ""; }; 6EA39FDD20FE820E008D461F /* FSTFuzzTestSerializer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTFuzzTestSerializer.mm; sourceTree = ""; }; @@ -2345,7 +2338,6 @@ 549CCA5320A36E1F00BCEB75 /* field_mask_test.cc */, B686F2AD2023DDB20028D6BE /* field_path_test.cc */, 7515B47C92ABEEC66864B55C /* field_transform_test.cc */, - 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */, AB356EF6200EA5EB0089B766 /* field_value_test.cc */, C8522DE226C467C54E6788D8 /* mutation_test.cc */, AB6B908720322E8800CC290A /* no_document_test.cc */, @@ -3499,7 +3491,6 @@ 07B1E8C62772758BC82FEBEE /* field_mask_test.cc in Sources */, D9366A834BFF13246DC3AF9E /* field_path_test.cc in Sources */, C961FA581F87000DF674BBC8 /* field_transform_test.cc in Sources */, - C591407ABE1394B4042AB7CA /* field_value_benchmark.cc in Sources */, 9D0E720F5A6DBD48FF325016 /* field_value_test.cc in Sources */, 60C72F86D2231B1B6592A5E6 /* filesystem_test.cc in Sources */, 907DF0E63248DBF0912CC56D /* filesystem_testing.cc in Sources */, @@ -3691,7 +3682,6 @@ ED4E2AC80CAF2A8FDDAC3DEE /* field_mask_test.cc in Sources */, 41EAC526C543064B8F3F7EDA /* field_path_test.cc in Sources */, A192648233110B7B8BD65528 /* field_transform_test.cc in Sources */, - 0EF74A344612147DE4261A4B /* field_value_benchmark.cc in Sources */, E4EEF6AAFCD33303CE9E5408 /* field_value_test.cc in Sources */, AAF2F02E77A80C9CDE2C0C7A /* filesystem_test.cc in Sources */, C4C7A8D11DC394EF81B7B1FA /* filesystem_testing.cc in Sources */, @@ -3896,7 +3886,6 @@ F272A8C41D2353700A11D1FB /* field_mask_test.cc in Sources */, AF6D6C47F9A25C65BFDCBBA0 /* field_path_test.cc in Sources */, B667366CB06893DFF472902E /* field_transform_test.cc in Sources */, - 0B4D2668C1E81DF6D62BA9BF /* field_value_benchmark.cc in Sources */, DDBC6DB41D1A43CFF01288A2 /* field_value_test.cc in Sources */, D6486C7FFA8BE6F9C7D2F4C4 /* filesystem_test.cc in Sources */, C3E4EE9615367213A71FEECF /* filesystem_testing.cc in Sources */, @@ -4101,7 +4090,6 @@ A1563EFEB021936D3FFE07E3 /* field_mask_test.cc in Sources */, B235E260EA0DCB7BAC04F69B /* field_path_test.cc in Sources */, 1BF1F9A0CBB6B01654D3C2BE /* field_transform_test.cc in Sources */, - 0A800CA749750B01E36A6787 /* field_value_benchmark.cc in Sources */, 2D3401180516B739494C7EFC /* field_value_test.cc in Sources */, 199B778D5820495797E0BE02 /* filesystem_test.cc in Sources */, AD12205540893CEB48647937 /* filesystem_testing.cc in Sources */, @@ -4303,7 +4291,6 @@ 549CCA5720A36E1F00BCEB75 /* field_mask_test.cc in Sources */, B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */, 2EC1C4D202A01A632339A161 /* field_transform_test.cc in Sources */, - 85D301119D7175F82E12892E /* field_value_benchmark.cc in Sources */, AB356EF7200EA5EB0089B766 /* field_value_test.cc in Sources */, D94A1862B8FB778225DB54A1 /* filesystem_test.cc in Sources */, DD6C480629B3F87933FAF440 /* filesystem_testing.cc in Sources */, @@ -4527,7 +4514,6 @@ 6A40835DB2C02B9F07C02E88 /* field_mask_test.cc in Sources */, D00E69F7FDF2BE674115AD3F /* field_path_test.cc in Sources */, 9016EF298E41456060578C90 /* field_transform_test.cc in Sources */, - D541EA6C61FBB8913BA5C3C3 /* field_value_benchmark.cc in Sources */, DA9FA01D1A4D7EC7ACA14DAB /* field_value_test.cc in Sources */, 280A282BE9AF4DCF4E855EAB /* filesystem_test.cc in Sources */, 867B370BF2DF84B6AB94B874 /* filesystem_testing.cc in Sources */, diff --git a/Firestore/core/test/unit/testutil/testutil.cc b/Firestore/core/test/unit/testutil/testutil.cc index c374b4d6450..dd430dd8abe 100644 --- a/Firestore/core/test/unit/testutil/testutil.cc +++ b/Firestore/core/test/unit/testutil/testutil.cc @@ -28,21 +28,22 @@ #include "Firestore/core/src/core/query.h" #include "Firestore/core/src/model/delete_mutation.h" #include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" #include "Firestore/core/src/model/document_set.h" #include "Firestore/core/src/model/field_mask.h" #include "Firestore/core/src/model/field_path.h" #include "Firestore/core/src/model/field_transform.h" -#include "Firestore/core/src/model/field_value.h" -#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/mutable_document.h" #include "Firestore/core/src/model/patch_mutation.h" #include "Firestore/core/src/model/precondition.h" #include "Firestore/core/src/model/set_mutation.h" #include "Firestore/core/src/model/transform_operation.h" -#include "Firestore/core/src/model/unknown_document.h" +#include "Firestore/core/src/model/value_util.h" #include "Firestore/core/src/model/verify_mutation.h" #include "Firestore/core/src/nanopb/byte_string.h" #include "Firestore/core/src/util/hard_assert.h" #include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" #include "absl/memory/memory.h" namespace firebase { @@ -51,16 +52,19 @@ namespace testutil { using model::Document; using model::DocumentComparator; +using model::DocumentKey; using model::DocumentSet; -using model::DocumentState; using model::FieldMask; using model::FieldPath; using model::FieldTransform; -using model::FieldValue; +using model::MutableDocument; +using model::NullValue; using model::ObjectValue; using model::Precondition; +using model::SetRepeatedField; using model::TransformOperation; using nanopb::ByteString; +using util::StringFormat; /** * A string sentinel that can be used with PatchMutation() to mark a field for @@ -70,9 +74,12 @@ constexpr const char* kDeleteSentinel = ""; namespace details { -FieldValue BlobValue(std::initializer_list octets) { +google_firestore_v1_Value BlobValue(std::initializer_list octets) { nanopb::ByteString contents{octets}; - return FieldValue::FromBlob(std::move(contents)); + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_bytes_value_tag; + result.bytes_value = nanopb::MakeBytesArray(octets.begin(), octets.size()); + return result; } } // namespace details @@ -81,44 +88,71 @@ ByteString Bytes(std::initializer_list octets) { return ByteString(octets); } -FieldValue Value(std::nullptr_t) { - return FieldValue::Null(); +google_firestore_v1_Value Value(std::nullptr_t) { + return NullValue(); } -FieldValue Value(double value) { - return FieldValue::FromDouble(value); +google_firestore_v1_Value Value(double value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_double_value_tag; + result.double_value = value; + return result; } -FieldValue Value(Timestamp value) { - return FieldValue::FromTimestamp(value); +google_firestore_v1_Value Value(Timestamp value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_timestamp_value_tag; + result.timestamp_value.seconds = value.seconds(); + result.timestamp_value.nanos = value.nanoseconds(); + return result; } -FieldValue Value(const char* value) { - return FieldValue::FromString(value); +google_firestore_v1_Value Value(const char* value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_string_value_tag; + result.string_value = nanopb::MakeBytesArray(value); + return result; } -FieldValue Value(const std::string& value) { - return FieldValue::FromString(value); +google_firestore_v1_Value Value(const std::string& value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_string_value_tag; + result.string_value = nanopb::MakeBytesArray(value); + return result; } -FieldValue Value(const GeoPoint& value) { - return FieldValue::FromGeoPoint(value); +google_firestore_v1_Value Value(const nanopb::ByteString& value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_bytes_value_tag; + result.bytes_value = nanopb::MakeBytesArray(value.begin(), value.size()); + return result; } -FieldValue Value(const FieldValue& value) { +google_firestore_v1_Value Value(const GeoPoint& value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_geo_point_value_tag; + result.geo_point_value.latitude = value.latitude(); + result.geo_point_value.longitude = value.longitude(); + return result; +} + +google_firestore_v1_Value Value(const google_firestore_v1_Value& value) { return value; } -FieldValue Value(const model::ObjectValue& value) { - return value.AsFieldValue(); +google_firestore_v1_Value Value(const google_firestore_v1_ArrayValue& value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_array_value_tag; + result.array_value = value; + return result; } -FieldValue Value(const FieldValue::Map& value) { - return Value(model::ObjectValue::FromMap(value)); +google_firestore_v1_Value Value(const model::ObjectValue& value) { + return value.Get(); } -model::ObjectValue WrapObject(const model::FieldValue::Map& value) { - return model::ObjectValue::FromMap(value); +ObjectValue WrapObject(const google_firestore_v1_Value& value) { + return ObjectValue{value}; } model::DocumentKey Key(absl::string_view path) { @@ -141,8 +175,14 @@ model::DatabaseId DbId(std::string project) { } } -FieldValue Ref(std::string project, absl::string_view path) { - return FieldValue::FromReference(DbId(std::move(project)), Key(path)); +google_firestore_v1_Value Ref(std::string project, absl::string_view path) { + model::DatabaseId database_id = DbId(std::move(project)); + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_reference_value_tag; + result.string_value = nanopb::MakeBytesArray( + StringFormat("projects/%s/databases/%s/documents/%s", + database_id.project_id(), database_id.database_id(), path)); + return result; } model::ResourcePath Resource(absl::string_view field) { @@ -156,49 +196,39 @@ model::SnapshotVersion Version(int64_t version) { return model::SnapshotVersion{Timestamp::FromTimePoint(timepoint)}; } -model::Document Doc(absl::string_view key, - int64_t version, - const model::FieldValue::Map& data) { - return Doc(key, version, data, DocumentState::kSynced); +model::MutableDocument Doc(absl::string_view key, + int64_t version, + const google_firestore_v1_Value data) { + return MutableDocument::FoundDocument(Key(key), Version(version), + ObjectValue{data}); } -model::Document Doc(absl::string_view key, - int64_t version, - const model::FieldValue::Map& data, - model::DocumentState document_state) { - return model::Document(model::ObjectValue::FromMap(data), Key(key), - Version(version), document_state); +model::MutableDocument Doc(absl::string_view key, int64_t version) { + return MutableDocument::FoundDocument(Key(key), Version(version), + ObjectValue{}); } -model::Document Doc(absl::string_view key, - int64_t version, - const FieldValue& data) { - return Doc(key, version, data, DocumentState::kSynced); +model::MutableDocument Doc(absl::string_view key, + int64_t version, + const google_firestore_v1_Value& data) { + return MutableDocument::FoundDocument(Key(key), Version(version), + ObjectValue{data}); } -model::Document Doc(absl::string_view key, - int64_t version, - const FieldValue& data, - model::DocumentState document_state) { - return model::Document(model::ObjectValue(data), Key(key), Version(version), - document_state); +model::MutableDocument DeletedDoc(absl::string_view key, int64_t version) { + return MutableDocument::NoDocument(Key(key), Version(version)); } -model::NoDocument DeletedDoc(absl::string_view key, - int64_t version, - bool has_committed_mutations) { - return model::NoDocument(Key(key), Version(version), has_committed_mutations); +model::MutableDocument DeletedDoc(DocumentKey key, int64_t version) { + return MutableDocument::NoDocument(key, Version(version)); } -model::NoDocument DeletedDoc(model::DocumentKey key, - int64_t version, - bool has_committed_mutations) { - return model::NoDocument(std::move(key), Version(version), - has_committed_mutations); +model::MutableDocument UnknownDoc(absl::string_view key, int64_t version) { + return MutableDocument::UnknownDocument(Key(key), Version(version)); } -model::UnknownDocument UnknownDoc(absl::string_view key, int64_t version) { - return model::UnknownDocument(Key(key), Version(version)); +model::MutableDocument InvalidDoc(absl::string_view key) { + return MutableDocument::InvalidDocument(Key(key)); } DocumentComparator DocComparator(absl::string_view field_path) { @@ -243,39 +273,39 @@ core::Filter::Operator OperatorFromString(absl::string_view s) { core::FieldFilter Filter(absl::string_view key, absl::string_view op, - FieldValue value) { - return core::FieldFilter::Create(Field(key), OperatorFromString(op), - std::move(value)); + google_firestore_v1_Value value) { + return core::FieldFilter::Create(Field(key), OperatorFromString(op), value); } core::FieldFilter Filter(absl::string_view key, absl::string_view op, - FieldValue::Map value) { - return Filter(key, op, FieldValue::FromMap(std::move(value))); + google_firestore_v1_ArrayValue value) { + return core::FieldFilter::Create(Field(key), OperatorFromString(op), + Value(value)); } core::FieldFilter Filter(absl::string_view key, absl::string_view op, std::nullptr_t) { - return Filter(key, op, FieldValue::Null()); + return Filter(key, op, NullValue()); } core::FieldFilter Filter(absl::string_view key, absl::string_view op, const char* value) { - return Filter(key, op, FieldValue::FromString(value)); + return Filter(key, op, Value(value)); } core::FieldFilter Filter(absl::string_view key, absl::string_view op, int value) { - return Filter(key, op, FieldValue::FromInteger(value)); + return Filter(key, op, Value(value)); } core::FieldFilter Filter(absl::string_view key, absl::string_view op, double value) { - return Filter(key, op, FieldValue::FromDouble(value)); + return Filter(key, op, Value(value)); } core::Direction Direction(absl::string_view direction) { @@ -310,7 +340,7 @@ core::Query CollectionGroupQuery(absl::string_view collection_id) { // UserDataWriter changes are ported from Web and Android. model::SetMutation SetMutation( absl::string_view path, - const model::FieldValue::Map& values, + const google_firestore_v1_Value& values, std::vector> transforms) { std::vector field_transforms; for (auto&& pair : transforms) { @@ -320,7 +350,7 @@ model::SetMutation SetMutation( field_transforms.push_back(std::move(transform)); } - return model::SetMutation(Key(path), model::ObjectValue::FromMap(values), + return model::SetMutation(Key(path), model::ObjectValue{values}, model::Precondition::None(), std::move(field_transforms)); } @@ -330,10 +360,10 @@ model::SetMutation SetMutation( // UserDataWriter changes are ported from Web and Android. model::PatchMutation PatchMutation( absl::string_view path, - const FieldValue::Map& values, + const google_firestore_v1_Value& values, // TODO(rsgowman): Investigate changing update_mask to a set. std::vector> transforms) { - return PatchMutationHelper(path, values, transforms, + return PatchMutationHelper(path, values, std::move(transforms), Precondition::Exists(true), absl::nullopt); } @@ -342,20 +372,20 @@ model::PatchMutation PatchMutation( // UserDataWriter changes are ported from Web and Android. model::PatchMutation MergeMutation( absl::string_view path, - const FieldValue::Map& values, + const google_firestore_v1_Value& values, const std::vector& update_mask, std::vector> transforms) { - return PatchMutationHelper(path, values, transforms, Precondition::None(), - update_mask); + return PatchMutationHelper(path, values, std::move(transforms), + Precondition::None(), update_mask); } model::PatchMutation PatchMutationHelper( absl::string_view path, - const FieldValue::Map& values, + const google_firestore_v1_Value& values, std::vector> transforms, Precondition precondition, const absl::optional>& update_mask) { - ObjectValue object_value = ObjectValue::Empty(); + ObjectValue object_value{}; std::set field_mask_paths; std::vector field_transforms; @@ -366,16 +396,16 @@ model::PatchMutation PatchMutationHelper( field_transforms.push_back(std::move(transform)); } - for (const auto& kv : values) { - FieldPath field_path = Field(kv.first); + for (pb_size_t i = 0; i < values.map_value.fields_count; ++i) { + FieldPath field_path = + Field(nanopb::MakeStringView(values.map_value.fields[i].key)); field_mask_paths.insert(field_path); - - const FieldValue& value = kv.second; - if (!value.is_string() || value.string_value() != kDeleteSentinel) { - object_value = object_value.Set(field_path, value); - } else if (value.string_value() == kDeleteSentinel) { - object_value = - object_value.Set(field_path, object_value.Delete(field_path)); + const google_firestore_v1_Value& value = values.map_value.fields[i].value; + if (value.which_value_type != google_firestore_v1_Value_string_value_tag || + nanopb::MakeStringView(value.string_value) != kDeleteSentinel) { + object_value.Set(field_path, value); + } else if (nanopb::MakeStringView(value.string_value) == kDeleteSentinel) { + object_value.Delete(field_path); } } @@ -389,8 +419,8 @@ model::PatchMutation PatchMutationHelper( std::move(field_transforms)); } -std::pair Increment(std::string field, - FieldValue operand) { +std::pair Increment( + std::string field, google_firestore_v1_Value operand) { model::NumericIncrementTransform transform(std::move(operand)); return std::pair(std::move(field), @@ -398,10 +428,11 @@ std::pair Increment(std::string field, } std::pair ArrayUnion( - std::string field, std::vector operands) { + std::string field, std::vector operands) { + google_firestore_v1_ArrayValue array_value; + SetRepeatedField(&array_value.values, &array_value.values_count, operands); model::ArrayTransform transform(TransformOperation::Type::ArrayUnion, - std::move(operands)); - + array_value); return std::pair(std::move(field), std::move(transform)); } @@ -416,7 +447,7 @@ model::VerifyMutation VerifyMutation(absl::string_view path, int64_t version) { } model::MutationResult MutationResult(int64_t version) { - return model::MutationResult(Version(version), absl::nullopt); + return model::MutationResult(Version(version), Array()); } nanopb::ByteString ResumeToken(int64_t snapshot_version) { diff --git a/Firestore/core/test/unit/testutil/testutil.h b/Firestore/core/test/unit/testutil/testutil.h index 79645cd3d50..7fb91913e2f 100644 --- a/Firestore/core/test/unit/testutil/testutil.h +++ b/Firestore/core/test/unit/testutil/testutil.h @@ -17,15 +17,21 @@ #ifndef FIRESTORE_CORE_TEST_UNIT_TESTUTIL_TESTUTIL_H_ #define FIRESTORE_CORE_TEST_UNIT_TESTUTIL_TESTUTIL_H_ -#include +#include #include #include #include #include +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" #include "Firestore/core/src/core/core_fwd.h" -#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/core/direction.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_set.h" #include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" #include "absl/strings/string_view.h" namespace firebase { @@ -41,7 +47,7 @@ class ByteString; namespace testutil { namespace details { -model::FieldValue BlobValue(std::initializer_list); +google_firestore_v1_Value BlobValue(std::initializer_list); } // namespace details @@ -49,7 +55,7 @@ model::FieldValue BlobValue(std::initializer_list); nanopb::ByteString Bytes(std::initializer_list); -model::FieldValue Value(std::nullptr_t); +google_firestore_v1_Value Value(std::nullptr_t); /** * A type definition that evaluates to type V only if T is exactly type `bool`. @@ -75,8 +81,11 @@ using EnableForInts = typename std::enable_if::value && * @param bool_value A boolean value that disallows implicit conversions. */ template -EnableForExactlyBool Value(T bool_value) { - return model::FieldValue::FromBoolean(bool_value); +EnableForExactlyBool Value(T bool_value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_boolean_value_tag; + result.boolean_value = bool_value; + return result; } /** @@ -91,39 +100,43 @@ EnableForExactlyBool Value(T bool_value) { * @param value An integer value. */ template -EnableForInts Value(T value) { - return model::FieldValue::FromInteger(value); +EnableForInts Value(T value) { + google_firestore_v1_Value result{}; + result.which_value_type = google_firestore_v1_Value_integer_value_tag; + result.integer_value = value; + return result; } -model::FieldValue Value(double value); +google_firestore_v1_Value Value(double value); + +google_firestore_v1_Value Value(Timestamp value); -model::FieldValue Value(Timestamp value); +google_firestore_v1_Value Value(const char* value); -model::FieldValue Value(const char* value); +google_firestore_v1_Value Value(const std::string& value); -model::FieldValue Value(const std::string& value); +google_firestore_v1_Value Value(const nanopb::ByteString& value); -model::FieldValue Value(const GeoPoint& value); +google_firestore_v1_Value Value(const GeoPoint& value); template -model::FieldValue BlobValue(Ints... octets) { +google_firestore_v1_Value BlobValue(Ints... octets) { return details::BlobValue({static_cast(octets)...}); } -// This overload allows Object() to appear as a value (along with any explicitly -// constructed FieldValues). -model::FieldValue Value(const model::FieldValue& value); +google_firestore_v1_Value Value(const google_firestore_v1_Value& value); -model::FieldValue Value(const model::ObjectValue& value); +google_firestore_v1_Value Value(const google_firestore_v1_ArrayValue& value); -model::FieldValue Value(const model::FieldValue::Map& value); +google_firestore_v1_Value Value(const model::ObjectValue& value); namespace details { /** * Recursive base case for AddPairs, below. Returns the map. */ -inline model::FieldValue::Map AddPairs(const model::FieldValue::Map& prior) { +inline google_firestore_v1_Value AddPairs( + const google_firestore_v1_Value& prior) { return prior; } @@ -139,11 +152,21 @@ inline model::FieldValue::Map AddPairs(const model::FieldValue::Map& prior) { * @return The resulting map. */ template -model::FieldValue::Map AddPairs(const model::FieldValue::Map& prior, - const std::string& key, - const ValueType& value, - Args... rest) { - return AddPairs(prior.insert(key, Value(value)), rest...); +google_firestore_v1_Value AddPairs(const google_firestore_v1_Value& prior, + const std::string& key, + const ValueType& value, + Args... rest) { + google_firestore_v1_Value result = prior; + result.which_value_type = google_firestore_v1_Value_map_value_tag; + pb_size_t new_count = result.map_value.fields_count + 1; + result.map_value.fields_count = new_count; + result.map_value.fields = + nanopb::ResizeArray( + result.map_value.fields, new_count); + result.map_value.fields[new_count - 1].key = nanopb::MakeBytesArray(key); + result.map_value.fields[new_count - 1].value = Value(value); + + return AddPairs(result, rest...); } /** @@ -153,20 +176,24 @@ model::FieldValue::Map AddPairs(const model::FieldValue::Map& prior, * be passed to Value(). */ template -model::FieldValue::Map MakeMap(Args... key_value_pairs) { - return AddPairs(model::FieldValue::Map(), key_value_pairs...); +google_firestore_v1_Value MakeMap(Args... key_value_pairs) { + google_firestore_v1_Value map_value{}; + map_value.which_value_type = google_firestore_v1_Value_map_value_tag; + return AddPairs(map_value, key_value_pairs...); } } // namespace details template -model::FieldValue Array(Args... values) { - std::vector contents{Value(values)...}; - return model::FieldValue::FromArray(std::move(contents)); +google_firestore_v1_ArrayValue Array(Args... values) { + std::vector contents{Value(values)...}; + google_firestore_v1_ArrayValue result{}; + nanopb::SetRepeatedField(&result.values, &result.values_count, contents); + return result; } /** Wraps an immutable sorted map into an ObjectValue. */ -model::ObjectValue WrapObject(const model::FieldValue::Map& value); +model::ObjectValue WrapObject(const google_firestore_v1_Value& value); /** * Creates an ObjectValue from the given key/value pairs. @@ -186,7 +213,7 @@ model::ObjectValue WrapObject(Args... key_value_pairs) { * be passed to Value(). */ template -model::FieldValue::Map Map(Args... key_value_pairs) { +google_firestore_v1_Value Map(Args... key_value_pairs) { return details::MakeMap(key_value_pairs...); } @@ -196,7 +223,7 @@ model::FieldPath Field(absl::string_view field); model::DatabaseId DbId(std::string project = "project/(default)"); -model::FieldValue Ref(std::string project, absl::string_view path); +google_firestore_v1_Value Ref(std::string project, absl::string_view path); model::ResourcePath Resource(absl::string_view field); @@ -207,37 +234,27 @@ model::ResourcePath Resource(absl::string_view field); */ model::SnapshotVersion Version(int64_t version); -model::Document Doc( - absl::string_view key, - int64_t version = 0, - const model::FieldValue::Map& data = model::FieldValue::Map()); - -model::Document Doc(absl::string_view key, - int64_t version, - const model::FieldValue::Map& data, - model::DocumentState document_state); +model::MutableDocument Doc(absl::string_view key, int64_t version = 0); -model::Document Doc(absl::string_view key, - int64_t version, - const model::FieldValue& data); +model::MutableDocument Doc(absl::string_view key, + int64_t version, + const google_firestore_v1_Value& data); -model::Document Doc(absl::string_view key, - int64_t version, - const model::FieldValue& data, - model::DocumentState document_state); +model::MutableDocument Doc(absl::string_view key, + int64_t version, + const google_firestore_v1_Value& data); /** A convenience method for creating deleted docs for tests. */ -model::NoDocument DeletedDoc(absl::string_view key, - int64_t version = 0, - bool has_committed_mutations = false); +model::MutableDocument DeletedDoc(absl::string_view key, int64_t version = 0); /** A convenience method for creating deleted docs for tests. */ -model::NoDocument DeletedDoc(model::DocumentKey key, - int64_t version = 0, - bool has_committed_mutations = false); +model::MutableDocument DeletedDoc(model::DocumentKey key, int64_t version = 0); /** A convenience method for creating unknown docs for tests. */ -model::UnknownDocument UnknownDoc(absl::string_view key, int64_t version); +model::MutableDocument UnknownDoc(absl::string_view key, int64_t version); + +/** A convenience method for creating invalid (missing) docs for tests. */ +model::MutableDocument InvalidDoc(absl::string_view key); /** * Creates a DocumentComparator that will compare Documents by the given @@ -254,11 +271,11 @@ model::DocumentSet DocSet(model::DocumentComparator comp, core::FieldFilter Filter(absl::string_view key, absl::string_view op, - model::FieldValue value); + google_firestore_v1_Value value); core::FieldFilter Filter(absl::string_view key, absl::string_view op, - model::FieldValue::Map value); + google_firestore_v1_ArrayValue value); core::FieldFilter Filter(absl::string_view key, absl::string_view op, @@ -296,26 +313,26 @@ core::Query CollectionGroupQuery(absl::string_view collection_id); model::SetMutation SetMutation( absl::string_view path, - const model::FieldValue::Map& values = model::FieldValue::Map(), + const google_firestore_v1_Value& values = google_firestore_v1_Value{}, std::vector> transforms = {}); model::PatchMutation PatchMutation( absl::string_view path, - const model::FieldValue::Map& values = model::FieldValue::Map(), + const google_firestore_v1_Value& values = google_firestore_v1_Value{}, std::vector> transforms = {}); model::PatchMutation MergeMutation( absl::string_view path, - const model::FieldValue::Map& values, + const google_firestore_v1_Value& values, const std::vector& update_mask, std::vector> transforms = {}); model::PatchMutation PatchMutationHelper( absl::string_view path, - const model::FieldValue::Map& values, + const google_firestore_v1_Value& values, std::vector> transforms, model::Precondition precondition, const absl::optional>& update_mask); @@ -326,7 +343,7 @@ model::PatchMutation PatchMutationHelper( * above. */ std::pair Increment( - std::string field, model::FieldValue operand); + std::string field, google_firestore_v1_Value operand); /** * Creates a pair of field name, TransformOperation that represents an array @@ -334,7 +351,7 @@ std::pair Increment( * above. */ std::pair ArrayUnion( - std::string field, std::vector operands); + std::string field, std::vector operands); model::DeleteMutation DeleteMutation(absl::string_view path); From 4f429052c473268f0e95e6252d7b3380755ca9e0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 29 Apr 2021 10:58:47 -0600 Subject: [PATCH 2/2] Revert file --- .../Example/Firestore.xcodeproj/project.pbxproj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 01dcb53ec67..4ff61bb45aa 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -54,10 +54,12 @@ 0A4E1B5E3E853763AE6ED7AE /* grpc_stream_tester.cc in Sources */ = {isa = PBXBuildFile; fileRef = 87553338E42B8ECA05BA987E /* grpc_stream_tester.cc */; }; 0A52B47C43B7602EE64F53A7 /* cc_compilation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1B342370EAE3AA02393E33EB /* cc_compilation_test.cc */; }; 0A6FBE65A7FE048BAD562A15 /* FSTGoogleTestTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */; }; + 0A800CA749750B01E36A6787 /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0ABCE06A0D96EA3899B3A259 /* query_engine_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A853940305237AFDA8050B /* query_engine_test.cc */; }; 0AE084A7886BC11B8C305122 /* string_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380CFC201A2EE200D97691 /* string_util_test.cc */; }; 0B002E2E2012B32EB801C6D5 /* bundle_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 79EAA9F7B1B9592B5F053923 /* bundle_spec_test.json */; }; 0B071E9044CEEF666D829354 /* field_filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = E8551D6C6FB0B1BACE9E5BAD /* field_filter_test.cc */; }; + 0B4D2668C1E81DF6D62BA9BF /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0B55CD5CB8DFEBF2D22A2332 /* byte_stream_cpp_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01D10113ECC5B446DB35E96D /* byte_stream_cpp_test.cc */; }; 0B7B24194E2131F5C325FE0E /* async_queue_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6FB467B208E9A8200554BA2 /* async_queue_test.cc */; }; 0B9BD73418289EFF91917934 /* bits_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380D01201BC69F00D97691 /* bits_test.cc */; }; @@ -75,6 +77,7 @@ 0E4C94369FFF7EC0C9229752 /* iterator_adaptors_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54A0353420A3D8CB003E0143 /* iterator_adaptors_test.cc */; }; 0EA40EDACC28F445F9A3F32F /* pretty_printing_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB323F9553050F4F6490F9FF /* pretty_printing_test.cc */; }; 0EDFC8A6593477E1D17CDD8F /* leveldb_bundle_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8E9CD82E60893DDD7757B798 /* leveldb_bundle_cache_test.cc */; }; + 0EF74A344612147DE4261A4B /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 0F54634745BA07B09BDC14D7 /* FSTIntegrationTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5491BC711FB44593008B3588 /* FSTIntegrationTestCase.mm */; }; 0F99BB63CE5B3CFE35F9027E /* event_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F57521E161450FAF89075ED /* event_manager_test.cc */; }; 0FA4D5601BE9F0CB5EC2882C /* local_serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F8043813A5D16963EC02B182 /* local_serializer_test.cc */; }; @@ -736,6 +739,7 @@ 856A1EAAD674ADBDAAEDAC37 /* bundle_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F5B96F3ABCD2CA901DB1CD4 /* bundle_builder.cc */; }; 85B8918FC8C5DC62482E39C3 /* resource_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2B02024FFD70028D6BE /* resource_path_test.cc */; }; 85BC2AB572A400114BF59255 /* limbo_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA129E1F315EE100DD57A1 /* limbo_spec_test.json */; }; + 85D301119D7175F82E12892E /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; 85D61BDC7FB99B6E0DD3AFCA /* mutation.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE8220B89AAC00B5BCE7 /* mutation.pb.cc */; }; 85D7C370C7812166A467FEE9 /* string_apple_benchmark.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C73C0CC6F62A90D8573F383 /* string_apple_benchmark.mm */; }; 86004E06C088743875C13115 /* load_bundle_task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8F1A7B4158D9DD76EE4836BF /* load_bundle_task_test.cc */; }; @@ -1026,6 +1030,7 @@ C524026444E83EEBC1773650 /* objc_type_traits_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A0CF41BA5AED6049B0BEB2C /* objc_type_traits_apple_test.mm */; }; C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D421C2DDC800EFB9CC /* firestore.pb.cc */; }; C57B15CADD8C3E806B154C19 /* task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 899FC22684B0F7BEEAE13527 /* task_test.cc */; }; + C591407ABE1394B4042AB7CA /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; C5F1E2220E30ED5EAC9ABD9E /* mutation.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE8220B89AAC00B5BCE7 /* mutation.pb.cc */; }; C663A8B74B57FD84717DEA21 /* delayed_constructor_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D0A6E9136804A41CEC9D55D4 /* delayed_constructor_test.cc */; }; C6BF529243414C53DF5F1012 /* memory_local_store_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F6CA0C5638AB6627CB5B4CF4 /* memory_local_store_test.cc */; }; @@ -1075,6 +1080,7 @@ D43F7601F3F3DE3125346D42 /* user_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB38D93220239654000A432D /* user_test.cc */; }; D4572060A0FD4D448470D329 /* leveldb_transaction_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 88CF09277CFA45EE1273E3BA /* leveldb_transaction_test.cc */; }; D4D8BA32ACC5C2B1B29711C0 /* memory_lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9765D47FA12FA283F4EFAD02 /* memory_lru_garbage_collector_test.cc */; }; + D541EA6C61FBB8913BA5C3C3 /* field_value_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */; }; D550446303227FB1B381133C /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; D57F4CB3C92CE3D4DF329B78 /* serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61F72C5520BC48FD001A68CB /* serializer_test.cc */; }; D59FAEE934987D4C4B2A67B2 /* FIRFirestoreTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5467FAFF203E56F8009C9584 /* FIRFirestoreTests.mm */; }; @@ -1519,6 +1525,7 @@ 666324E85D5F68788F781776 /* FSTUserDataReaderTests.mm */ = {isa = PBXFileReference; includeInIndex = 1; path = FSTUserDataReaderTests.mm; sourceTree = ""; }; 69E6C311558EC77729A16CF1 /* Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; sourceTree = ""; }; 6AE927CDFC7A72BF825BE4CB /* Pods-Firestore_Tests_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Tests_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Tests_tvOS/Pods-Firestore_Tests_tvOS.release.xcconfig"; sourceTree = ""; }; + 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = field_value_benchmark.cc; sourceTree = ""; }; 6E8302DE210222ED003E1EA3 /* FSTFuzzTestFieldPath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FSTFuzzTestFieldPath.h; sourceTree = ""; }; 6E8302DF21022309003E1EA3 /* FSTFuzzTestFieldPath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTFuzzTestFieldPath.mm; sourceTree = ""; }; 6EA39FDD20FE820E008D461F /* FSTFuzzTestSerializer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTFuzzTestSerializer.mm; sourceTree = ""; }; @@ -2338,6 +2345,7 @@ 549CCA5320A36E1F00BCEB75 /* field_mask_test.cc */, B686F2AD2023DDB20028D6BE /* field_path_test.cc */, 7515B47C92ABEEC66864B55C /* field_transform_test.cc */, + 6D0EE49C1D5AF75664D0EBE4 /* field_value_benchmark.cc */, AB356EF6200EA5EB0089B766 /* field_value_test.cc */, C8522DE226C467C54E6788D8 /* mutation_test.cc */, AB6B908720322E8800CC290A /* no_document_test.cc */, @@ -3491,6 +3499,7 @@ 07B1E8C62772758BC82FEBEE /* field_mask_test.cc in Sources */, D9366A834BFF13246DC3AF9E /* field_path_test.cc in Sources */, C961FA581F87000DF674BBC8 /* field_transform_test.cc in Sources */, + C591407ABE1394B4042AB7CA /* field_value_benchmark.cc in Sources */, 9D0E720F5A6DBD48FF325016 /* field_value_test.cc in Sources */, 60C72F86D2231B1B6592A5E6 /* filesystem_test.cc in Sources */, 907DF0E63248DBF0912CC56D /* filesystem_testing.cc in Sources */, @@ -3682,6 +3691,7 @@ ED4E2AC80CAF2A8FDDAC3DEE /* field_mask_test.cc in Sources */, 41EAC526C543064B8F3F7EDA /* field_path_test.cc in Sources */, A192648233110B7B8BD65528 /* field_transform_test.cc in Sources */, + 0EF74A344612147DE4261A4B /* field_value_benchmark.cc in Sources */, E4EEF6AAFCD33303CE9E5408 /* field_value_test.cc in Sources */, AAF2F02E77A80C9CDE2C0C7A /* filesystem_test.cc in Sources */, C4C7A8D11DC394EF81B7B1FA /* filesystem_testing.cc in Sources */, @@ -3886,6 +3896,7 @@ F272A8C41D2353700A11D1FB /* field_mask_test.cc in Sources */, AF6D6C47F9A25C65BFDCBBA0 /* field_path_test.cc in Sources */, B667366CB06893DFF472902E /* field_transform_test.cc in Sources */, + 0B4D2668C1E81DF6D62BA9BF /* field_value_benchmark.cc in Sources */, DDBC6DB41D1A43CFF01288A2 /* field_value_test.cc in Sources */, D6486C7FFA8BE6F9C7D2F4C4 /* filesystem_test.cc in Sources */, C3E4EE9615367213A71FEECF /* filesystem_testing.cc in Sources */, @@ -4090,6 +4101,7 @@ A1563EFEB021936D3FFE07E3 /* field_mask_test.cc in Sources */, B235E260EA0DCB7BAC04F69B /* field_path_test.cc in Sources */, 1BF1F9A0CBB6B01654D3C2BE /* field_transform_test.cc in Sources */, + 0A800CA749750B01E36A6787 /* field_value_benchmark.cc in Sources */, 2D3401180516B739494C7EFC /* field_value_test.cc in Sources */, 199B778D5820495797E0BE02 /* filesystem_test.cc in Sources */, AD12205540893CEB48647937 /* filesystem_testing.cc in Sources */, @@ -4291,6 +4303,7 @@ 549CCA5720A36E1F00BCEB75 /* field_mask_test.cc in Sources */, B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */, 2EC1C4D202A01A632339A161 /* field_transform_test.cc in Sources */, + 85D301119D7175F82E12892E /* field_value_benchmark.cc in Sources */, AB356EF7200EA5EB0089B766 /* field_value_test.cc in Sources */, D94A1862B8FB778225DB54A1 /* filesystem_test.cc in Sources */, DD6C480629B3F87933FAF440 /* filesystem_testing.cc in Sources */, @@ -4514,6 +4527,7 @@ 6A40835DB2C02B9F07C02E88 /* field_mask_test.cc in Sources */, D00E69F7FDF2BE674115AD3F /* field_path_test.cc in Sources */, 9016EF298E41456060578C90 /* field_transform_test.cc in Sources */, + D541EA6C61FBB8913BA5C3C3 /* field_value_benchmark.cc in Sources */, DA9FA01D1A4D7EC7ACA14DAB /* field_value_test.cc in Sources */, 280A282BE9AF4DCF4E855EAB /* filesystem_test.cc in Sources */, 867B370BF2DF84B6AB94B874 /* filesystem_testing.cc in Sources */,