diff options
author | Gil <mcg@google.com> | 2018-02-22 08:12:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 08:12:54 -0800 |
commit | 935f3ca7d749f96c7207236a39c57f32a02c05d3 (patch) | |
tree | 94ac8094c8d10893f137325d5dc820e759dc6f90 /Firestore/Example/Tests/Model | |
parent | 6ce954a791a73abc8d32765e2695ed153e120c47 (diff) |
Avoid wrapping and rewrapping NSStrings when constructing DatabaseId (#833)
* Avoid wrapping and rewrapping NSStrings when constructing DatabaseId
* Shorten DatabaseId::kDefaultDatabaseId
Diffstat (limited to 'Firestore/Example/Tests/Model')
-rw-r--r-- | Firestore/Example/Tests/Model/FSTFieldValueTests.mm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Firestore/Example/Tests/Model/FSTFieldValueTests.mm b/Firestore/Example/Tests/Model/FSTFieldValueTests.mm index c0fb188..03dfa66 100644 --- a/Firestore/Example/Tests/Model/FSTFieldValueTests.mm +++ b/Firestore/Example/Tests/Model/FSTFieldValueTests.mm @@ -254,8 +254,8 @@ union DoubleBits { - (void)testWrapResourceNames { NSArray *values = @[ - FSTTestRef(@"project", util::WrapNSStringNoCopy(DatabaseId::kDefaultDatabaseId), @"foo/bar"), - FSTTestRef(@"project", util::WrapNSStringNoCopy(DatabaseId::kDefaultDatabaseId), @"foo/baz") + FSTTestRef("project", DatabaseId::kDefault, @"foo/bar"), + FSTTestRef("project", DatabaseId::kDefault, @"foo/baz") ]; for (FSTDocumentKeyReference *value in values) { FSTFieldValue *wrapped = FSTTestFieldValue(value); @@ -423,7 +423,7 @@ union DoubleBits { } - (void)testValueEquality { - DatabaseId database_id = DatabaseId("project", DatabaseId::kDefaultDatabaseId); + DatabaseId database_id = DatabaseId("project", DatabaseId::kDefault); NSArray *groups = @[ @[ FSTTestFieldValue(@YES), [FSTBooleanValue booleanValue:YES] ], @[ FSTTestFieldValue(@NO), [FSTBooleanValue booleanValue:NO] ], @@ -467,10 +467,9 @@ union DoubleBits { @[ FSTTestFieldValue(FSTTestGeoPoint(1, 0)) ], @[ [FSTReferenceValue referenceValue:FSTTestDocKey(@"coll/doc1") databaseID:&database_id], - FSTTestFieldValue(FSTTestRef( - @"project", util::WrapNSStringNoCopy(DatabaseId::kDefaultDatabaseId), @"coll/doc1")) + FSTTestFieldValue(FSTTestRef("project", DatabaseId::kDefault, @"coll/doc1")) ], - @[ FSTTestRef(@"project", @"(default)", @"coll/doc2") ], + @[ FSTTestRef("project", "(default)", @"coll/doc2") ], @[ FSTTestFieldValue(@[ @"foo", @"bar" ]), FSTTestFieldValue(@[ @"foo", @"bar" ]) ], @[ FSTTestFieldValue(@[ @"foo", @"bar", @"baz" ]) ], @[ FSTTestFieldValue(@[ @"foo" ]) ], @[ @@ -531,9 +530,9 @@ union DoubleBits { @[ FSTTestData(0, 1, 2, 4, 3, -1) ], @[ FSTTestData(255, -1) ], // resource names - @[ FSTTestRef(@"p1", @"d1", @"c1/doc1") ], @[ FSTTestRef(@"p1", @"d1", @"c1/doc2") ], - @[ FSTTestRef(@"p1", @"d1", @"c10/doc1") ], @[ FSTTestRef(@"p1", @"d1", @"c2/doc1") ], - @[ FSTTestRef(@"p1", @"d2", @"c1/doc1") ], @[ FSTTestRef(@"p2", @"d1", @"c1/doc1") ], + @[ FSTTestRef("p1", "d1", @"c1/doc1") ], @[ FSTTestRef("p1", "d1", @"c1/doc2") ], + @[ FSTTestRef("p1", "d1", @"c10/doc1") ], @[ FSTTestRef("p1", "d1", @"c2/doc1") ], + @[ FSTTestRef("p1", "d2", @"c1/doc1") ], @[ FSTTestRef("p2", "d1", @"c1/doc1") ], // Geo points @[ FSTTestGeoPoint(-90, -180) ], @[ FSTTestGeoPoint(-90, 0) ], @[ FSTTestGeoPoint(-90, 180) ], |