X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.test.cc;h=d3900627f5f4a0122c769ea6a5fef677db0931bb;hb=24ccc14a000ffeceb9e5b6d02f54d2e971a3aee8;hp=50e3c97712a7e00afc4c696d7edd4e8e60356c77;hpb=34378cabd0ef59515f60b8e535d50fd5488c84e2;p=senf.git diff --git a/Utils/Exception.test.cc b/Utils/Exception.test.cc index 50e3c97..d390062 100644 --- a/Utils/Exception.test.cc +++ b/Utils/Exception.test.cc @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -39,23 +39,19 @@ 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) << "\nmore"; } - 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.code(), ENOENT ); - BOOST_CHECK_EQUAL( e.what(), "::open(): (2) No such file or directory: x=1, y=2" ); + BOOST_CHECK_EQUAL( e.errorNumber(), ENOENT ); + BOOST_CHECK_EQUAL( e.errorString(), "No such file or directory" ); + BOOST_CHECK_EQUAL( e.what(), "[No such file or directory] ::open()\nmore\nx=1\ny=2" ); } }