X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.test.cc;h=9a29f71301cb8114b26e5b63bd55c81ed8d690fb;hb=8ec0b7ed2df36144b52df5aa40497fc5409c31f7;hp=3e5142878e2c364255adb97f2e326d35d20d4b7d;hpb=15ac5ae4166db4387b4a219b7c42f7fc5a9681a6;p=senf.git diff --git a/Utils/Exception.test.cc b/Utils/Exception.test.cc index 3e51428..9a29f71 100644 --- a/Utils/Exception.test.cc +++ b/Utils/Exception.test.cc @@ -41,7 +41,7 @@ BOOST_AUTO_UNIT_TEST(errnoException) { try { try { - throw senf::SystemException("::open()", ENOENT); + throw senf::SystemException("::open()", ENOENT) << "\nmore"; } catch(senf::Exception & e) { e << "\nx=" << 1 << boost::format("\ny=%d") % 2; @@ -50,7 +50,12 @@ BOOST_AUTO_UNIT_TEST(errnoException) } catch (senf::SystemException & e) { BOOST_CHECK_EQUAL( e.errorNumber(), ENOENT ); - BOOST_CHECK_EQUAL( e.errorString(), "No such file or directory"); + BOOST_CHECK_EQUAL( e.errorString(), "No such file or directory" ); + std::string what (e.what()); + std::string::size_type pos (what.find("-- \n")); + if (pos != std::string::npos) + what = std::string(what, pos+4); + BOOST_CHECK_EQUAL( what, "[No such file or directory] ::open()\nmore\nx=1\ny=2" ); } }