Windows: use Boost 1.59, msvc 14.0
[metaproxy-moved-to-github.git] / src / test_ses_map.cpp
1 /* This file is part of Metaproxy.
2    Copyright (C) Index Data
3
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19 #include "config.hpp"
20 #include <iostream>
21 #include <stdexcept>
22
23 #include <metaproxy/package.hpp>
24
25 #include <map>
26
27 #include <boost/thread/thread.hpp>
28 #include <boost/shared_ptr.hpp>
29 #define BOOST_AUTO_TEST_MAIN
30 #define BOOST_TEST_DYN_LINK
31 #include <boost/test/auto_unit_test.hpp>
32
33 #include <yaz/zgdu.h>
34 #include <yaz/pquery.h>
35 #include <yaz/otherinfo.h>
36 using namespace boost::unit_test;
37
38 namespace mp = metaproxy_1;
39
40 namespace metaproxy_1 {
41     class SesMap;
42
43
44     class SesMap {
45         class Wrap {
46         public:
47             Wrap(const double &t) : m_t(t) { };
48             double m_t;
49             boost::mutex m_mutex;
50         };
51     private:
52         boost::mutex m_map_mutex;
53     public:
54         void create(SesMap &sm, const mp::Session &s, double &t) {
55             boost::mutex::scoped_lock lock(m_map_mutex);
56
57             boost::shared_ptr<Wrap> w_ptr(new Wrap(t));
58             m_map_ptr[s] = w_ptr;
59         }
60         std::map<mp::Session,boost::shared_ptr<Wrap> >m_map_ptr;
61     };
62 }
63
64
65 BOOST_AUTO_TEST_CASE( test_ses_map_1 )
66 {
67     try
68     {
69         mp::SesMap ses_map;
70     }
71     catch ( ... ) {
72         BOOST_CHECK (false);
73     }
74 }
75
76
77 /*
78  * Local variables:
79  * c-basic-offset: 4
80  * c-file-style: "Stroustrup"
81  * indent-tabs-mode: nil
82  * End:
83  * vim: shiftwidth=4 tabstop=8 expandtab
84  */
85