X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ftest_session1.cpp;h=f2ba77ec9ba2fa2696a72c339828bfd84ed59adc;hb=073a9efb12b18f9bbd2bceaf778eb66124a0db65;hp=0c0abc30d331b87f51357eeef2ee2f661b05a3db;hpb=c90fa1d9d80ba80198953b34c2e5a3134d1b5402;p=metaproxy-moved-to-github.git diff --git a/src/test_session1.cpp b/src/test_session1.cpp index 0c0abc3..f2ba77e 100644 --- a/src/test_session1.cpp +++ b/src/test_session1.cpp @@ -1,32 +1,36 @@ +#include "config.hpp" +#include "session.hpp" #include -#include "design.h" - -int main(int argc, char **argv) + +#define BOOST_AUTO_TEST_MAIN +#include + +using namespace boost::unit_test; + +BOOST_AUTO_TEST_CASE( testsession1 ) { + // test session try { - yp2::Session session; + yp2::Session session1; + yp2::Session session2; + yp2::Session session3; + yp2::Session session4; + yp2::Session session5; unsigned long int id; - id = session.id(); - std::cout << "Session.id() == " << id << std::endl; - id = session.id(); - std::cout << "Session.id() == " << id << std::endl; - id = session.id(); - std::cout << "Session.id() == " << id << std::endl; + id = session5.id(); - if (id != 3) - { - std::cout << "Fail: Session.id() != 3\n"; - exit(1); - } + BOOST_CHECK (id == 5); + } - catch (std::exception &e) { std::cout << e.what() << "\n"; - exit(1); + BOOST_CHECK (false); + } + catch (...) { + BOOST_CHECK (false); } - exit(0); } /*