From babead7504d18fbfce86ffcc1fef379fac5a80e7 Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Sat, 17 Mar 2018 16:39:17 +0800 Subject: [PATCH] Remove pile of warnings so that the build log is easier to search through. --- example/cubic_b_spline_example.cpp | 2 +- test/compile_test/sf_bernoulli_incl_test.cpp | 3 +++ test/compile_test/test_compile_result.hpp | 3 +++ test/test_error_handling.cpp | 22 -------------------- test/test_next.cpp | 7 ------- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/example/cubic_b_spline_example.cpp b/example/cubic_b_spline_example.cpp index 167b9f0a6..4a8f0891e 100644 --- a/example/cubic_b_spline_example.cpp +++ b/example/cubic_b_spline_example.cpp @@ -71,7 +71,7 @@ int main() // An eyeball estimate indicates that the population crossed 100 million around 1915. // Let's see what interpolation says: - boost::math::cubic_b_spline p(population.data(), population.size(), t0, 10); + boost::math::cubic_b_spline p(population.data(), population.size(), t0, time_step); // Now create a function which has a zero at p = 100,000,000: auto f = [=](double t){ return p(t) - 100000000; }; diff --git a/test/compile_test/sf_bernoulli_incl_test.cpp b/test/compile_test/sf_bernoulli_incl_test.cpp index c4100c28e..49c3374fe 100644 --- a/test/compile_test/sf_bernoulli_incl_test.cpp +++ b/test/compile_test/sf_bernoulli_incl_test.cpp @@ -6,6 +6,7 @@ // Basic sanity check that header // #includes all the files that it needs to. // +#include #include // // Note this header includes no other headers, this is @@ -30,5 +31,7 @@ void compile_and_link_test() constexpr float ce_f = boost::math::unchecked_bernoulli_b2n(2); constexpr float ce_d = boost::math::unchecked_bernoulli_b2n(2); constexpr float ce_l = boost::math::unchecked_bernoulli_b2n(2); + std::ostream cnull(0); + cnull << ce_f << ce_d << ce_l << std::endl; #endif } diff --git a/test/compile_test/test_compile_result.hpp b/test/compile_test/test_compile_result.hpp index cd2c075a4..4fb1ea698 100644 --- a/test/compile_test/test_compile_result.hpp +++ b/test/compile_test/test_compile_result.hpp @@ -52,7 +52,10 @@ template inline void check_result_imp(T1, T2) { // This is a static assertion that should always fail to compile... +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-local-typedef" typedef BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE int static_assertion[local_is_same::value ? 1 : 0]; +#pragma GCC diagnostic pop } template diff --git a/test/test_error_handling.cpp b/test/test_error_handling.cpp index a7d5cfa92..400a1647f 100644 --- a/test/test_error_handling.cpp +++ b/test/test_error_handling.cpp @@ -281,7 +281,6 @@ void test_polynomial_error(T) // const char* func = "boost::math::test_function<%1%>(%1%, %1%, %1%)"; const char* msg1 = "Error while handling value %1%"; - const char* msg2 = "Error message goes here..."; static const typename T::value_type data[] = { 1, 2, 3 }; static const T val(data, 2); @@ -293,12 +292,6 @@ void test_polynomial_error(T) TEST_EXCEPTION(boost::math::policies::raise_domain_error(func, 0, val, throw_policy), std::domain_error, format_message_string("Error in function boost::math::test_function(float, float, float): Domain Error evaluating function at { 1, 2, 3 }")); TEST_EXCEPTION(boost::math::policies::raise_pole_error(func, msg1, val, throw_policy), std::domain_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error while handling value { 1, 2, 3 }")); TEST_EXCEPTION(boost::math::policies::raise_pole_error(func, 0, val, throw_policy), std::domain_error, format_message_string("Error in function boost::math::test_function(float, float, float): Evaluation of function at pole { 1, 2, 3 }")); - //TEST_EXCEPTION(boost::math::policies::raise_overflow_error(func, msg2, throw_policy), std::overflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error message goes here...")); - //TEST_EXCEPTION(boost::math::policies::raise_overflow_error(func, 0, throw_policy), std::overflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Overflow Error")); - //TEST_EXCEPTION(boost::math::policies::raise_underflow_error(func, msg2, throw_policy), std::underflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error message goes here...")); - //TEST_EXCEPTION(boost::math::policies::raise_underflow_error(func, 0, throw_policy), std::underflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Underflow Error")); - //TEST_EXCEPTION(boost::math::policies::raise_denorm_error(func, msg2, T(0), throw_policy), std::underflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error message goes here...")); - //TEST_EXCEPTION(boost::math::policies::raise_denorm_error(func, 0, T(0), throw_policy), std::underflow_error, format_message_string("Error in function boost::math::test_function(float, float, float): Denorm Error")); TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, msg1, val, throw_policy), boost::math::evaluation_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error while handling value { 1, 2, 3 }")); TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, 0, val, throw_policy), boost::math::evaluation_error, format_message_string("Error in function boost::math::test_function(float, float, float): Internal Evaluation Error, best value so far was { 1, 2, 3 }")); TEST_EXCEPTION(boost::math::policies::raise_indeterminate_result_error(func, msg1, val, T(12.34), throw_policy), std::domain_error, format_message_string("Error in function boost::math::test_function(float, float, float): Error while handling value { 1, 2, 3 }")); @@ -308,9 +301,6 @@ void test_polynomial_error(T) // - because by design these are undefined and must be defined by the user ;-) BOOST_MATH_CHECK_THROW(boost::math::policies::raise_domain_error(func, msg1, T(0.0), user_policy), user_defined_error); BOOST_MATH_CHECK_THROW(boost::math::policies::raise_pole_error(func, msg1, T(0.0), user_policy), user_defined_error); - //BOOST_MATH_CHECK_THROW(boost::math::policies::raise_overflow_error(func, msg2, user_policy), user_defined_error); - //BOOST_MATH_CHECK_THROW(boost::math::policies::raise_underflow_error(func, msg2, user_policy), user_defined_error); - //BOOST_MATH_CHECK_THROW(boost::math::policies::raise_denorm_error(func, msg2, T(0), user_policy), user_defined_error); BOOST_MATH_CHECK_THROW(boost::math::policies::raise_evaluation_error(func, msg1, T(0.0), user_policy), user_defined_error); BOOST_MATH_CHECK_THROW(boost::math::policies::raise_indeterminate_result_error(func, msg1, T(0.0), T(0.0), user_policy), user_defined_error); #endif @@ -318,9 +308,6 @@ void test_polynomial_error(T) // Test with ignore_error BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_domain_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits::has_quiet_NaN); BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_pole_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits::has_quiet_NaN); - //BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error(func, msg2, ignore_policy), std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value()); - //BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error(func, msg2, ignore_policy), T(0)); - //BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error(func, msg2, T(1.25), ignore_policy), T(1.25)); BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), ignore_policy), T(1.25)); BOOST_CHECK_EQUAL(boost::math::policies::raise_indeterminate_result_error(func, 0, T(0.0), T(12.34), ignore_policy), T(12.34)); @@ -332,15 +319,6 @@ void test_polynomial_error(T) BOOST_CHECK((boost::math::isnan)(boost::math::policies::raise_pole_error(func, msg1, T(0.0), errno_policy)) || !std::numeric_limits::has_quiet_NaN); BOOST_CHECK(errno == EDOM); errno = 0; - //BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error(func, msg2, errno_policy), std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value()); - //BOOST_CHECK_EQUAL(errno, ERANGE); - //errno = 0; - //BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error(func, msg2, errno_policy), T(0)); - //BOOST_CHECK_EQUAL(errno, ERANGE); - //errno = 0; - //BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error(func, msg2, T(1.25), errno_policy), T(1.25)); - //BOOST_CHECK_EQUAL(errno, ERANGE); - //errno = 0; BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), errno_policy), T(1.25)); BOOST_CHECK(errno == EDOM); errno = 0; diff --git a/test/test_next.cpp b/test/test_next.cpp index b49e6ff90..11e7a870a 100644 --- a/test/test_next.cpp +++ b/test/test_next.cpp @@ -246,13 +246,6 @@ BOOST_AUTO_TEST_CASE( test_main ) #if defined(TEST_SSE2) -#ifdef _MSC_VER -# pragma message("Compiling SSE2 test code") -#endif -#ifdef __GNUC__ -# pragma message "Compiling SSE2 test code" -#endif - int mmx_flags = _mm_getcsr(); // We'll restore these later. #ifdef _WIN32