Fixed bug #1589: tests does not compile for libboost 1.34.1.
[metaproxy-moved-to-github.git] / src / test_session1.cpp
1 /* $Id: test_session1.cpp,v 1.14 2007-11-02 17:47:41 adam Exp $
2    Copyright (c) 2005-2007, Index Data.
3
4 This file is part of Metaproxy.
5
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE.  If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.
20  */
21
22 #include "config.hpp"
23 #include "session.hpp"
24
25 #include <iostream>
26
27 #define BOOST_AUTO_TEST_MAIN
28 #define BOOST_TEST_DYN_LINK
29 #include <boost/test/auto_unit_test.hpp>
30
31 using namespace boost::unit_test;
32 namespace mp = metaproxy_1;
33
34 BOOST_AUTO_TEST_CASE( testsession1 ) 
35 {
36
37     // test session 
38     try {
39         mp::Session session1;
40         mp::Session session2;
41         mp::Session session3;
42         mp::Session session4;
43         mp::Session session5;
44
45         BOOST_CHECK_EQUAL (session5.id(), (unsigned long) 5);
46
47         mp::Session session = session3;
48
49         BOOST_CHECK_EQUAL (session.id(), (unsigned long) 3);
50     }
51     catch (std::exception &e) {
52         std::cout << e.what() << "\n";
53         BOOST_CHECK (false);
54     }
55     catch (...) {
56         BOOST_CHECK (false);
57     }
58 }
59
60 /*
61  * Local variables:
62  * c-basic-offset: 4
63  * indent-tabs-mode: nil
64  * c-file-style: "stroustrup"
65  * End:
66  * vim: shiftwidth=4 tabstop=8 expandtab
67  */