diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-03-11 16:45:19 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-03-11 16:58:23 -0700 |
commit | cc7d37f114d5a14b4e45372f38324bf95115b6b9 (patch) | |
tree | 0b6a39418c0aa5caafa3039b578c94d3db8f1775 /host/tests | |
parent | fae746179cbb1d8ac146dcae9b5d6cb58b366a56 (diff) | |
download | uhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.tar.gz uhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.tar.bz2 uhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.zip |
uhd: Fixed several type-cast related warnings for naggy compilers
Diffstat (limited to 'host/tests')
-rw-r--r-- | host/tests/fp_compare_delta_test.cpp | 26 | ||||
-rw-r--r-- | host/tests/fp_compare_epsilon_test.cpp | 32 |
2 files changed, 29 insertions, 29 deletions
diff --git a/host/tests/fp_compare_delta_test.cpp b/host/tests/fp_compare_delta_test.cpp index 9b009a79d..0ac4e257d 100644 --- a/host/tests/fp_compare_delta_test.cpp +++ b/host/tests/fp_compare_delta_test.cpp @@ -101,8 +101,8 @@ BOOST_AUTO_TEST_CASE(double_equality_operators) { BOOST_AUTO_TEST_CASE(float_inequality_operators) { // Test inequality operator, which is based on equality operator - fp_compare_delta<float> alpha = fp_compare_delta<float>(127.0); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 1.19e-3); + fp_compare_delta<float> alpha = fp_compare_delta<float>(127.0f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 1.19e-3f); BOOST_CHECK(alpha != beta); BOOST_CHECK(alpha != float(alpha._value + 1.19e-3)); @@ -119,17 +119,17 @@ BOOST_AUTO_TEST_CASE(double_inequality_operators) { BOOST_AUTO_TEST_CASE(float_lessthan_operators) { // Test less-than operator - fp_compare_delta<float> alpha = fp_compare_delta<float>(274192.7); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value - 0.2); + fp_compare_delta<float> alpha = fp_compare_delta<float>(274192.7f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value - 0.2f); BOOST_CHECK(beta < alpha); BOOST_CHECK(float(alpha._value - 0.2) < alpha); // Confirm false less-than case - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2f); BOOST_CHECK(not (alpha < charlie)); - BOOST_CHECK(not (alpha < float(alpha._value - 1.2))); + BOOST_CHECK(not (alpha < float(alpha._value - 1.2f))); } BOOST_AUTO_TEST_CASE(double_lessthan_operators) { @@ -149,14 +149,14 @@ BOOST_AUTO_TEST_CASE(double_lessthan_operators) { BOOST_AUTO_TEST_CASE(float_lessthanequals_operators) { // Test that <= correctly reports for equal values - fp_compare_delta<float> alpha = fp_compare_delta<float>(827.3); + fp_compare_delta<float> alpha = fp_compare_delta<float>(827.3f); fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value); BOOST_CHECK(alpha <= beta); BOOST_CHECK(alpha <= float(alpha._value)); // Test that <= correctly reports for less-than values - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2f); BOOST_CHECK(charlie <= alpha); BOOST_CHECK(float(alpha._value - 1.2) <= alpha); @@ -179,14 +179,14 @@ BOOST_AUTO_TEST_CASE(double_lessthanequals_operators) { BOOST_AUTO_TEST_CASE(float_greaterthan_operators) { // Test basic greater-than functionality - fp_compare_delta<float> alpha = fp_compare_delta<float>(98325.4); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 0.15); + fp_compare_delta<float> alpha = fp_compare_delta<float>(98325.4f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 0.15f); BOOST_CHECK(beta > alpha); BOOST_CHECK(float(alpha._value + 0.15) > alpha); // Test false greater-than case - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 1.2f); BOOST_CHECK(not (alpha > charlie)); BOOST_CHECK(not (alpha > float(alpha._value + 1.2))); @@ -209,14 +209,14 @@ BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { BOOST_AUTO_TEST_CASE(float_greaterthanequals_operators) { // Test that >= correctly reports for equal values - fp_compare_delta<float> alpha = fp_compare_delta<float>(7834.89); + fp_compare_delta<float> alpha = fp_compare_delta<float>(7834.89f); fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value); BOOST_CHECK(alpha >= beta); BOOST_CHECK(alpha >= float(alpha._value)); // Test that >= correctly reports for greater-than values - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 4.8); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 4.8f); BOOST_CHECK(charlie >= alpha); BOOST_CHECK(float(alpha._value + 4.8) >= alpha); diff --git a/host/tests/fp_compare_epsilon_test.cpp b/host/tests/fp_compare_epsilon_test.cpp index 5790318c2..45687ad26 100644 --- a/host/tests/fp_compare_epsilon_test.cpp +++ b/host/tests/fp_compare_epsilon_test.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(fp_compare_epsilon_constructors) { // Test constructor with specified epsilon fp_compare_epsilon<float> foxtrot = fp_compare_epsilon<float>(alpha._value, uhd::math::SINGLE_PRECISION_EPSILON); - fp_compare_epsilon<float> gamma = fp_compare_epsilon<float>(alpha._value, 2.0e-1); + fp_compare_epsilon<float> gamma = fp_compare_epsilon<float>(alpha._value, 2.0e-1f); BOOST_CHECK_EQUAL(alpha._epsilon, foxtrot._epsilon); BOOST_CHECK(not (alpha._epsilon == gamma._epsilon)); @@ -102,10 +102,10 @@ BOOST_AUTO_TEST_CASE(double_equality_operators) { BOOST_AUTO_TEST_CASE(float_inequality_operators) { // Test inequality operator, which is based on equality operator fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(127.0); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 1.19e-5); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 1.19e-5f); BOOST_CHECK(alpha != beta); - BOOST_CHECK(alpha != float(alpha._value + 1.19e-5)); + BOOST_CHECK(alpha != float(alpha._value + 1.19e-5f)); } BOOST_AUTO_TEST_CASE(double_inequality_operators) { @@ -119,17 +119,17 @@ BOOST_AUTO_TEST_CASE(double_inequality_operators) { BOOST_AUTO_TEST_CASE(float_lessthan_operators) { // Test less-than operator - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(274192.7); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value - 0.15); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(274192.7f); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value - 0.15f); BOOST_CHECK(beta < alpha); BOOST_CHECK(float(alpha._value - 0.15) < alpha); // Confirm false less-than case - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2f); BOOST_CHECK(not (alpha < charlie)); - BOOST_CHECK(not (alpha < float(alpha._value - 1.2))); + BOOST_CHECK(not (alpha < float(alpha._value - 1.2f))); } BOOST_AUTO_TEST_CASE(double_lessthan_operators) { @@ -149,14 +149,14 @@ BOOST_AUTO_TEST_CASE(double_lessthan_operators) { BOOST_AUTO_TEST_CASE(float_lessthanequals_operators) { // Test that <= correctly reports for equal values - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(827.3); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(827.3f); fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value); BOOST_CHECK(alpha <= beta); BOOST_CHECK(alpha <= float(alpha._value)); // Test that <= correctly reports for less-than values - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2f); BOOST_CHECK(charlie <= alpha); BOOST_CHECK(float(alpha._value - 1.2) <= alpha); @@ -179,17 +179,17 @@ BOOST_AUTO_TEST_CASE(double_lessthanequals_operators) { BOOST_AUTO_TEST_CASE(float_greaterthan_operators) { // Test basic greater-than functionality - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(98325.4); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 0.15); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(98325.4f); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 0.15f); BOOST_CHECK(beta > alpha); BOOST_CHECK(float(alpha._value + 0.15) > alpha); // Test false greater-than case - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 1.2f); BOOST_CHECK(not (alpha > charlie)); - BOOST_CHECK(not (alpha > float(alpha._value + 1.2))); + BOOST_CHECK(not (alpha > float(alpha._value + 1.2f))); } BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { @@ -209,17 +209,17 @@ BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { BOOST_AUTO_TEST_CASE(float_greaterthanequals_operators) { // Test that >= correctly reports for equal values - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(7834.89); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(7834.89f); fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value); BOOST_CHECK(alpha >= beta); BOOST_CHECK(alpha >= float(alpha._value)); // Test that >= correctly reports for greater-than values - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 4.8); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 4.8f); BOOST_CHECK(charlie >= alpha); - BOOST_CHECK(float(alpha._value + 4.8) >= alpha); + BOOST_CHECK(float(alpha._value + 4.8f) >= alpha); } BOOST_AUTO_TEST_CASE(double_greaterthanequals_operators) { |