From 1c40e7aada6b32bbc621f06fb5f380149606a58d Mon Sep 17 00:00:00 2001 From: zxu Date: Mon, 5 Mar 2018 11:30:59 -0500 Subject: 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 --- .../firebase/firestore/testutil/CMakeLists.txt | 14 ++++---- .../test/firebase/firestore/testutil/testutil.cc | 28 +++++++++++++++ .../test/firebase/firestore/testutil/testutil.h | 41 ++++++++++++++++++++++ 3 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 Firestore/core/test/firebase/firestore/testutil/testutil.cc create mode 100644 Firestore/core/test/firebase/firestore/testutil/testutil.h (limited to 'Firestore/core/test') diff --git a/Firestore/core/test/firebase/firestore/testutil/CMakeLists.txt b/Firestore/core/test/firebase/firestore/testutil/CMakeLists.txt index 14308a5..636acb0 100644 --- a/Firestore/core/test/firebase/firestore/testutil/CMakeLists.txt +++ b/Firestore/core/test/firebase/firestore/testutil/CMakeLists.txt @@ -27,10 +27,12 @@ if(APPLE) list(APPEND TESTUTIL_DEPENDS firebase_firestore_testutil_apple) endif() -add_library( - firebase_firestore_testutil INTERFACE -) -target_link_libraries( - firebase_firestore_testutil INTERFACE - ${TESTUTIL_DEPENDS} +cc_library( + firebase_firestore_testutil + SOURCES + testutil.cc + testutil.h + DEPENDS + ${TESTUTIL_DEPENDS} + firebase_firestore_model ) diff --git a/Firestore/core/test/firebase/firestore/testutil/testutil.cc b/Firestore/core/test/firebase/firestore/testutil/testutil.cc new file mode 100644 index 0000000..9b9228d --- /dev/null +++ b/Firestore/core/test/firebase/firestore/testutil/testutil.cc @@ -0,0 +1,28 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/test/firebase/firestore/testutil/testutil.h" + +namespace firebase { +namespace firestore { +namespace testutil { + +void dummy() { +} + +} // namespace testutil +} // namespace firestore +} // namespace firebase diff --git a/Firestore/core/test/firebase/firestore/testutil/testutil.h b/Firestore/core/test/firebase/firestore/testutil/testutil.h new file mode 100644 index 0000000..7e4f313 --- /dev/null +++ b/Firestore/core/test/firebase/firestore/testutil/testutil.h @@ -0,0 +1,41 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#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/field_path.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace testutil { + +// Below are convenience methods for creating instances for tests. + +inline model::FieldPath Field(absl::string_view field) { + return model::FieldPath::FromServerFormat(field); +} + +// Add a non-inline function to make this library buildable. +// TODO(zxu123): remove once there is non-inline function. +void dummy(); + +} // namespace testutil +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_TESTUTIL_TESTUTIL_H_ -- cgit v1.2.3