aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/types/optional_exception_safety_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/optional_exception_safety_test.cc')
-rw-r--r--absl/types/optional_exception_safety_test.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/absl/types/optional_exception_safety_test.cc b/absl/types/optional_exception_safety_test.cc
index 31eb66d..d117ee5 100644
--- a/absl/types/optional_exception_safety_test.cc
+++ b/absl/types/optional_exception_safety_test.cc
@@ -43,7 +43,7 @@ bool ValueThrowsBadOptionalAccess(const OptionalT& optional) try {
}
template <typename OptionalT>
-AssertionResult CheckInvariants(OptionalT* optional_ptr) {
+AssertionResult OptionalInvariants(OptionalT* optional_ptr) {
// Check the current state post-throw for validity
auto& optional = *optional_ptr;
@@ -123,8 +123,8 @@ TEST(OptionalExceptionSafety, NothrowConstructors) {
TEST(OptionalExceptionSafety, Emplace) {
// Test the basic guarantee plus test the result of optional::has_value()
// is false in all cases
- auto disengaged_test = MakeExceptionSafetyTester().WithInvariants(
- CheckInvariants<Optional>, CheckDisengaged<Optional>);
+ auto disengaged_test = MakeExceptionSafetyTester().WithContracts(
+ OptionalInvariants<Optional>, CheckDisengaged<Optional>);
auto disengaged_test_empty = disengaged_test.WithInitialValue(Optional());
auto disengaged_test_nonempty =
disengaged_test.WithInitialValue(Optional(kInitialInteger));
@@ -147,11 +147,11 @@ TEST(OptionalExceptionSafety, EverythingThrowsSwap) {
// Test the basic guarantee plus test the result of optional::has_value()
// remains the same
auto test =
- MakeExceptionSafetyTester().WithInvariants(CheckInvariants<Optional>);
+ MakeExceptionSafetyTester().WithContracts(OptionalInvariants<Optional>);
auto disengaged_test_empty = test.WithInitialValue(Optional())
- .WithInvariants(CheckDisengaged<Optional>);
+ .WithContracts(CheckDisengaged<Optional>);
auto engaged_test_nonempty = test.WithInitialValue(Optional(kInitialInteger))
- .WithInvariants(CheckEngaged<Optional>);
+ .WithContracts(CheckEngaged<Optional>);
auto swap_empty = [](Optional* optional_ptr) {
auto empty = Optional();
@@ -192,11 +192,11 @@ TEST(OptionalExceptionSafety, CopyAssign) {
// Test the basic guarantee plus test the result of optional::has_value()
// remains the same
auto test =
- MakeExceptionSafetyTester().WithInvariants(CheckInvariants<Optional>);
+ MakeExceptionSafetyTester().WithContracts(OptionalInvariants<Optional>);
auto disengaged_test_empty = test.WithInitialValue(Optional())
- .WithInvariants(CheckDisengaged<Optional>);
+ .WithContracts(CheckDisengaged<Optional>);
auto engaged_test_nonempty = test.WithInitialValue(Optional(kInitialInteger))
- .WithInvariants(CheckEngaged<Optional>);
+ .WithContracts(CheckEngaged<Optional>);
auto copyassign_nonempty = [](Optional* optional_ptr) {
auto nonempty =
@@ -218,11 +218,11 @@ TEST(OptionalExceptionSafety, MoveAssign) {
// Test the basic guarantee plus test the result of optional::has_value()
// remains the same
auto test =
- MakeExceptionSafetyTester().WithInvariants(CheckInvariants<Optional>);
+ MakeExceptionSafetyTester().WithContracts(OptionalInvariants<Optional>);
auto disengaged_test_empty = test.WithInitialValue(Optional())
- .WithInvariants(CheckDisengaged<Optional>);
+ .WithContracts(CheckDisengaged<Optional>);
auto engaged_test_nonempty = test.WithInitialValue(Optional(kInitialInteger))
- .WithInvariants(CheckEngaged<Optional>);
+ .WithContracts(CheckEngaged<Optional>);
auto moveassign_empty = [](Optional* optional_ptr) {
auto empty = Optional();