From 9613678332c976568272c8f4a78631a29159271d Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 30 Apr 2018 11:44:26 -0700 Subject: - 60c1f40a5e0bc33f93392ff6827528072d749a29 Move ExceptionSafetyTester from the absl:: namespace to t... by Abseil Team - abd40a98f8ae746eb151e777ea8a8b5223d68a4b Splits the NoThrow flags into TypeSpec and AllocSpec flag... by Abseil Team - c16d0b5509b36679b384147b474135e7951afccf Change the abbreviation for the breakdowns of InfinitePas... by Abseil Team - 8ac104351764f23d666b52dce7536a34c05abf00 Use ABSL_CONST_INIT with std::atomic variables in static ... by Matt Armstrong GitOrigin-RevId: 60c1f40a5e0bc33f93392ff6827528072d749a29 Change-Id: I9d45a6ed30ed32ae57e9eff93f4205dbcd71feb2 --- absl/types/any_exception_safety_test.cc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'absl/types') diff --git a/absl/types/any_exception_safety_test.cc b/absl/types/any_exception_safety_test.cc index 7a72e7263922..daa82e72dc0d 100644 --- a/absl/types/any_exception_safety_test.cc +++ b/absl/types/any_exception_safety_test.cc @@ -20,12 +20,12 @@ #include "gtest/gtest.h" #include "absl/base/internal/exception_safety_testing.h" -using Thrower = absl::ThrowingValue<>; +using Thrower = testing::ThrowingValue<>; using NoThrowMoveThrower = - absl::ThrowingValue; + testing::ThrowingValue; using ThrowerList = std::initializer_list; using ThrowerVec = std::vector; -using ThrowingAlloc = absl::ThrowingAllocator; +using ThrowingAlloc = testing::ThrowingAllocator; using ThrowingThrowerVec = std::vector; namespace { @@ -81,30 +81,31 @@ testing::AssertionResult AnyIsEmpty(absl::any* a) { TEST(AnyExceptionSafety, Ctors) { Thrower val(1); - absl::TestThrowingCtor(val); + testing::TestThrowingCtor(val); Thrower copy(val); - absl::TestThrowingCtor(copy); + testing::TestThrowingCtor(copy); - absl::TestThrowingCtor(absl::in_place_type_t(), 1); + testing::TestThrowingCtor(absl::in_place_type_t(), 1); - absl::TestThrowingCtor(absl::in_place_type_t(), - ThrowerList{val}); + testing::TestThrowingCtor(absl::in_place_type_t(), + ThrowerList{val}); - absl::TestThrowingCtor, - ThrowerList, ThrowingAlloc>( + testing::TestThrowingCtor, + ThrowerList, ThrowingAlloc>( absl::in_place_type_t(), {val}, ThrowingAlloc()); } TEST(AnyExceptionSafety, Assignment) { auto original = - absl::any(absl::in_place_type_t(), 1, absl::no_throw_ctor); + absl::any(absl::in_place_type_t(), 1, testing::no_throw_ctor); auto any_is_strong = [original](absl::any* ap) { return testing::AssertionResult(ap->has_value() && absl::any_cast(original) == absl::any_cast(*ap)); }; - auto any_strong_tester = absl::MakeExceptionSafetyTester() + auto any_strong_tester = testing::MakeExceptionSafetyTester() .WithInitialValue(original) .WithInvariants(AnyInvariants, any_is_strong); @@ -126,7 +127,7 @@ TEST(AnyExceptionSafety, Assignment) { return testing::AssertionResult{!ap->has_value()}; }; auto strong_empty_any_tester = - absl::MakeExceptionSafetyTester() + testing::MakeExceptionSafetyTester() .WithInitialValue(absl::any{}) .WithInvariants(AnyInvariants, empty_any_is_strong); @@ -138,14 +139,14 @@ TEST(AnyExceptionSafety, Assignment) { #if !defined(ABSL_HAVE_STD_ANY) TEST(AnyExceptionSafety, Emplace) { auto initial_val = - absl::any{absl::in_place_type_t(), 1, absl::no_throw_ctor}; - auto one_tester = absl::MakeExceptionSafetyTester() + absl::any{absl::in_place_type_t(), 1, testing::no_throw_ctor}; + auto one_tester = testing::MakeExceptionSafetyTester() .WithInitialValue(initial_val) .WithInvariants(AnyInvariants, AnyIsEmpty); auto emp_thrower = [](absl::any* ap) { ap->emplace(2); }; auto emp_throwervec = [](absl::any* ap) { - std::initializer_list il{Thrower(2, absl::no_throw_ctor)}; + std::initializer_list il{Thrower(2, testing::no_throw_ctor)}; ap->emplace(il); }; auto emp_movethrower = [](absl::any* ap) { -- cgit 1.4.1