21 #include "gtest/gtest.h" 37 constexpr
const char* what_arg =
"The quick brown fox jumps over the lazy dog";
40 void ExpectThrowChar(
void (*f)(
const char*)) {
43 FAIL() <<
"Didn't throw";
44 }
catch (
const E& e) {
45 EXPECT_STREQ(e.what(), what_arg);
50 void ExpectThrowString(
void (*f)(
const std::string&)) {
53 FAIL() <<
"Didn't throw";
54 }
catch (
const E& e) {
55 EXPECT_STREQ(e.what(), what_arg);
60 void ExpectThrowNoWhat(
void (*f)()) {
63 FAIL() <<
"Didn't throw";
64 }
catch (
const E& e) {
68 TEST(ThrowHelper, Test) {
void ThrowStdLogicError(const std::string &what_arg)
void ThrowStdInvalidArgument(const std::string &what_arg)
void ThrowStdLengthError(const std::string &what_arg)
void ThrowStdBadFunctionCall()
void ThrowStdOutOfRange(const std::string &what_arg)
void ThrowStdDomainError(const std::string &what_arg)
void ThrowStdRuntimeError(const std::string &what_arg)
void ThrowStdRangeError(const std::string &what_arg)
void ThrowStdUnderflowError(const std::string &what_arg)
TEST(Symbolize, Unimplemented)
void ThrowStdOverflowError(const std::string &what_arg)