mirror of
https://github.com/boostorg/container.git
synced 2025-07-31 13:07:17 +02:00
Silence warnings in tests
This commit is contained in:
@ -89,7 +89,7 @@ bool test_insert_with_expand_bwd()
|
||||
std::vector<value_type> initial_data;
|
||||
initial_data.resize(InitialSize[iteration]);
|
||||
for(unsigned int i = 0; i < InitialSize[iteration]; ++i){
|
||||
initial_data[i] = i;
|
||||
initial_data[i] = static_cast<value_type>(i);
|
||||
}
|
||||
|
||||
if(!life_count<value_type>::check(InitialSize[iteration]))
|
||||
@ -97,7 +97,7 @@ bool test_insert_with_expand_bwd()
|
||||
Vect data_to_insert;
|
||||
data_to_insert.resize(InsertSize[iteration]);
|
||||
for(unsigned int i = 0; i < InsertSize[iteration]; ++i){
|
||||
data_to_insert[i] = -i;
|
||||
data_to_insert[i] = static_cast<value_type>(-i);
|
||||
}
|
||||
|
||||
if(!life_count<value_type>::check(InitialSize[iteration]+InsertSize[iteration]))
|
||||
@ -153,14 +153,14 @@ bool test_assign_with_expand_bwd()
|
||||
std::vector<value_type> initial_data;
|
||||
initial_data.resize(InitialSize[iteration]);
|
||||
for(unsigned int i = 0; i < InitialSize[iteration]; ++i){
|
||||
initial_data[i] = i;
|
||||
initial_data[i] = static_cast<value_type>(i);
|
||||
}
|
||||
|
||||
//Create data to assign
|
||||
std::vector<value_type> data_to_insert;
|
||||
data_to_insert.resize(InsertSize[iteration]);
|
||||
for(unsigned int i = 0; i < InsertSize[iteration]; ++i){
|
||||
data_to_insert[i] = -i;
|
||||
data_to_insert[i] = static_cast<value_type>(-i);
|
||||
}
|
||||
|
||||
//Insert initial data to the vector to test
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "../../intrusive/test/iterator_test.hpp"
|
||||
#include <boost/utility/string_view.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/static_string.hpp>
|
||||
|
||||
using namespace boost::container;
|
||||
|
||||
@ -504,6 +505,12 @@ struct alloc_propagate_base<boost_container_string>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
boost::container::string a = "abcdefghijklmnopqrstuvwxyz";
|
||||
boost::container::hash_value(a);
|
||||
}
|
||||
|
||||
|
||||
if(string_test<char>()){
|
||||
return 1;
|
||||
}
|
||||
@ -569,24 +576,22 @@ int main()
|
||||
typedef boost::container::basic_string<char> cont;
|
||||
typedef cont::allocator_type allocator_type;
|
||||
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
|
||||
if (boost::has_trivial_destructor_after_move<cont>::value !=
|
||||
boost::has_trivial_destructor_after_move<allocator_type>::value &&
|
||||
boost::has_trivial_destructor_after_move<pointer>::value) {
|
||||
std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
BOOST_STATIC_ASSERT_MSG
|
||||
( (boost::has_trivial_destructor_after_move<cont>::value ==
|
||||
boost::has_trivial_destructor_after_move<allocator_type>::value ||
|
||||
boost::has_trivial_destructor_after_move<pointer>::value),
|
||||
"has_trivial_destructor_after_move(default allocator) test failed");
|
||||
}
|
||||
// std::allocator
|
||||
{
|
||||
typedef boost::container::basic_string<char, std::char_traits<char>, std::allocator<char> > cont;
|
||||
typedef cont::allocator_type allocator_type;
|
||||
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
|
||||
if (boost::has_trivial_destructor_after_move<cont>::value !=
|
||||
boost::has_trivial_destructor_after_move<allocator_type>::value &&
|
||||
boost::has_trivial_destructor_after_move<pointer>::value) {
|
||||
std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
BOOST_STATIC_ASSERT_MSG
|
||||
( (boost::has_trivial_destructor_after_move<cont>::value ==
|
||||
boost::has_trivial_destructor_after_move<allocator_type>::value ||
|
||||
boost::has_trivial_destructor_after_move<pointer>::value),
|
||||
"has_trivial_destructor_after_move(std::allocator) test failed");
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
|
Reference in New Issue
Block a user