diff options
Diffstat (limited to 'absl/base/exception_safety_testing_test.cc')
-rw-r--r-- | absl/base/exception_safety_testing_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/absl/base/exception_safety_testing_test.cc b/absl/base/exception_safety_testing_test.cc index 5477b40a5bed..f8baf20c9360 100644 --- a/absl/base/exception_safety_testing_test.cc +++ b/absl/base/exception_safety_testing_test.cc @@ -18,6 +18,7 @@ #include <exception> #include <iostream> #include <list> +#include <type_traits> #include <vector> #include "gtest/gtest-spi.h" @@ -683,6 +684,18 @@ TEST(AllocInspectorTest, ConstructedTwice) { new (&storage) Tracked; }, "re-constructed"); + reinterpret_cast<Tracked*>(&storage)->~Tracked(); } + +TEST(ThrowingValueTraitsTest, RelationalOperators) { + ThrowingValue<> a, b; + EXPECT_TRUE((std::is_convertible<decltype(a == b), bool>::value)); + EXPECT_TRUE((std::is_convertible<decltype(a != b), bool>::value)); + EXPECT_TRUE((std::is_convertible<decltype(a < b), bool>::value)); + EXPECT_TRUE((std::is_convertible<decltype(a <= b), bool>::value)); + EXPECT_TRUE((std::is_convertible<decltype(a > b), bool>::value)); + EXPECT_TRUE((std::is_convertible<decltype(a >= b), bool>::value)); +} + } // namespace } // namespace absl |