18GTEST_TEST(testMathExceptions, inputSizeMismatchIsAFatalExceptionAndCanTerminateWhenHandled)
20 std::stringstream deathRegex;
22 deathRegex <<
"Common-Utilities Fatal Error: ";
24#if GTEST_USES_POSIX_RE
25 deathRegex <<
"[(]testMathExceptions.hpp: *[0-9]*[)]\n\t";
26#elif GTEST_USES_SIMPLE_RE
27 deathRegex <<
"\\(testMathExceptions.hpp: \\d*\\)\n\t";
30 deathRegex <<
"Input sizes for x and y containers must be the same.\n";
32 DryChem::InputSizeMismatch exception1 {
"Common-Utilities", __FILE__, __LINE__};
40 catch (
const DryChem::InputSizeMismatch& except)
42 except.handleErrorWithMessage();
48GTEST_TEST(testMathExceptions, derivedExceptionsCanBeCaughtByBaseFatalException)
50 std::stringstream deathRegex;
52 deathRegex <<
"Common-Utilities Fatal Error: ";
54#if GTEST_USES_POSIX_RE
55 deathRegex <<
"[(]testMathExceptions.hpp: *[0-9]*[)]\n\t";
56#elif GTEST_USES_SIMPLE_RE
57 deathRegex <<
"\\(testMathExceptions.hpp: \\d*\\)\n\t";
60 deathRegex <<
"Input sizes for x and y containers must be the same.\n";
66 throw DryChem::InputSizeMismatch(
"Common-Utilities", __FILE__, __LINE__);
68 catch (
const DryChem::FatalException& except)
70 except.handleErrorWithMessage();
GTEST_TEST(testMathExceptions, inputSizeMismatchIsAFatalExceptionAndCanTerminateWhenHandled)
Definition testMathExceptions.hpp:18