X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.test.cc;h=5b2b95fa4049f4dcdda6113488dbea7dd219efac;hb=1d247d12d1759ffd77f456efe3a52f03dd289994;hp=686919a1ad145021e0c1bf61386b9ec3349c9605;hpb=445c71d8d242f4ce3d23d8db8d1faf909943cfec;p=senf.git diff --git a/Utils/Exception.test.cc b/Utils/Exception.test.cc index 686919a..5b2b95f 100644 --- a/Utils/Exception.test.cc +++ b/Utils/Exception.test.cc @@ -39,23 +39,18 @@ BOOST_AUTO_UNIT_TEST(errnoException) { - BOOST_CHECK_THROW( senf::throwErrno(), senf::SystemException ); - BOOST_CHECK_THROW( senf::throwErrno(ENOENT), senf::SystemException ); - BOOST_CHECK_THROW( senf::throwErrno(""), senf::SystemException ); - BOOST_CHECK_THROW( senf::throwErrno("", ENOENT), senf::SystemException ); - try { try { - senf::throwErrno("::open()", ENOENT); + throw senf::SystemException("::open()", ENOENT); } - catch(senf::SystemException & e) { - e << ": x=" << 1 << boost::format(", y=%d") % 2; + catch(senf::Exception & e) { + e << "\nx=" << 1 << boost::format("\ny=%d") % 2; throw; } } catch (senf::SystemException & e) { BOOST_CHECK_EQUAL( e.errorNumber(), ENOENT ); - BOOST_CHECK_EQUAL( e.what(), "::open(): (2) No such file or directory: x=1, y=2" ); + BOOST_CHECK_EQUAL( e.what(), "::open(): (2) No such file or directory\nx=1\ny=2" ); } }