18GTEST_TEST(testFileExceptions, fileNotFoundIsAFatalExceptionAndCanTerminateWhenHandled)
20 std::stringstream deathRegex;
22 deathRegex <<
"Common-Utilities Fatal Error: ";
24#if GTEST_USES_POSIX_RE
25 deathRegex <<
"[(]testFileExceptions.hpp: *[0-9]*[)]\n\t";
26#elif GTEST_USES_SIMPLE_RE
27 deathRegex <<
"\\(testFileExceptions.hpp: \\d*\\)\n\t";
30 deathRegex <<
"Could not find the requested file.\n";
32 DryChem::FileNotFound exception1 {
"Common-Utilities", __FILE__, __LINE__};
40 catch (
const DryChem::FileNotFound& except)
42 except.handleErrorWithMessage();
48GTEST_TEST(testFileExceptions, derivedExceptionsCanBeCaughtByBaseFatalException)
50 std::stringstream deathRegex;
52 deathRegex <<
"Common-Utilities Fatal Error: ";
54#if GTEST_USES_POSIX_RE
55 deathRegex <<
"[(]testFileExceptions.hpp: *[0-9]*[)]\n\t";
56#elif GTEST_USES_SIMPLE_RE
57 deathRegex <<
"\\(testFileExceptions.hpp: \\d*\\)\n\t";
60 deathRegex <<
"Could not find the requested file.\n";
66 throw DryChem::FileNotFound(
"Common-Utilities", __FILE__, __LINE__);
68 catch (
const DryChem::FatalException& except)
70 except.handleErrorWithMessage();
GTEST_TEST(testFileExceptions, fileNotFoundIsAFatalExceptionAndCanTerminateWhenHandled)
Definition testFileExceptions.hpp:18