Merge branch 'develop'

This commit is contained in:
Daniel James
2016-10-05 09:44:40 +01:00
11 changed files with 40 additions and 34 deletions

View File

@@ -27,10 +27,10 @@ matrix:
before_script:
- |
echo "using gcc : std03 : g++-4.8 --std=c++03 ;" > ~/user-config.jam
echo "using gcc : std11 : g++-4.8 --std=c++11 ;" >> ~/user-config.jam
echo "using clang : std03 : clang++ --std=c++03 ;" >> ~/user-config.jam
echo "using clang : std11 : clang++ --std=c++11 ;" >> ~/user-config.jam
echo "using gcc : std03 : g++-4.8 -Werror --std=c++03 ;" > ~/user-config.jam
echo "using gcc : std11 : g++-4.8 -Werror --std=c++11 ;" >> ~/user-config.jam
echo "using clang : std03 : clang++ -Werror --std=c++03 ;" >> ~/user-config.jam
echo "using clang : std11 : clang++ -Werror --std=c++11 ;" >> ~/user-config.jam
- cat ~/user-config.jam
- touch Jamroot.jam

View File

@@ -8,6 +8,7 @@
#include <boost/functional/factory.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/none_t.hpp>
#include <memory>

View File

@@ -12,6 +12,7 @@ project hash-tests
#<toolset>intel:<cxxflags>-strict-ansi
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow"
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow"
<toolset>clang:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow"
#<toolset>msvc:<warnings-as-errors>on
#<toolset>gcc:<warnings-as-errors>on
#<toolset>darwin:<warnings-as-errors>on

View File

@@ -84,8 +84,8 @@ void complex_integral_tests(Integer*)
generic_complex_tests(complex(15342,124));
generic_complex_tests(complex(25,54356));
generic_complex_tests(complex(5325,2346));
generic_complex_tests(complex(-243897,-49923874));
generic_complex_tests(complex(-543,763));
generic_complex_tests(complex(Integer(-243897),Integer(-49923874)));
generic_complex_tests(complex(Integer(-543),Integer(763)));
}
int main()

View File

@@ -15,7 +15,7 @@ namespace test
std::size_t hash() const
{
return value_ * 10;
return static_cast<std::size_t>(value_ * 10);
}
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)

View File

@@ -17,7 +17,7 @@ namespace test
std::size_t hash() const
{
return value_ * 10;
return static_cast<std::size_t>(value_ * 10);
}
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)

View File

@@ -17,7 +17,7 @@ struct custom
std::size_t hash() const
{
return value_ * 10;
return static_cast<std::size_t>(value_ * 10);
}
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)

View File

@@ -19,6 +19,8 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
template <class T>
void integer_tests(T* = 0)
{
typedef typename T::value_type value_type;
const int number_of_containers = 11;
T containers[number_of_containers];
@@ -27,16 +29,16 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
containers[i].push_back(0);
}
containers[5].push_back(1);
containers[6].push_back(1);
containers[6].push_back(1);
containers[7].push_back(-1);
containers[8].push_back(-1);
containers[8].push_back(-1);
containers[9].push_back(1);
containers[9].push_back(-1);
containers[10].push_back(-1);
containers[10].push_back(1);
containers[5].push_back(value_type(1));
containers[6].push_back(value_type(1));
containers[6].push_back(value_type(1));
containers[7].push_back(value_type(-1));
containers[8].push_back(value_type(-1));
containers[8].push_back(value_type(-1));
containers[9].push_back(value_type(1));
containers[9].push_back(value_type(-1));
containers[10].push_back(value_type(-1));
containers[10].push_back(value_type(1));
BOOST_HASH_TEST_NAMESPACE::hash<T> hasher;

View File

@@ -19,6 +19,8 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
template <class T>
void integer_tests(T* = 0)
{
typedef typename T::value_type value_type;
const int number_of_containers = 12;
T containers[number_of_containers];
@@ -27,19 +29,19 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
containers[i].insert(0);
}
containers[6].insert(1);
containers[7].insert(1);
containers[7].insert(1);
containers[8].insert(-1);
containers[9].insert(-1);
containers[9].insert(-1);
containers[10].insert(-1);
containers[10].insert(1);
containers[11].insert(1);
containers[11].insert(2);
containers[11].insert(3);
containers[11].insert(4);
containers[11].insert(5);
containers[6].insert(value_type(1));
containers[7].insert(value_type(1));
containers[7].insert(value_type(1));
containers[8].insert(value_type(-1));
containers[9].insert(value_type(-1));
containers[9].insert(value_type(-1));
containers[10].insert(value_type(-1));
containers[10].insert(value_type(1));
containers[11].insert(value_type(1));
containers[11].insert(value_type(2));
containers[11].insert(value_type(3));
containers[11].insert(value_type(4));
containers[11].insert(value_type(5));
BOOST_HASH_TEST_NAMESPACE::hash<T> hasher;

View File

@@ -20,7 +20,7 @@ int f(std::size_t hash1, int* x1) {
// Check that std::vector<std::size_t> is avaiable in this file.
std::vector<std::size_t> x;
x.push_back(*x1);
x.push_back(static_cast<std::size_t>(*x1));
BOOST_HASH_TEST_NAMESPACE::hash<std::vector<std::size_t> > vector_hasher;
return vector_hasher(x) != BOOST_HASH_TEST_NAMESPACE::hash_value(x);

View File

@@ -179,7 +179,7 @@ namespace boost
hash_float_combine(seed, part);
}
hash_float_combine(seed, exp);
hash_float_combine(seed, static_cast<std::size_t>(exp));
return seed;
}