aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests
Commit message (Collapse)AuthorAge
* 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
* Increase expectation timeout to 25 seconds. (#744)Gravatar Michael Lehenbauer2018-02-02
| | | | | | | I'm doing this to: 1) Experimentally see if it improves the flakiness we've been seeing in the Query Conformance Tests. 2) Insulate us from the fact that GRPC seems to take a /minimum/ of 10 seconds to reconnect (at least in some cases) after a connection failure. I've opened b/72864027 to revisit this in the future.
* Remove predecessorKey,Object,Document, etc (#735)Gravatar Gil2018-02-01
| | | | | This is dead code. I think it was probably useful in the RTDB because of the way it notified of changes, but we give changes with indexes in Firestore so I think we don't need it.
* Move all Firestore Objective-C to Objective-C++ (#734)Gravatar Gil2018-01-31
| | | | | | | | | | | | | | * Move all Firestore files to Objective-C++ * Update project file references * Don't use module imports from Objective-C++ * Use extern "C" for C-accessible globals * Work around more stringent type checking in Objective-C++ * NSMutableDictionary ivars aren't implicitly casted to NSDictionary * FSTMaybeDocument callback can't be passed a function that accepts FSTDocument * NSComparisonResult can't be multiplied by -1 without casting * Add a #include <inttypes.h> where needed * Avoid using C++ keywords as variables * Remove #if __cplusplus guards
* Schema migrations for LevelDB (#728)Gravatar Greg Soltis2018-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | * Implement schema versions * Style fixes * newlines, copyrights, assumptions * Fix nullability * Raw ptr -> shared_ptr * kVersionTableGlobal -> kVersionGlobalTable * Drop utils, move into static methods * Drop extra include * Add a few more comments * Move version constant into migrations file * formatting? * Fix comment
* Fix b/72502745: OnlineState changes cause limbo document crash. (#470) (#714)Gravatar Michael Lehenbauer2018-01-27
| | | | | | | | | | | | | | | | | | | | [PORT OF https://github.com/firebase/firebase-js-sdk/pull/470] Context: I made a previous change to raise isFromCache=true events when the client goes offline. As part of this change I added an assert for "OnlineState should not affect limbo documents", which it turns out was not valid because: * When we go offline, we set the view to non-current and call View.applyChanges(). * View.applyChanges() calls applyTargetChange() even though there's no target change and it recalculates limbo documents. * When the view is not current, we consider no documents to be in limbo. * Therefore all limbo documents are removed and so applyChanges() ends up returning unexpected LimboDocumentChanges. Fix: I've modified the View logic so that we don't recalculate limbo documents (and generate LimboDocumentChanges) when the View is not current, so now my assert holds and there should be less spurious removal / re-adding of limbo documents.
* normalize and port the rest of Firebase/Port code (#713)Gravatar zxu2018-01-27
| | | | * normalize bits * normalize ordered_code
* port TargetIdGenerator to iOS (#709)Gravatar zxu2018-01-25
| | | | | | | | | | * port TargetIdGenerator to iOS * fix style * move pointer property to instance variable * TriggerTravis
* Cleanup imports and isEqual (#685)Gravatar Gil2018-01-21
| | | | | | | | | | * Fix headers * Fix isEqual verbosity * Fix isEqual for nullable properties * Fix nullability on FSTTestDocSnapshot
* Port comparison to C++ (#678)Gravatar Gil2018-01-19
| | | | | | | | | | | | | | | This reimplements our comparison functions as C++ Comparators and then provides compatibility shims for interoperating with existing Objective-C usage. A few specialized comparators aren't suitable for porting but only have a single usage (e.g. CompareBytes for comparing NSData * instances). In these cases I've moved them into the caller. * Use int32_t for typeof(ID) in FSTDocumentReference * Migrate callers of FSTComparison.h to Objective-C++ * Port comparison to C++ * Migrate usages of FSTComparison.h to C++ equivalents * Remove FSTComparison
* Listen sequence numbers (#675)Gravatar Greg Soltis2018-01-17
| | | | | | | | | | | | * Generate and save sequence numbers for listens * Add documentation * Fix include path * Fix unavailable comment * Review feedback
* Fix issue @morganchen12 discovered where we weren't properly creating ↵Gravatar Michael Lehenbauer2018-01-12
| | | | | | FIRQueryDocumentSnapshot instances. (#662)
* Fix import formatting (#660)Gravatar Paul Beusterien2018-01-12
|
* Fix FSTLocalDocumentsView to allow multiple mutations while offline (#644)Gravatar rsgowman2018-01-11
| | | | | * Fix FSTLocalDocumentsView to allow multiple mutations while offline. Previously, only the last mutation would actually be visible.
* Run style.sh (#636)Gravatar Michael Lehenbauer2018-01-10
| | | | Run style.sh (w/ clang-format version 6)
* Merge branch 'master' into mikelehen/merge-master-to-firestore-api-changesGravatar Michael Lehenbauer2018-01-09
|\
* | Fixing potential race in ServerTimestamp testsGravatar Sebastian Schmidt2018-01-05
| |
* | Rename all the onlineStateChanged methods to applyChangedOnlineState. (#574)Gravatar Michael Lehenbauer2017-12-19
| |
* | Firestore `isEqual()` on Public Types (#569)Gravatar zxu2017-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add bone code for new isEqual and unit test for old isEqual * add bone code for `FIRCollectionReference`, `FIRDocumentSnapshot`, `FIRFieldValue`, `FIRQuerySnapshot`, `FIRSnapshotMetadata`; * change inconsistenciness of `FIRFieldPath.isEqual` implementation; * add unit test (and file) for `FIRDocumentReferenceTest.m`, `FIRFieldPathTest.m`, `FIRQueryTests.testEquals`; `FIRGeoPoint` already has test and Blob is internal type. * Implement isEqual for FIRCollectionReference adding the working code and unit test. * implement isEqual for FIRSnapshotMetadata * Implement isEqual for FIRDocumentSnapshot * Implement isEqual for FIRQuerySnapshot * (un)implement `isEqual` for `FIRFieldValue` Since `FIRFieldValue` both types are singleton, we do not need override `isEqual`. Add test to test the default `NSObject` `isEqual` works just fine. * fix style with `scripts/style.sh` * Implement hash for those with overridden isEqual without hash yet. * refactor to use test helper functions -- FSTTestFirestore, FSTTestPath, FSTTestDocKey * refactor using test helper `FSTTestDocSnapshot`, `FSTTestFieldPath`, `FSTTestQuery`, `FSTTestDoc` * refactoring to use test helper method `FSTTestQuerySnapshot`, * remove unneccessary nil-check, check isKindOfClass instead of isEqual * refactoring: adding `FSTAPIHelpers.{h,m}`, `FSTTest{Collection,Document}Ref`, better naming and style fix * a file forgot in last commit * mainly clean up import and some minor refactoring * fix style via style.sh * minor style fix * add pragma ignored -Wnonnull
| * Use angle brackets for nonlocal #includes in Firestore (#580)Gravatar Gil2017-12-19
| |
* | Clean up warnings (#578)Gravatar Gil2017-12-18
| | | | | | | | | | * Clean up warnings * Remove optional parens around ifs
* | Expose network management (#566)Gravatar Greg Soltis2017-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Expose network management in public API * Clean up a few more references to the internal access of network management * Move test * Update comments * Swap _Nullable for nullable * Fix comment * Add tests, including swift * Styling
* | Test cleanup: Adds a helper for waiting for FSTVoidErrorBlock callbacks.Gravatar Michael Lehenbauer2017-12-18
| | | | | | | | | | | | | | * Add helper for waiting for FSTVoidErrorBlock callbacks. * Remove errorEventHandler from FSTEventAccumulator.h too. * Add synchronous enableNetwork / disableNetwork helpers. * Workaround for batch writes test flakiness.
* | Fixing return type of verifySnapshotWithResolvedTimestampsGravatar Sebastian Schmidt2017-12-18
| | | | | | | | This should address a crash that happens when a debugger is attached
* | b/68276665: Raise isFromCache=true events when offline (#567)Gravatar Michael Lehenbauer2017-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Plumbs FSTOnlineState changes through to views. * View sets this.current to false on FSTOnlineStateFailed, triggering isFromCache=true events. It will automatically be returned to true once the listen is reestablished and we get a new CURRENT message. * Updated tests (and added one new one) to verify behavior. * Unifies setOnlineStateToUnknown, setOnlineStateToHealthy, and updateAndBroadcastOnlineState into a single updateOnlineState method. * Split disableNetwork into (public) disableNetwork and (private) disableNetworkWithTargetOnlineState methods.. * Some miscellaneous comment cleanup. * Add missing comment per CR feedback.
* | MergeGravatar Sebastian Schmidt2017-12-12
|\ \
| * \ Merge branch 'firestore-api-changes' into mrschmidt-timestampsGravatar Sebastian Schmidt2017-12-12
| |\ \
* | | | Addressing commentsGravatar Sebastian Schmidt2017-12-12
| | | |
| * | | Addressing commentsGravatar Sebastian Schmidt2017-12-12
| | | |
| | * | Revisit commit method in FIRWriteBatch (#541)Gravatar zxu2017-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * revisit FIRWriteBatch commit * make commitWithCompletion completion nullable; * add commit; * add unit test; * add swift build test for commit; * update CHANGELOG.
* | | | Clang formatGravatar Sebastian Schmidt2017-12-10
| | | |
| | * | Running scripts/style.shGravatar Sebastian Schmidt2017-12-10
| | | |
* | | | Making DocumentSnapshot nullableGravatar Sebastian Schmidt2017-12-10
| |/ / |/| |
| * | Fixing commentGravatar Sebastian Schmidt2017-12-08
| | |
| * | Adding default optionGravatar Sebastian Schmidt2017-12-08
| | |
| * | Method renamesGravatar Sebastian Schmidt2017-12-07
| | |
| * | Addressing all review commentsGravatar Sebastian Schmidt2017-12-07
| | |
* | | Implement NSPredicate-based query (#531)Gravatar zxu2017-12-07
| |/ |/| | | | | | | | | * implement queryFilteredUsingPredicate in FIRQuery; * add unit test and integration test for queryFilteredUsingPredicate; * project change of adding the FIRQueryTests.m file; * refactoring queryFilteredUsingPredicate to split logic into two helpers;
| * Adding SnapshotOptions to deal with pending ServerTimestampsGravatar Sebastian Schmidt2017-12-05
|/
* Fix long line and run style (#517)Gravatar Paul Beusterien2017-11-30
|
* Move sources into firebase::firestore and internal namespaces (#494)Gravatar Gil2017-11-30
| | | | | | | * Move sources into firebase::firestore and internal namespaces Combine support and core/util packages; this distinction wasn't really paying its freight.
* Fix StringView to properly convert NSStrings (#509)Gravatar rsgowman2017-11-30
| | | | | | | | | NSStrings are utf16, so NSString::length returns the number of utf16 characters present in the string. When the string is entirely made up of US-ASCII characters, everything's fine. But when characters requiring 16 bits are present, the size calculations were incorrect. Fixed by calculating the length based on the destination character set (i.e. UTF8).
* Port autoid to C++ and remove FSTUtil (#475)Gravatar Gil2017-11-27
| | | | | | * Port autoid to C++ * Reimplement FSTUtil on top of firestore::CreateAutoId directly * Migrate FSTUtil callers to directly use firestore::CreateAutoId * Remove FSTUtil
* Change FSTExponentialBackoff to use firestore::SecureRandom directly (#492)Gravatar Gil2017-11-27
| | | | | * Migrate FSTExponentialBackoff to Objective-C++ * Change FSTExponentialBackoff to use firestore::SecureRandom directly
* Use a prefix scan when fetching documents matching a query. (#488)Gravatar rsgowman2017-11-22
| | | | Minor optimization (which is already present in the ts code).
* Buildable and interoperable source pods (#444)Gravatar Paul Beusterien2017-11-21
|
* Use NSPrincipalClass as the most reliable way to find tests. (#471)Gravatar Gil2017-11-17
| | | | | | | Unfortunately, using __attribute__((constructor)) doesn't really work because it races with all other constructors run pre-main. As a result it's possible for a test's constructor to run after registration. NSPrincipalClass gets instantiated only after all constructors have run.
* Use fully qualified imports in Firestore (#467)Gravatar Gil2017-11-16
| | | | | | | | | This simplifies the import process back into google3 and allows us to add additional directories to the project without needing to update the project files for each directory we add. This shows up most clearly in the change to Firestore/Example/Firestore.xcodeproj/project.pbxproj: this no longer needs to list essentially every directory in the project as a header search path. * Clang-format configuration for C++ files * Add support C++-only sources to the podspec * Podspec support for fully qualified imports * xcodeproj changes for fully-qualified imports * Use fully-qualified imports in Firestore sources
* Additional support for C++ sources in Firestore (#462)Gravatar Gil2017-11-16
| | | | | * Fix up style from previous PRs * Clang-format configuration for C++ files * Add support C++-only sources to the podspec