aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/model
Commit message (Collapse)AuthorAge
* Add missing tests to the Firestore project (#1254)Gravatar Gil2018-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix order of project elements * Add immutable container tests to the Firestore project * Fix style problems in TransformOperations * Method names should have an initial upper case character (except getters/setters) * Pointers bind to the type not the name in C++ * Fix unsigned/signed comparison warning * Make transform_operations.h Objective-C++ only It turns out that you can't conditionally define virtual methods. This causes multiple versions of the vtable to be emitted and when the linker resolves all the vtable definitions for a class it picks one arbitrarily causing failures for callers that expect some of the conditional methods to be present. * Add precondition_test and field_mask_test to the project * Add field_transform_test and transform_operations_test to the project * Clean up missing newline/excess comments * Use braced initialization to avoid linter false positive on std::transform
* Port FSTDocumentKeySet to C++ DocumentKeySet (#1229)Gravatar Gil2018-05-05
| | | | | | | | | * Define a Comparator for DocumentKey * Automated migration from FSTDocumentKeySet to DocumentKeySet * Manual fixups for DocumentKeySet * Delete FSTDocumentKeySet
* Update `FieldValue` For Porting `Mutation`s to C++ (#1144)Gravatar zxu2018-04-23
| | | | | | | | | | * update FieldValue for Mutation implementation * address changes * address changes * address change
* Array Transforms public API and parsingGravatar Michael Lehenbauer2018-04-13
| | | | | This includes the new FIRFieldValue sentinels, the FSTUserDataConverter code to parse them into internal ArrayTransform operations for use in an FSTTransformMutation, and some sanity testing in FSTMutationTests. I still need to implement FSTTransformMutation support for local application and serialization (and then integration tests).
* Port `Precondition` to C++ (#1040)Gravatar zxu2018-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * implement `FieldTransform` in C++ * port `FieldTransform` * make `fieldTransforms` shared inside `context` * Implement Precondition in C++ w/o test yet * add unit test for `Precondition` * port `Precondition` * address changes * address changes * fix bugs for integration test * address changes * fix lint * address changes * address changes
* Add clang-tidy checks for Firestore (#1078)Gravatar Gil2018-04-12
| | | | | | | | | | | | | | | | | | | | * Add a .clang-tidy configuration for Firestore C++ * Fix clang-tidy warnings * typedef -> using * const ref + rvalue ref -> pass by value * NULL -> nullptr * remove useless default initializations * remove useless const value-type parameter declarations (definitions can still use them) * use auto instead of repeating types in a cast * Fix typos * Address use of static method through instance warnings * Address use after move warnings
* Port FieldTransform to C++ (#1033)Gravatar zxu2018-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * implement `FieldTransform` in C++ * port `FieldTransform` * make `fieldTransforms` shared inside `context` * address changes * fix lint * address changes
* Add lint checking for Objective-C++ sources (#1048)Gravatar Gil2018-04-09
| | | | | | | | | | | | | | | | * lint.sh now lints Objective-C++ too * cpplint checks system-style includes that should be user-style This prevents it from recognizing project sources as if they were C system headers and then complaining that they're in the wrong place. * cpplint checks #imports and #includes * cpplint checks that C++ system headers aren't #imported * cpplint checks for C system headers that could be C++ system headers * cpplint checks that Objective-C sources include their headers
* Port transform operations to C++ (#1020)Gravatar zxu2018-04-05
| | | | | | | | | | | | | | | | | | | | | | * 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
* port FieldMask to C++ (#998)Gravatar zxu2018-04-04
| | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * fix lint * address changes * Revert "address changes" This reverts commit c75bb42851b785ab0838bb23679f87dfad9df4bb.
* Add ObjectValue::Map alias (#967)Gravatar rsgowman2018-03-27
|
* C++ migration: make Timestamp class a part of public API (#944)Gravatar Konstantin Varlamov2018-03-27
| | | | | | | | | | | * move Timestamp from model/ to the root directory; * move Timestamp to top-level firebase namespace and update all references; * add conversions to and from native date types; * add a specialization of std::hash; * add comments to public member functions; * rename nanos -> nanoseconds; * add public headers, including Timestamp, to CMake; * increase test coverage.
* [De]Serialize FieldValue map_values ("Objects") (#878)Gravatar rsgowman2018-03-08
| | | These can (recursively) contain other FieldValues.
* Fix lint warnings (#840)Gravatar Gil2018-02-22
|
* Avoid wrapping and rewrapping NSStrings when constructing DatabaseId (#833)Gravatar Gil2018-02-22
| | | | | | * Avoid wrapping and rewrapping NSStrings when constructing DatabaseId * Shorten DatabaseId::kDefaultDatabaseId
* Serialize (and deserialize) int64 values (#818) (#829)Gravatar rsgowman2018-02-22
|
* Port Firestore Document to C++ (#777)Gravatar zxu2018-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement SnapshotVersion and test * update project * implement MaybeDocument and test * move snapshot-version from core to model * fix a bug * implement Document and test * implement NoDocument * adding type tag and fix style * fix a few bugs, discovered after merging and test run. * add assert to check FieldValue type and more test for comparision. * address changes * allow moving FieldValue to construct Document. * address changes * add document tests to project * use std::less convention * make Type::Unknown static initializer
* Update FieldValue of type Reference (#775)Gravatar zxu2018-02-12
| | | | | | | | | | * update FieldValue of type Reference * address change * fix bad path string literal in test * use ReferenceValue and qualified name
* C++ port: add C++ equivalent of FSTDocumentKey. (#762)Gravatar Konstantin Varlamov2018-02-09
| | | | | Also move kDocumentKeyPath to the only point of usage - make it a static member variable of FieldPath.
* port Firestore SnapshotVersion in C++ (#767)Gravatar zxu2018-02-09
| | | * implement SnapshotVersion and test
* cmake build fixes (#770)Gravatar rsgowman2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix nanopb (in cmake build) Look for binaries in the src dir (since that's where we build now.) This error would be masked if a previous build had completed prior to switching nanopb to build out of src. Also, don't patch the protoc path multiple times. This could be triggered by (eg) 'make && make clean && make'. * Add resource_path.{h,cc} to the cmake build * Fix signed/unsigned int comparison warnings * Ensure FieldValue tag_ is initialized during cp/mv ctor. Otherwise, the assignment operator attempts to deallocate based on the (uninitialized) tag_ variable, posssibly leading to segfaults. * Fix tests that throw exceptions. The (previous) tests checked to ensure that an abort() occurs, but if ABSL_HAVE_EXCEPTIONS is defined on non-macos (which is currently the default) then the assertions will throw a std::logic_error rather than abort()ing. On macos, an exception is thrown too, but the exception doesn't derrive from std::exception, so ASSERT_DEATH_* doesn't catch it (hence why ASSERT_DEATH_* actually works.) To resolve this, I've switched to ASSERT_ANY_THROW.
* C++ port: port FSTFieldPath and FSTResourcePath to C++ (#749)Gravatar Konstantin Varlamov2018-02-06
| | | Similar to Objective-C, FieldPath and ResourcePath share most of their interface (and implementation) by deriving from BasePath (using CRTP, so that factory methods in BasePath can return an instance of the derived class).
* Implement Firestore DatabaseInfo and port both Database{Id,Info} C++ to the ↵Gravatar zxu2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iOS code (#738) * implement Firestore DatabaseInfo in C++ * temporary stash changes; blocking on the massive renaming of .m to .mm * add database_info_test to project * finish port DatabaseId and fix style, modular fixing DatabaseInfo * port DatabaseInfo * remove FSTDatabase{ID,Info} and their tests from project * fix unit test * use namespace alias * use namespace alias, leftover * address more changes * refactoring to use raw pointer instead of value for property * address changes * remove self-> * fix style * remove the name suffix Alloc * fix a bug
* Firestore DatabaseId in C++ (#727)Gravatar zxu2018-01-29
| | | | | | | | | | | | * Implement DataBaseId in C++ * add database_id_test to project * fix project * address changes * fix style
* Fix a number of c++ build errors (#715)Gravatar rsgowman2018-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move -fvisibility-inlines-hidden from common_flags to cxx_flags This option isn't supported by C (and causes the build to fail under at least rodete). Manifested error was: ``` -- Looking for include file openssl/rand.h -- Looking for include file openssl/rand.h - not found CMake Error at core/src/firebase/firestore/util/CMakeLists.txt:94 (message): No implementation for SecureRandom available. -- Configuring incomplete, errors occurred! ``` which is completely misleading. :( * Fix exception include for std::logic_error Was causing compiler error on (at least) rodete. (http://en.cppreference.com/w/cpp/error/logic_error suggests that stdexcept is the correct header.) * Remove 'const' from vector contents. vectors cannot contain const objects as the contained objects are required to be assignable and copy constructable. (Not *quite* strictly true; since c++11, this requirement now depends on the operations performed on the container. But my compiler objects at any rate.) http://en.cppreference.com/w/cpp/container/vector https://stackoverflow.com/questions/8685257/why-cant-you-put-a-const-object-into-a-stl-container * Add brackets as suggested (required) by my compiler. * Add missing include For LLONG_MIN, etc. * Enable gnu extension to c++11 for firestore/util *test*. We disable them by default (in cmake/CompilerSetup.cmake) but our tests requires hexidecimal floating point, which is not supported in c++11 (though is supported in C++17, gnu++11, and others). http://en.cppreference.com/w/cpp/language/floating_literal https://bugzilla.redhat.com/show_bug.cgi?id=1321986 * Fix printf format for uint64_t http://en.cppreference.com/w/cpp/types/integer https://stackoverflow.com/questions/9225567/how-to-print-a-int64-t-type-in-c * Allow 0 length printf template strings in tests. * Get rid of a multi line comment. The backslash is apparently interpreted by the compiler cause the next line to be ignored too. In this case, the next line is (currently) a comment, and would be ignored anyways. (But that doesn't stop the compiler from yelling.) * Run ./scripts/style.sh
* Implement the rest of FieldValue types for C++ (#687)Gravatar zxu2018-01-25
| | | | | | | | | | | | * implement FieldValue for null and boolean. * Implement number and string FieldValue. * Implement object FieldValue. * implement timestamp FieldValue. * Implement number and string FieldValue. * implement public type `Blob` and `GeoPoint` * implement Blob FieldValue * Implement GeoPoint FieldValue * refactoring `Blob`
* Fix CMake build and lint warnings in field_value.cc (#677)Gravatar Gil2018-01-17
| | | | | | | Fixes these cpplint warnings: Firestore/core/src/firebase/firestore/model/field_value.cc:162: Semicolon defining empty statement. Use {} instead. [whitespace/semicolon] [5] Firestore/core/src/firebase/firestore/model/field_value.cc:170: Semicolon defining empty statement. Use {} instead. [whitespace/semicolon] [5] Firestore/core/src/firebase/firestore/model/field_value.cc:126: Add #include <utility> for swap [build/include_what_you_use] [4]
* implement FieldValue for null, boolean, and array in C++. (#637)Gravatar zxu2018-01-17
* implement FieldValue for null and boolean. * refactoring to use union type instead of poly * refactor using union design intead of poly * refactoring to use anonymous union and fix styles * small fix * add field_value_test to the project * fix warning of cmake and fix style