Skip to content

Commit 8ab4575

Browse files
committed
Add test
1 parent 3269329 commit 8ab4575

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testexceptionsafety.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,19 @@ class TestExceptionSafety : public TestFixture {
506506
"}\n");
507507
ASSERT_EQUALS("[test.cpp:6:5]: (error) Exception thrown in function that is an entry point. [throwInEntryPoint]\n",
508508
errout_str());
509+
510+
check("void f(int i) {\n"
511+
" if (i < 2)\n"
512+
" throw 0;\n"
513+
"}\n"
514+
"int main(int argc, char* argv[]) {\n"
515+
" try {\n"
516+
" f(argc);\n"
517+
" } catch (...) {\n"
518+
" return 1;\n"
519+
" }\n"
520+
"}\n");
521+
ASSERT_EQUALS("", errout_str());
509522
}
510523
};
511524

0 commit comments

Comments
 (0)