1 #include <boost/test/unit_test.hpp>
8 #include "utilities/static_allocator.hpp"
16 template <int size
, bool b
>
17 void test_pool_instatiation(void)
19 static_allocator
<int, size
, b
> alloc
;
22 struct initialized_struct
24 initialized_struct(int i
):
28 bool operator<(initialized_struct
const & rhs
) const
37 template <typename T
, bool b
>
40 list
<T
, static_allocator
<T
, 8192, b
> > vec
;
42 for (int i
= 0; i
!= 8192; ++i
)
47 template <typename T
, bool b
>
48 void test_vector(void)
50 vector
<T
, static_allocator
<T
, 8192, b
> > vec
;
52 for (int i
= 0; i
!= 8192; ++i
)
56 template <typename T
, bool b
>
59 set
<T
, std::less
<T
>, static_allocator
<T
, 8192, b
> > set
;
61 for (int i
= 0; i
!= 8192; ++i
)
66 BOOST_AUTO_TEST_CASE( static_alloc_test_1
)
68 test_pool_instatiation
<16, false>();
69 test_pool_instatiation
<128, false>();
70 test_pool_instatiation
<1024, false>();
71 test_pool_instatiation
<4096, false>();
73 test_pool_instatiation
<16, true>();
74 test_pool_instatiation
<128, true>();
75 test_pool_instatiation
<1024, true>();
76 test_pool_instatiation
<4096, true>();
81 BOOST_AUTO_TEST_CASE( static_alloc_test_2
)
83 test_list
<int, false>();
84 test_list
<initialized_struct
, false>();
86 test_list
<int, true>();
87 test_list
<initialized_struct
, true>();
91 BOOST_AUTO_TEST_CASE( static_alloc_test_3
)
93 test_vector
<int, false>();
94 test_vector
<initialized_struct
, false>();
96 test_vector
<int, true>();
97 test_vector
<initialized_struct
, true>();
101 BOOST_AUTO_TEST_CASE( static_alloc_test_4
)
103 test_set
<int, false>();
104 test_set
<initialized_struct
, false>();
106 test_set
<int, true>();
107 test_set
<initialized_struct
, true>();