mirror of
https://github.com/boostorg/container.git
synced 2026-02-23 15:42:17 +00:00
Add expected sizeof test to detect any unwanted growth when refactoring
This commit is contained in:
@@ -413,6 +413,9 @@ struct alloc_propagate_base<boost_container_deque>
|
||||
|
||||
}}} //namespace boost::container::test
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(4*sizeof(void*) == sizeof(deque<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main ()
|
||||
{
|
||||
if(!do_recursive_deque_test())
|
||||
|
||||
@@ -3888,6 +3888,9 @@ int test_cont_variants()
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(5*sizeof(void*) == sizeof(devector<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main()
|
||||
{
|
||||
// boost::container::devector<boost::container::test::movable_int>a(get());
|
||||
|
||||
@@ -160,6 +160,9 @@ struct alloc_propagate_base<boost_container_list>
|
||||
|
||||
}}} //namespace boost::container::test
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(3*sizeof(void*) == sizeof(list<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main ()
|
||||
{
|
||||
recursive_list_test();
|
||||
|
||||
@@ -386,6 +386,10 @@ bool constructor_template_auto_deduction_test()
|
||||
|
||||
}}} //namespace boost::container::test
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(4*sizeof(void*) == sizeof(map<int, int>), "sizeof has an unexpected value");
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(4*sizeof(void*) == sizeof(multimap<int, int>), "sizeof has an unexpected value");
|
||||
|
||||
int main ()
|
||||
{
|
||||
using namespace boost::container::test;
|
||||
|
||||
@@ -379,6 +379,10 @@ void test_merge_from_different_comparison()
|
||||
set1.merge(set2);
|
||||
}
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(4*sizeof(void*) == sizeof(set<int>), "sizeof has an unexpected value");
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(4*sizeof(void*) == sizeof(multiset<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main ()
|
||||
{
|
||||
using namespace boost::container::test;
|
||||
|
||||
@@ -173,6 +173,9 @@ struct alloc_propagate_base<boost_container_slist>
|
||||
|
||||
}}}
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(2*sizeof(void*) == sizeof(slist<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main ()
|
||||
{
|
||||
recursive_slist_test();
|
||||
|
||||
@@ -468,10 +468,13 @@ int test_cont_variants()
|
||||
return 0;
|
||||
}
|
||||
|
||||
using namespace boost::container;
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(7*sizeof(void*) == sizeof(small_vector<void*, 4>), "sizeof has an unexpected value");
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::container;
|
||||
|
||||
if(!test_swap())
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -104,6 +104,9 @@ struct alloc_propagate_base<boost_container_stable_vector>
|
||||
}}} //namespace boost::container::test
|
||||
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(5*sizeof(void*) == sizeof(stable_vector<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main()
|
||||
{
|
||||
recursive_vector_test();
|
||||
|
||||
@@ -702,6 +702,10 @@ void static_vector_triviality(){}
|
||||
|
||||
#endif //BOOST_INTRUSIVE_CONCEPTS_BASED_OVERLOADING
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(5*sizeof(void*) == sizeof(static_vector<void*, 4>), "sizeof has an unexpected value");
|
||||
|
||||
|
||||
int main(int, char* [])
|
||||
{
|
||||
using boost::container::test::movable_and_copyable_int;
|
||||
|
||||
@@ -2394,6 +2394,10 @@ void test_with_lightweight_test()
|
||||
test_reserve_and_shrink();
|
||||
}
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(3*sizeof(void*) == sizeof(string), "sizeof has an unexpected value");
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
if(string_test<char>()){
|
||||
|
||||
@@ -233,6 +233,9 @@ BOOST_CONTAINER_STATIC_ASSERT_MSG
|
||||
);
|
||||
#endif
|
||||
|
||||
//Test the expected sizeof()
|
||||
BOOST_CONTAINER_STATIC_ASSERT_MSG(3*sizeof(void*) == sizeof(vector<int>), "sizeof has an unexpected value");
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user