Changes imported from Abseil "staging" branch:
- 95e20a66bfa6104937ec92722b04a9c0ca0443dc Make ThrowingBool convertible to bool. by Xiaoyi Zhang <zhangxy@google.com> GitOrigin-RevId: 95e20a66bfa6104937ec92722b04a9c0ca0443dc Change-Id: I7a1dcb53b0764b24482ee1886276b267c8cb83c2
This commit is contained in:
parent
2661ed4998
commit
eed36bfba0
2 changed files with 18 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue