X-Git-Url: https://git.llucax.com/software/posixx.git/blobdiff_plain/7b35c34eaa3ee421eb5effc63801aeff69a9ffe8..25e37c946dfa92e9a3676a022177afef06588a01:/test/error.cpp?ds=sidebyside diff --git a/test/error.cpp b/test/error.cpp index 03996b5..7726da2 100644 --- a/test/error.cpp +++ b/test/error.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include BOOST_AUTO_TEST_SUITE( error_suite ) @@ -11,18 +11,18 @@ BOOST_AUTO_TEST_CASE( constructor_test ) { // default constructor - close(-123); + open("/non/existent", 0); posixx::error e1; - BOOST_CHECK_EQUAL(e1.no, EBADF); + BOOST_CHECK_EQUAL(e1.no, ENOENT); // "where" string constructor - close(-123); - posixx::error e2("fopen"); - BOOST_CHECK_EQUAL(e2.no, EBADF); - BOOST_CHECK_EQUAL(std::string(e2.what()).find("fopen: "), 0); + open("/non/existent", 0); + posixx::error e2("open"); + BOOST_CHECK_EQUAL(e2.no, ENOENT); + BOOST_CHECK_EQUAL(std::string(e2.what()).find("open: "), 0); // e1 and e2 should be the same appart from the "where" string - BOOST_CHECK_EQUAL(std::string(e2.what()).substr(7), e1.what()); + BOOST_CHECK_EQUAL(std::string(e2.what()).substr(6), e1.what()); }