From 5eea0f713c14ac17788b83e496f11903f8e2bbb0 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 11 Jan 2019 10:16:39 -0800 Subject: Export of internal Abseil changes. -- 70b243f160a2f0f222066f62e06cc4346aea683d by Gennadiy Civil : Replace tests with new googletest Test Suite APIs PiperOrigin-RevId: 228901526 -- 28fe449f416c3d3fe882ef3dfa4289b94be5f8af by CJ Johnson : Changes the style of enable_if on InlinedVector::insert(...) to match all others PiperOrigin-RevId: 228878640 -- 5b4732f783d16cfb19c8c42962201aafe12b3c0f by Abseil Team : Update the absl::FromDateTime() deprecation message to refer to absl::FromCivil(), the recommended replacement despite a slight change in behavior for skipped civil times. PiperOrigin-RevId: 228820837 -- ee77056d753bb8665236a173064af85d935acfc4 by Gennadiy Civil : Bump googletest to the latest PiperOrigin-RevId: 228792994 -- aebc04f76b83a26432dba8e6199c971d5b69df0f by CJ Johnson : Switches InlinedVector input/forward iterator tagged dispatch from callsite to template decorator PiperOrigin-RevId: 228771063 GitOrigin-RevId: 70b243f160a2f0f222066f62e06cc4346aea683d Change-Id: I5f8cd05685ff642eff81187b8e207a0bdbcf073a --- WORKSPACE | 6 +- absl/container/flat_hash_map_test.cc | 6 +- absl/container/flat_hash_set_test.cc | 6 +- absl/container/inlined_vector.h | 73 +++++++++++++--------- absl/container/inlined_vector_test.cc | 2 +- .../internal/hash_function_defaults_test.cc | 10 +-- .../internal/unordered_map_constructor_test.h | 2 +- .../container/internal/unordered_map_lookup_test.h | 2 +- .../internal/unordered_map_modifiers_test.h | 2 +- absl/container/internal/unordered_map_test.cc | 6 +- .../internal/unordered_set_constructor_test.h | 2 +- .../container/internal/unordered_set_lookup_test.h | 2 +- .../internal/unordered_set_modifiers_test.h | 2 +- absl/container/internal/unordered_set_test.cc | 6 +- absl/container/node_hash_map_test.cc | 6 +- absl/container/node_hash_set_test.cc | 6 +- absl/debugging/failure_signal_handler_test.cc | 6 +- absl/hash/hash_test.cc | 4 +- absl/numeric/int128_test.cc | 4 +- absl/strings/internal/str_format/convert_test.cc | 2 +- absl/synchronization/mutex_test.cc | 16 ++--- absl/time/time.h | 4 +- absl/types/variant_test.cc | 2 +- 23 files changed, 97 insertions(+), 80 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 72ef1398..49e2d3cb 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,9 +15,9 @@ http_archive( # GoogleTest/GoogleMock framework. Used by most unit-tests. http_archive( name = "com_google_googletest", - urls = ["https://github.com/google/googletest/archive/b4d4438df9479675a632b2f11125e57133822ece.zip"], # 2018-07-16 - strip_prefix = "googletest-b4d4438df9479675a632b2f11125e57133822ece", - sha256 = "5aaa5d566517cae711e2a3505ea9a6438be1b37fcaae0ebcb96ccba9aa56f23a", + urls = ["https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip"], # 2019-01-07 + strip_prefix = "googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb", + sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86", ) # Google benchmark. diff --git a/absl/container/flat_hash_map_test.cc b/absl/container/flat_hash_map_test.cc index 2c6f2515..ccc055f7 100644 --- a/absl/container/flat_hash_map_test.cc +++ b/absl/container/flat_hash_map_test.cc @@ -40,9 +40,9 @@ using MapTypes = Map, Map, Map>; -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashMap, ConstructorTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashMap, LookupTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashMap, ModifiersTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, ConstructorTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, LookupTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, ModifiersTest, MapTypes); TEST(FlatHashMap, StandardLayout) { struct Int { diff --git a/absl/container/flat_hash_set_test.cc b/absl/container/flat_hash_set_test.cc index e52fd532..afbe7748 100644 --- a/absl/container/flat_hash_set_test.cc +++ b/absl/container/flat_hash_set_test.cc @@ -40,9 +40,9 @@ using Set = using SetTypes = ::testing::Types, Set, Set, Set>; -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashSet, ConstructorTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashSet, LookupTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(FlatHashSet, ModifiersTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, ConstructorTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, LookupTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, ModifiersTest, SetTypes); TEST(FlatHashSet, EmplaceString) { std::vector v = {"a", "b"}; diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h index c2f9d44b..7c574aec 100644 --- a/absl/container/inlined_vector.h +++ b/absl/container/inlined_vector.h @@ -71,18 +71,31 @@ class InlinedVector { return static_cast(N); } + template + using IsAtLeastInputIterator = std::is_convertible< + typename std::iterator_traits::iterator_category, + std::input_iterator_tag>; + + template + using IsAtLeastForwardIterator = std::is_convertible< + typename std::iterator_traits::iterator_category, + std::forward_iterator_tag>; + template using DisableIfIntegral = absl::enable_if_t::value>; template - using EnableIfInputIterator = absl::enable_if_t::iterator_category, - std::input_iterator_tag>::value>; + using EnableIfAtLeastInputIterator = + absl::enable_if_t::value>; + + template + using EnableIfAtLeastForwardIterator = + absl::enable_if_t::value>; template - using IteratorCategory = - typename std::iterator_traits::iterator_category; + using DisableIfAtLeastForwardIterator = + absl::enable_if_t::value>; using rvalue_reference = typename A::value_type&&; @@ -130,8 +143,7 @@ class InlinedVector { InlinedVector(std::initializer_list init_list, const allocator_type& alloc = allocator_type()) : allocator_and_tag_(alloc) { - AppendRange(init_list.begin(), init_list.end(), - IteratorCategory{}); + AppendRange(init_list.begin(), init_list.end()); } // Creates an inlined vector with elements constructed from the provided @@ -144,7 +156,7 @@ class InlinedVector { InlinedVector(InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type()) : allocator_and_tag_(alloc) { - AppendRange(first, last, IteratorCategory{}); + AppendRange(first, last); } // Creates a copy of `other` using `other`'s allocator. @@ -422,8 +434,7 @@ class InlinedVector { // Replaces the contents of the inlined vector with copies of the elements in // the provided `std::initializer_list`. InlinedVector& operator=(std::initializer_list init_list) { - AssignRange(init_list.begin(), init_list.end(), - IteratorCategory{}); + AssignRange(init_list.begin(), init_list.end()); return *this; } @@ -500,15 +511,14 @@ class InlinedVector { // inlined vector with copies of the values in the provided // `std::initializer_list`. void assign(std::initializer_list init_list) { - AssignRange(init_list.begin(), init_list.end(), - IteratorCategory{}); + AssignRange(init_list.begin(), init_list.end()); } // Overload of `InlinedVector::assign()` to replace the contents of the // inlined vector with values constructed from the range [`first`, `last`). template * = nullptr> void assign(InputIterator first, InputIterator last) { - AssignRange(first, last, IteratorCategory{}); + AssignRange(first, last); } // `InlinedVector::resize()` @@ -593,11 +603,10 @@ class InlinedVector { // NOTE: The `enable_if` is intended to disambiguate the two three-argument // overloads of `insert()`. template > + EnableIfAtLeastInputIterator* = nullptr> iterator insert(const_iterator position, InputIterator first, InputIterator last) { - return InsertWithRange(position, first, last, - IteratorCategory()); + return InsertWithRange(position, first, last); } // `InlinedVector::emplace()` @@ -1077,8 +1086,9 @@ class InlinedVector { } } - template - void AssignRange(Iterator first, Iterator last, std::forward_iterator_tag) { + template * = nullptr> + void AssignRange(ForwardIterator first, ForwardIterator last) { auto length = std::distance(first, last); // Prefer reassignment to copy construction for elements. if (static_cast(length) <= size()) { @@ -1097,8 +1107,9 @@ class InlinedVector { } } - template - void AssignRange(Iterator first, Iterator last, std::input_iterator_tag) { + template * = nullptr> + void AssignRange(InputIterator first, InputIterator last) { // Optimized to avoid reallocation. // Prefer reassignment to copy construction for elements. iterator out = begin(); @@ -1109,8 +1120,9 @@ class InlinedVector { std::copy(first, last, std::back_inserter(*this)); } - template - void AppendRange(Iterator first, Iterator last, std::forward_iterator_tag) { + template * = nullptr> + void AppendRange(ForwardIterator first, ForwardIterator last) { auto length = std::distance(first, last); reserve(size() + length); if (allocated()) { @@ -1122,8 +1134,9 @@ class InlinedVector { } } - template - void AppendRange(Iterator first, Iterator last, std::input_iterator_tag) { + template * = nullptr> + void AppendRange(InputIterator first, InputIterator last) { std::copy(first, last, std::back_inserter(*this)); } @@ -1140,9 +1153,10 @@ class InlinedVector { return it_pair.first; } - template + template * = nullptr> iterator InsertWithRange(const_iterator position, ForwardIterator first, - ForwardIterator last, std::forward_iterator_tag) { + ForwardIterator last) { assert(position >= begin() && position <= end()); if (ABSL_PREDICT_FALSE(first == last)) return const_cast(position); @@ -1150,15 +1164,16 @@ class InlinedVector { auto n = std::distance(first, last); std::pair it_pair = ShiftRight(position, n); size_type used_spots = it_pair.second - it_pair.first; - ForwardIterator open_spot = std::next(first, used_spots); + auto open_spot = std::next(first, used_spots); std::copy(first, open_spot, it_pair.first); UninitializedCopy(open_spot, last, it_pair.second); return it_pair.first; } - template + template * = nullptr> iterator InsertWithRange(const_iterator position, InputIterator first, - InputIterator last, std::input_iterator_tag) { + InputIterator last) { assert(position >= begin() && position <= end()); size_type index = position - cbegin(); size_type i = index; diff --git a/absl/container/inlined_vector_test.cc b/absl/container/inlined_vector_test.cc index b3dcc7f0..9408ee9d 100644 --- a/absl/container/inlined_vector_test.cc +++ b/absl/container/inlined_vector_test.cc @@ -70,7 +70,7 @@ MATCHER_P(ValueIs, e, "") { // test_instance_tracker.h. template class InstanceTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(InstanceTest); +TYPED_TEST_SUITE_P(InstanceTest); // A simple reference counted class to make sure that the proper elements are // destroyed in the erase(begin, end) test. diff --git a/absl/container/internal/hash_function_defaults_test.cc b/absl/container/internal/hash_function_defaults_test.cc index 464baae0..e8f62503 100644 --- a/absl/container/internal/hash_function_defaults_test.cc +++ b/absl/container/internal/hash_function_defaults_test.cc @@ -77,14 +77,14 @@ struct EqString : ::testing::Test { hash_default_eq key_eq; }; -TYPED_TEST_CASE(EqString, StringTypes); +TYPED_TEST_SUITE(EqString, StringTypes); template struct HashString : ::testing::Test { hash_default_hash hasher; }; -TYPED_TEST_CASE(HashString, StringTypes); +TYPED_TEST_SUITE(HashString, StringTypes); TYPED_TEST(EqString, Works) { auto eq = this->key_eq; @@ -121,14 +121,14 @@ struct EqPointer : ::testing::Test { hash_default_eq key_eq; }; -TYPED_TEST_CASE(EqPointer, PointerTypes); +TYPED_TEST_SUITE(EqPointer, PointerTypes); template struct HashPointer : ::testing::Test { hash_default_hash hasher; }; -TYPED_TEST_CASE(HashPointer, PointerTypes); +TYPED_TEST_SUITE(HashPointer, PointerTypes); TYPED_TEST(EqPointer, Works) { int dummy; @@ -248,7 +248,7 @@ TYPED_TEST_P(StringLikeTest, HashEq) { EXPECT_NE(this->hash(this->a1), this->hash(this->b2)); } -TYPED_TEST_CASE(StringLikeTest, StringTypesCartesianProduct); +TYPED_TEST_SUITE(StringLikeTest, StringTypesCartesianProduct); } // namespace } // namespace container_internal diff --git a/absl/container/internal/unordered_map_constructor_test.h b/absl/container/internal/unordered_map_constructor_test.h index 87d6c3c3..e70c191a 100644 --- a/absl/container/internal/unordered_map_constructor_test.h +++ b/absl/container/internal/unordered_map_constructor_test.h @@ -29,7 +29,7 @@ namespace container_internal { template class ConstructorTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(ConstructorTest); +TYPED_TEST_SUITE_P(ConstructorTest); TYPED_TEST_P(ConstructorTest, NoArgs) { TypeParam m; diff --git a/absl/container/internal/unordered_map_lookup_test.h b/absl/container/internal/unordered_map_lookup_test.h index a3d21595..488e340d 100644 --- a/absl/container/internal/unordered_map_lookup_test.h +++ b/absl/container/internal/unordered_map_lookup_test.h @@ -26,7 +26,7 @@ namespace container_internal { template class LookupTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(LookupTest); +TYPED_TEST_SUITE_P(LookupTest); TYPED_TEST_P(LookupTest, At) { using T = hash_internal::GeneratedType; diff --git a/absl/container/internal/unordered_map_modifiers_test.h b/absl/container/internal/unordered_map_modifiers_test.h index 61ae7d63..2e1cd633 100644 --- a/absl/container/internal/unordered_map_modifiers_test.h +++ b/absl/container/internal/unordered_map_modifiers_test.h @@ -26,7 +26,7 @@ namespace container_internal { template class ModifiersTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(ModifiersTest); +TYPED_TEST_SUITE_P(ModifiersTest); TYPED_TEST_P(ModifiersTest, Clear) { using T = hash_internal::GeneratedType; diff --git a/absl/container/internal/unordered_map_test.cc b/absl/container/internal/unordered_map_test.cc index 40e799cd..2752cb76 100644 --- a/absl/container/internal/unordered_map_test.cc +++ b/absl/container/internal/unordered_map_test.cc @@ -29,9 +29,9 @@ using MapTypes = ::testing::Types< StatefulTestingEqual, Alloc>>>; -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedMap, ConstructorTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedMap, LookupTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedMap, ModifiersTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedMap, ConstructorTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedMap, LookupTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedMap, ModifiersTest, MapTypes); } // namespace } // namespace container_internal diff --git a/absl/container/internal/unordered_set_constructor_test.h b/absl/container/internal/unordered_set_constructor_test.h index 9516e5ba..8997046a 100644 --- a/absl/container/internal/unordered_set_constructor_test.h +++ b/absl/container/internal/unordered_set_constructor_test.h @@ -29,7 +29,7 @@ namespace container_internal { template class ConstructorTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(ConstructorTest); +TYPED_TEST_SUITE_P(ConstructorTest); TYPED_TEST_P(ConstructorTest, NoArgs) { TypeParam m; diff --git a/absl/container/internal/unordered_set_lookup_test.h b/absl/container/internal/unordered_set_lookup_test.h index 1421e7b6..69f43142 100644 --- a/absl/container/internal/unordered_set_lookup_test.h +++ b/absl/container/internal/unordered_set_lookup_test.h @@ -26,7 +26,7 @@ namespace container_internal { template class LookupTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(LookupTest); +TYPED_TEST_SUITE_P(LookupTest); TYPED_TEST_P(LookupTest, Count) { using T = hash_internal::GeneratedType; diff --git a/absl/container/internal/unordered_set_modifiers_test.h b/absl/container/internal/unordered_set_modifiers_test.h index 445dcec4..853c4e31 100644 --- a/absl/container/internal/unordered_set_modifiers_test.h +++ b/absl/container/internal/unordered_set_modifiers_test.h @@ -26,7 +26,7 @@ namespace container_internal { template class ModifiersTest : public ::testing::Test {}; -TYPED_TEST_CASE_P(ModifiersTest); +TYPED_TEST_SUITE_P(ModifiersTest); TYPED_TEST_P(ModifiersTest, Clear) { using T = hash_internal::GeneratedType; diff --git a/absl/container/internal/unordered_set_test.cc b/absl/container/internal/unordered_set_test.cc index 1281ce53..04533bf0 100644 --- a/absl/container/internal/unordered_set_test.cc +++ b/absl/container/internal/unordered_set_test.cc @@ -28,9 +28,9 @@ using SetTypes = std::unordered_set>>; -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedSet, ConstructorTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedSet, LookupTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(UnorderedSet, ModifiersTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedSet, ConstructorTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedSet, LookupTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(UnorderedSet, ModifiersTest, SetTypes); } // namespace } // namespace container_internal diff --git a/absl/container/node_hash_map_test.cc b/absl/container/node_hash_map_test.cc index bd789644..87ea4560 100644 --- a/absl/container/node_hash_map_test.cc +++ b/absl/container/node_hash_map_test.cc @@ -34,9 +34,9 @@ using MapTypes = ::testing::Types< StatefulTestingEqual, Alloc>>>; -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashMap, ConstructorTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashMap, LookupTest, MapTypes); -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashMap, ModifiersTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashMap, ConstructorTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashMap, LookupTest, MapTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashMap, ModifiersTest, MapTypes); using M = absl::node_hash_map>; diff --git a/absl/container/node_hash_set_test.cc b/absl/container/node_hash_set_test.cc index 7e498f0f..09cb7a98 100644 --- a/absl/container/node_hash_set_test.cc +++ b/absl/container/node_hash_set_test.cc @@ -34,9 +34,9 @@ using SetTypes = ::testing::Types< node_hash_set>>; -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashSet, ConstructorTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashSet, LookupTest, SetTypes); -INSTANTIATE_TYPED_TEST_CASE_P(NodeHashSet, ModifiersTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashSet, ConstructorTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashSet, LookupTest, SetTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashSet, ModifiersTest, SetTypes); TEST(NodeHashSet, MoveableNotCopyableCompiles) { node_hash_set> t; diff --git a/absl/debugging/failure_signal_handler_test.cc b/absl/debugging/failure_signal_handler_test.cc index ba520910..b0fe8f25 100644 --- a/absl/debugging/failure_signal_handler_test.cc +++ b/absl/debugging/failure_signal_handler_test.cc @@ -140,9 +140,9 @@ std::string SignalParamToString(const ::testing::TestParamInfo& info) { return result; } -INSTANTIATE_TEST_CASE_P(AbslDeathTest, FailureSignalHandlerDeathTest, - ::testing::ValuesIn(kFailureSignals), - SignalParamToString); +INSTANTIATE_TEST_SUITE_P(AbslDeathTest, FailureSignalHandlerDeathTest, + ::testing::ValuesIn(kFailureSignals), + SignalParamToString); #endif // GTEST_HAS_DEATH_TEST diff --git a/absl/hash/hash_test.cc b/absl/hash/hash_test.cc index 7b6fb2e7..224832b1 100644 --- a/absl/hash/hash_test.cc +++ b/absl/hash/hash_test.cc @@ -50,7 +50,7 @@ using absl::hash_internal::SpyHashState; template class HashValueIntTest : public testing::Test { }; -TYPED_TEST_CASE_P(HashValueIntTest); +TYPED_TEST_SUITE_P(HashValueIntTest); template SpyHashState SpyHash(const T& value) { @@ -273,7 +273,7 @@ TEST(HashTest, NoOpsAreEquivalent) { template class HashIntTest : public testing::Test { }; -TYPED_TEST_CASE_P(HashIntTest); +TYPED_TEST_SUITE_P(HashIntTest); TYPED_TEST_P(HashIntTest, BasicUsage) { EXPECT_NE(Hash()({}), Hash()(0)); diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc index dfe3475a..81c868d7 100644 --- a/absl/numeric/int128_test.cc +++ b/absl/numeric/int128_test.cc @@ -51,7 +51,7 @@ template class Uint128FloatTraitsTest : public ::testing::Test {}; typedef ::testing::Types FloatingPointTypes; -TYPED_TEST_CASE(Uint128IntegerTraitsTest, IntegerTypes); +TYPED_TEST_SUITE(Uint128IntegerTraitsTest, IntegerTypes); TYPED_TEST(Uint128IntegerTraitsTest, ConstructAssignTest) { static_assert(std::is_constructible::value, @@ -62,7 +62,7 @@ TYPED_TEST(Uint128IntegerTraitsTest, ConstructAssignTest) { "TypeParam must not be assignable from absl::uint128"); } -TYPED_TEST_CASE(Uint128FloatTraitsTest, FloatingPointTypes); +TYPED_TEST_SUITE(Uint128FloatTraitsTest, FloatingPointTypes); TYPED_TEST(Uint128FloatTraitsTest, ConstructAssignTest) { static_assert(std::is_constructible::value, diff --git a/absl/strings/internal/str_format/convert_test.cc b/absl/strings/internal/str_format/convert_test.cc index 32f8a0f9..5d77856d 100644 --- a/absl/strings/internal/str_format/convert_test.cc +++ b/absl/strings/internal/str_format/convert_test.cc @@ -232,7 +232,7 @@ TEST_F(FormatConvertTest, Enum) { template class TypedFormatConvertTest : public FormatConvertTest { }; -TYPED_TEST_CASE_P(TypedFormatConvertTest); +TYPED_TEST_SUITE_P(TypedFormatConvertTest); std::vector AllFlagCombinations() { const char kFlags[] = {'-', '#', '0', '+', ' '}; diff --git a/absl/synchronization/mutex_test.cc b/absl/synchronization/mutex_test.cc index b2820e20..92fcd53d 100644 --- a/absl/synchronization/mutex_test.cc +++ b/absl/synchronization/mutex_test.cc @@ -610,9 +610,9 @@ TEST_P(CondVarWaitDeadlock, Test) { waiter2.reset(); // "join" waiter2 } -INSTANTIATE_TEST_CASE_P(CondVarWaitDeadlockTest, CondVarWaitDeadlock, - ::testing::Range(0, 8), - ::testing::PrintToStringParamName()); +INSTANTIATE_TEST_SUITE_P(CondVarWaitDeadlockTest, CondVarWaitDeadlock, + ::testing::Range(0, 8), + ::testing::PrintToStringParamName()); // -------------------------------------------------------- // Test for fix of bug in DequeueAllWakeable() @@ -1367,8 +1367,8 @@ std::vector MakeTimeoutTestParamValues() { } // Instantiate `TimeoutTest` with `MakeTimeoutTestParamValues()`. -INSTANTIATE_TEST_CASE_P(All, TimeoutTest, - testing::ValuesIn(MakeTimeoutTestParamValues())); +INSTANTIATE_TEST_SUITE_P(All, TimeoutTest, + testing::ValuesIn(MakeTimeoutTestParamValues())); TEST_P(TimeoutTest, Await) { const TimeoutTestParam params = GetParam(); @@ -1548,9 +1548,9 @@ static std::vector AllThreadCountValues() { class MutexVariableThreadCountTest : public ::testing::TestWithParam {}; // Instantiate the above with AllThreadCountOptions(). -INSTANTIATE_TEST_CASE_P(ThreadCounts, MutexVariableThreadCountTest, - ::testing::ValuesIn(AllThreadCountValues()), - ::testing::PrintToStringParamName()); +INSTANTIATE_TEST_SUITE_P(ThreadCounts, MutexVariableThreadCountTest, + ::testing::ValuesIn(AllThreadCountValues()), + ::testing::PrintToStringParamName()); // Reduces iterations by some factor for slow platforms // (determined empirically). diff --git a/absl/time/time.h b/absl/time/time.h index ae3b3fad..3cf9ac02 100644 --- a/absl/time/time.h +++ b/absl/time/time.h @@ -1149,7 +1149,9 @@ TimeConversion ConvertDateTime(int64_t year, int mon, int day, int hour, // absl::Time t = absl::FromDateTime(2017, 9, 26, 9, 30, 0, lax); // // t = 2017-09-26 09:30:00 -0700 // -// Deprecated. Use `absl::TimeZone::At(CivilSecond).pre`. +// Deprecated. Use `absl::FromCivil(CivilSecond, TimeZone)`. Note that the +// behavior of `FromCivil()` differs from `FromDateTime()` for skipped civil +// times. If you care about that see `absl::TimeZone::At(absl::CivilSecond)`. inline Time FromDateTime(int64_t year, int mon, int day, int hour, int min, int sec, TimeZone tz) { return ConvertDateTime(year, mon, day, hour, min, sec, tz).pre; diff --git a/absl/types/variant_test.cc b/absl/types/variant_test.cc index f47f3a72..80e8467e 100644 --- a/absl/types/variant_test.cc +++ b/absl/types/variant_test.cc @@ -257,7 +257,7 @@ class NonCopyable { // each type. template class VariantTypesTest : public ::testing::Test {}; -TYPED_TEST_CASE(VariantTypesTest, VariantTypes); +TYPED_TEST_SUITE(VariantTypesTest, VariantTypes); //////////////////// // [variant.ctor] // -- cgit v1.2.3