diff options
author | rsgowman <rgowman@google.com> | 2018-02-09 12:15:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 12:15:21 -0500 |
commit | 274fe52bbf817ef9d35638effb4de08454acfc6d (patch) | |
tree | d422177d355315a3314578c8554e4ebc86d1e042 /Firestore/core/test/firebase/firestore/model/resource_path_test.cc | |
parent | ecef4aa308c213c000d115123824d55482ffbdad (diff) |
cmake build fixes (#770)
* 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.
Diffstat (limited to 'Firestore/core/test/firebase/firestore/model/resource_path_test.cc')
-rw-r--r-- | Firestore/core/test/firebase/firestore/model/resource_path_test.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Firestore/core/test/firebase/firestore/model/resource_path_test.cc b/Firestore/core/test/firebase/firestore/model/resource_path_test.cc index 317a1db..378a5e3 100644 --- a/Firestore/core/test/firebase/firestore/model/resource_path_test.cc +++ b/Firestore/core/test/firebase/firestore/model/resource_path_test.cc @@ -29,18 +29,18 @@ namespace model { TEST(ResourcePath, Constructor) { const ResourcePath empty_path; EXPECT_TRUE(empty_path.empty()); - EXPECT_EQ(0, empty_path.size()); + EXPECT_EQ(0u, empty_path.size()); EXPECT_TRUE(empty_path.begin() == empty_path.end()); const ResourcePath path_from_list{{"rooms", "Eros", "messages"}}; EXPECT_FALSE(path_from_list.empty()); - EXPECT_EQ(3, path_from_list.size()); + EXPECT_EQ(3u, path_from_list.size()); EXPECT_TRUE(path_from_list.begin() + 3 == path_from_list.end()); std::vector<std::string> segments{"rooms", "Eros", "messages"}; const ResourcePath path_from_segments{segments.begin(), segments.end()}; EXPECT_FALSE(path_from_segments.empty()); - EXPECT_EQ(3, path_from_segments.size()); + EXPECT_EQ(3u, path_from_segments.size()); EXPECT_TRUE(path_from_segments.begin() + 3 == path_from_segments.end()); ResourcePath copied = path_from_list; @@ -96,8 +96,8 @@ TEST(ResourcePath, Parsing) { } TEST(ResourcePath, ParseFailures) { - ASSERT_DEATH_IF_SUPPORTED(ResourcePath::Parse("//"), ""); - ASSERT_DEATH_IF_SUPPORTED(ResourcePath::Parse("foo//bar"), ""); + ASSERT_ANY_THROW(ResourcePath::Parse("//")); + ASSERT_ANY_THROW(ResourcePath::Parse("foo//bar")); } } // namespace model |