2 #include <posixx/error.hpp> // posixx::error
4 #include <boost/test/unit_test.hpp>
8 BOOST_AUTO_TEST_SUITE( error_suite )
10 BOOST_AUTO_TEST_CASE( constructor_test )
13 // default constructor
16 BOOST_CHECK_EQUAL(e1.no, EBADF);
18 // "where" string constructor
20 posixx::error e2("fopen");
21 BOOST_CHECK_EQUAL(e2.no, EBADF);
22 BOOST_CHECK_EQUAL(std::string(e2.what()).find("fopen: "), 0);
24 // e1 and e2 should be the same appart from the "where" string
25 BOOST_CHECK_EQUAL(std::string(e2.what()).substr(7), e1.what());
29 BOOST_AUTO_TEST_SUITE_END()