Fixed bug #1589: tests does not compile for libboost 1.34.1.
[metaproxy-moved-to-github.git] / src / test_ses_map.cpp
1 /* $Id: test_ses_map.cpp,v 1.7 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 <iostream>
24 #include <stdexcept>
25
26 #include "router.hpp"
27 #include "session.hpp"
28 #include "package.hpp"
29
30 #include <map>
31
32 #include <boost/thread.hpp>
33 #include <boost/shared_ptr.hpp>
34 #define BOOST_AUTO_TEST_MAIN
35 #define BOOST_TEST_DYN_LINK
36 #include <boost/test/auto_unit_test.hpp>
37
38 #include <yaz/zgdu.h>
39 #include <yaz/pquery.h>
40 #include <yaz/otherinfo.h>
41 using namespace boost::unit_test;
42
43 namespace mp = metaproxy_1;
44
45 namespace metaproxy_1 {
46     class SesMap;
47     
48
49     class SesMap {
50         class Wrap {
51         public:
52             Wrap(const double &t) : m_t(t) { };
53             double m_t;
54             boost::mutex m_mutex;
55         };
56     private:
57         boost::mutex m_map_mutex;
58     public:
59         void create(SesMap &sm, const mp::Session &s, double &t) {
60             boost::mutex::scoped_lock lock(m_map_mutex);
61             
62             boost::shared_ptr<Wrap> w_ptr(new Wrap(t));
63             m_map_ptr[s] = w_ptr;
64         }
65         std::map<mp::Session,boost::shared_ptr<Wrap> >m_map_ptr;
66     };
67 }
68
69
70 BOOST_AUTO_TEST_CASE( test_ses_map_1 )
71 {
72     try 
73     {
74         mp::SesMap ses_map;
75     }
76     catch ( ... ) {
77         BOOST_CHECK (false);
78     }
79 }
80
81
82 /*
83  * Local variables:
84  * c-basic-offset: 4
85  * indent-tabs-mode: nil
86  * c-file-style: "stroustrup"
87  * End:
88  * vim: shiftwidth=4 tabstop=8 expandtab
89  */