From 4e7296b080b9c8cea13e5e5eeee65f4312fb5e8a Mon Sep 17 00:00:00 2001 From: zxu Date: Fri, 16 Mar 2018 15:42:05 -0400 Subject: port `DocumentKey` to non-container types of `Model/*` (#930) * naively remove FSTPath import and source/test files. * port FieldPath, part I * port FieldPath, part II * port ResourcePath, part I * port ResourcePath, part II * the grand commit to fix build errors * use testutil:: helper instead of those from FSTHelpers * fix test and lint * use c_str in errmsg directly * fix * fix * make code clean * fix integration test I missed * fix to avoid naming collision in preprocessor * address changes * address changes * address changes * fix: fieldMask are actually shared with different context. * address changes * add converter function between two DocumentKey implementations * add unit test * address changes * fix lint * using DocumentKey in model except for the container types `FSTDocumentDictionary`, `FSTDocumentKeySet`, and `FSTDocumentVersionDictionary` * change other place w.r.t. the use of `DocumentKey` in model * update parameter of test helpers from NSString to string_view * revert a temporary change used in debug * address changes --- Firestore/core/test/firebase/firestore/testutil/testutil.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Firestore/core/test') diff --git a/Firestore/core/test/firebase/firestore/testutil/testutil.h b/Firestore/core/test/firebase/firestore/testutil/testutil.h index 094efc5..9c69784 100644 --- a/Firestore/core/test/firebase/firestore/testutil/testutil.h +++ b/Firestore/core/test/firebase/firestore/testutil/testutil.h @@ -17,6 +17,7 @@ #ifndef FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_TESTUTIL_TESTUTIL_H_ #define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_TESTUTIL_TESTUTIL_H_ +#include "Firestore/core/src/firebase/firestore/model/document_key.h" #include "Firestore/core/src/firebase/firestore/model/field_path.h" #include "Firestore/core/src/firebase/firestore/model/resource_path.h" #include "absl/strings/string_view.h" @@ -27,6 +28,10 @@ namespace testutil { // Below are convenience methods for creating instances for tests. +inline model::DocumentKey Key(absl::string_view path) { + return model::DocumentKey::FromPathString(path); +} + inline model::FieldPath Field(absl::string_view field) { return model::FieldPath::FromServerFormat(field); } -- cgit v1.2.3