]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/icl/test/test_casual_/test_casual.cpp
1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2008-2009: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENCE.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 #define BOOST_TEST_MODULE icl::casual unit test
10 #define BOOST_ICL_TEST_CHRONO
12 #include <libs/icl/test/disable_test_warnings.hpp>
16 #include <boost/mpl/list.hpp>
17 #include "../unit_test_unwarned.hpp"
20 // interval instance types
21 #include "../test_type_lists.hpp"
22 #include "../test_value_maker.hpp"
24 #include <boost/rational.hpp>
26 #include <boost/type_traits/is_same.hpp>
28 #include <boost/icl/gregorian.hpp>
29 #include <boost/icl/ptime.hpp>
31 #include <boost/icl/interval_map.hpp>
32 #include <boost/icl/interval_set.hpp>
33 #include <boost/icl/interval.hpp>
44 std::cout
<< "Spy() ";
46 Spy(int val
):_val(val
){}
47 int val()const { return _val
; }
49 Spy
& operator += (const Spy
& rhs
){
53 Spy
& operator -= (const Spy
& rhs
){ if(_val
== rhs
.val()) _val
=0; return *this; }
54 Spy
& operator &= (const Spy
& rhs
){ if(_val
!= rhs
.val()) _val
=0; return *this; }
60 bool operator == (const Spy
& lhs
, const Spy
& rhs
){ return lhs
.val() == rhs
.val(); }
61 bool operator < (const Spy
& lhs
, const Spy
& rhs
){ return lhs
.val() < rhs
.val(); }
63 template<class CharType
, class CharTraits
>
64 std::basic_ostream
<CharType
, CharTraits
> &operator<<
65 (std::basic_ostream
<CharType
, CharTraits
> &stream
, Spy
const& value
)
67 return stream
<< value
.val();
76 using namespace boost
;
77 using namespace unit_test
;
78 using namespace boost::icl
;
80 BOOST_AUTO_TEST_CASE(casual
)
85 typedef interval_map
<int, Spy
> SpyMapT
;
88 //imap += make_pair(interval<int>::right_open( 0, 8), Spy(1));
90 imap
.add(imap
.begin(), make_pair(interval
<int>::right_open( 0, 8), Spy(1)));
92 BOOST_CHECK_EQUAL(true, true);