diff --git a/mrw/exec_test.cpp b/mrw/exec_test.cpp index a216ba1..307bf45 100644 --- a/mrw/exec_test.cpp +++ b/mrw/exec_test.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.7 2004/12/20 13:21:21 marc + exception tests: each exception must be in an own test case + Revision 1.6 2004/12/14 20:30:10 marc added possibility to pass string to stdin of child process @@ -47,9 +50,11 @@ public: std::string res =mrw::Cmd("/bin/cat").execute("This is a test"); CPPUNIT_ASSERT(res=="This is a test"); } - void excTest() { - std::string res1 = (mrw::Cmd("/bin/false")).execute().result(); - std::string res2 = (mrw::Cmd("/bin/false")).execute("").result(); + void excTest1() { + std::string res = (mrw::Cmd("/bin/false")).execute().result(); + } + void excTest2() { + std::string res = (mrw::Cmd("/bin/false")).execute("").result(); } void unexpectedExc() throw(std::bad_exception) { std::string res = (mrw::Cmd("/bin/false")).execute().result(); @@ -57,7 +62,8 @@ public: CPPUNIT_TEST_SUITE(ExecTest); CPPUNIT_TEST(lsTest); CPPUNIT_TEST(catTest); - CPPUNIT_TEST_EXCEPTION(excTest, mrw::ExecutionFailedExc); + CPPUNIT_TEST_EXCEPTION(excTest1, mrw::ExecutionFailedExc); + CPPUNIT_TEST_EXCEPTION(excTest2, mrw::ExecutionFailedExc); CPPUNIT_TEST_EXCEPTION(unexpectedExc, std::bad_exception); CPPUNIT_TEST_SUITE_END(); };