aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/util
Commit message (Collapse)AuthorAge
* Fix Firestore source errors under VS2017 (#1515)Gravatar Gil2018-07-11
| | | | | | | | | | | | | | | | * Project file updates from sync_project.rb * Fix misc compile errors under VS2017 * Fix util/hashing under VS2017 std::hash<int> is not just a pass through in Microsoft's STL. * Disable unsafe code warnings in VS2017 ... where comparing against a reference implementation that has no easy safe equivalent. * Handle drive letters in paths on Windows
* C++ migration: add a C++ implementation of `FSTExponentialBackoff` (#1465)Gravatar Konstantin Varlamov2018-07-10
| | | | | | | | | | | This is a pretty close port of `FSTExponentialBackoff`. The changes are pretty minor: * delay is calculated using <chrono> duration types, not plain numbers, which should be a little more type-safe; * split a piece of code into a ClampDelay function, because it's reasonably close to std::clamp; * rephrased the class-level comment to make it clearer that the first attempt always has delay = 0; * added simple tests (other platforms don't have tests for this). Also make sure that canceling a DelayedOperation is always valid.
* Install googletest (#1461)Gravatar Gil2018-06-26
| | | Also add FindGMock to Find gmock after installation
* Create Status objects from errno (#1374)Gravatar Gil2018-06-12
| | | | | | | | | | | * Add a portable interface to strerror * Add Status::FromErrno * Add strerror_test.cc to the Xcode project * Use glibc feature selection macros instead of return-type overloads * Fix tensorflow references
* Fix support scripts on Linux (#1385)Gravatar Gil2018-06-06
| | | | | | | | | | * Make it possible to run style.sh on Linux Needs clang-format in a nonstandard location, but can be made to work. * Fix lint.sh on Linux * Fix multiline comment error
* Add pathname manipulation utilities (#1376)Gravatar Gil2018-06-05
|
* Build cleanup (#1375)Gravatar Gil2018-06-04
| | | | | | * Remove extraneous firebase_firestore_util_async_queue target * Remove unimplemented declaration in string_util.h
* Fix Firestore compilation under Xcode < 9.2 (#1367)Gravatar Gil2018-06-01
| | | | | | | | | | | | | | | | * Don't rely on specialization failure to determine when std::hash is unavailable. Instead manually declare the conditions under which std::hash should be defined. * Fix detection of Objective-C classes in Xcode < 9.2 std::is_base_of<NSObject, NSString>{} is false there so the overloads defined for Objective-C types weren't getting enabled. * Add explicit tests for StringFormat using Objective-C objects * Add explicit tests for HasStdHash
* Reimplement C++ logging (#1313)Gravatar Gil2018-05-23
| | | | | | | * Add direct support for formatting Objective-C objects * Rewrite log.h * Convert FSTWarn to LOG_WARN * Convert FSTLog to LOG_DEBUG * Remove FSTLogger
* Add a HARD_ASSERT C++ assertion macro (#1304)Gravatar Gil2018-05-22
| | | | | | * Add HARD_ASSERT * Use HARD_ASSERT * Remove FIREBASE_ASSERT * Remove StringPrintf
* Add a C++ native StringFormat (#1289)Gravatar Gil2018-05-21
| | | | * Add StringFormat * Use StringFormat
* Firestore C++: make FSTDispatchQueue delegate to C++ implementation (#1240)Gravatar Konstantin Varlamov2018-05-11
| | | | | FSTDispatchQueue now doesn't contain any logic of its own and instead just passes through all method calls to AsyncQueue (backed by an ExecutorLibdispatch).
* Firestore C++: quick fix for flaky tests in AsyncQueue and Executor (#1245)Gravatar Konstantin Varlamov2018-05-10
|
* Firestore C++: add missing tests for Executor (#1247)Gravatar Konstantin Varlamov2018-05-10
|
* Firestore C++: in AsyncQueue, use steady_clock instead of system_clock. (#1246)Gravatar Konstantin Varlamov2018-05-09
| | | | | This should prevent weird bugs due to system time readjustments. Because operations are scheduled relative to now, the fact that the resulting timepoint isn't in Unix epoch shouldn't matter.
* Firestore C++: compile ExecutorLibdispatch in Objective-C++ mode (#1237)Gravatar Konstantin Varlamov2018-05-08
| | | | | | | | dispatch_queue_t is defined differently in libdispatch depending on whether the library header is being include from Objective-C (or Objective-C++) code, or else from C or C++ code. Make sure that all source files in Firestore that include executor_libdispatch.h are compiled in the same mode (Objective-C++) to avoid linker errors.
* C++ migration: add AsyncQueue, the C++ version of FSTDispatchQueue (#1176)Gravatar Konstantin Varlamov2018-05-07
| | | | | | | | | | | | AsyncQueue is a queue that executes given operations asynchronously, enforcing that only a single operation is executing at any given time, and that in-progress operations don't spawn more operations. The actual execution is delegated to a platform-specific executor. Executor is an interface for a FIFO queue that executes given operations serially. Two implementations of Executor, one using libdispatch and the other using C++11 standard library, are provided. AsyncQueue is not used anywhere in the code base at this point.
* Define a general hashing utility in C++ (#1195)Gravatar Gil2018-05-01
| | | | | This is good enough to make it possible for the new C++ code to interoperate with existing Objective-C code where `-hash` is required if you override `-isEqual:`.
* 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
* Make it easier to consume sub-libraries within util (#1065)Gravatar Gil2018-04-10
|
* 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
* Add Status and StatusOr (#935)Gravatar rsgowman2018-03-19
| | | | * Pull in status files from tensorflow * Add missing dependency to immutable library
* Add absl_strings to firebase_firestore_util_test dependencies (#725)Gravatar rsgowman2018-01-29
| | | Required to link the test on rodete.
* Import iterator_adaptors from google3 (#718)Gravatar Gil2018-01-29
| | | | | | | | | | | | * Import iterator_adapters from google3 * Remove -Wconversion which is annoyingly hard to satisfy * Strip dependency on absl_container from iterator_adapters_test * Format and lint iterator_adaptors * More flexible copyright checking in Travis
* 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
* normalize and port the rest of Firebase/Port code (#713)Gravatar zxu2018-01-27
| | | | * normalize bits * normalize ordered_code
* normalize string_util (#708)Gravatar zxu2018-01-25
| | | | * refactoring string_util * port string_util to iOS
* 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
* Add platform detection logic for SecureRandom (#676)Gravatar Gil2018-01-19
| | | | | | | | | | | | | | | * Add CMake platform detection logic for SecureRandom Now only builds secure_random_arc4random.cc if available. Remove firebase/firestore/base/port.h. Nothing else was in that directory. * Add a SecureRandom implementation that uses OpenSSL This is usable on Linux, Windows, and Android * Properly check return from RAND_bytes
* Add a cc_library to the CMake build (#670)Gravatar Gil2018-01-17
| | | | | | | | | | | | | | | | | | | | | | * Rewrite cc_test to take named arguments Cut down on build file verbosity by having cc_test take SOURCES and DEPENDS. The separate invocation of target_link_libraries is no longer necessary. * Add a cc_library rule to parallel cc_test This cuts down on build file verbosity. * Automatically add OBJC_FLAGS to cc_libraries if applicable * Exclude platform-specific libraries from 'all' This is makes it possible to declare this kind of library unconditionally. Usage within a test or as a dependency will actually trigger building. * Restore secure_random_test.cc; clean-up comments
* Fix C++ lint errors (#668)Gravatar Gil2018-01-17
| | | | | | | | | | | | | * Misc style.sh fixes * Allow test-only to use a revision; to check your changes since master: ./scripts/style.sh test-only master * Avoid diffing deleted files * 80 columns * Fix C++ lint errors
* Enable warnings in the CMake build (#669)Gravatar Gil2018-01-16
| | | | | | * Enable warnings when building with GCC or clang * Fix warnings
* implement C++ assert (stdio, apple) (#612)Gravatar zxu2018-01-08
| | | | | | | | | * implement C++ assert (stdio, apple) * Update tests for firebase_firestore_util renames * renaming `assert.h` to `firebase_assert.h` * refactoring to a common `WrapNSStringNoCopy()`
* Port StringPrintf from //base (#624)Gravatar Gil2018-01-08
| | | | | | | | | | | | | | | | | | | | | * Port StringPrintf from //base. Prefer this to approaches based on variadic templates. While the variadic template mechanisms are strictly safer, they result in binary bloat we can't afford. This is essentially the same StringPrintf previously open sourced as a part of protobuf, though updated for C++11 which saves a copy and a temporary buffer on the heap. * Add abseil as a subdirectory of Firestore This saves having to redefine all the libraries that abseil defines as imported libraries. * Rename firebase_firesture_util_log_* targets Cut the log out of the name to reflect that these will get more components besides just logging.
* Build and test both C++ loggers where possible (#595)Gravatar Gil2018-01-03
| | | | | | | | | | | | | | | | | | * Rename FIREBASE_BINARY_DIR to FIREBASE_INSTALL_DIR Make this consistent with the outer superbuild and also make the association with CMAKE_INSTALL_PREFIX more obvious. * Build and test log_stdio separate from the rest of util This is in preparation for adding a test for log_apple * Build and test log_apple under CMake Also add notes about how FIRLogger's debug mode can break this test * Refactor log_apple to cut down duplicate switch statements There's also a slight reduction in final binary size.
* implement C++ logger (#575)Gravatar zxu2017-12-20
| | | | | | | | | | | | | * implement logger, apple impl and other impl, with test. * some minor fixes * re-organize cmake build rules; * fix bugs in log_apple.mm; * style fix by style.sh * Complete removal of LogAssert
* Use angle brackets for nonlocal #includes in Firestore (#580)Gravatar Gil2017-12-19
|
* 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.