aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-03-11 17:00:39 -0700
committerMartin Braun <martin.braun@ettus.com>2015-03-11 17:05:10 -0700
commit2e594ae877f99411d54f1a8e3d9be274d8b9eb35 (patch)
tree2fa0a5f0fc501ab2362f424831b367610077c2d6 /host/tests
parenta7049e4ff79cdc205db76bf7270219f254073961 (diff)
parentcc7d37f114d5a14b4e45372f38324bf95115b6b9 (diff)
downloaduhd-2e594ae877f99411d54f1a8e3d9be274d8b9eb35.tar.gz
uhd-2e594ae877f99411d54f1a8e3d9be274d8b9eb35.tar.bz2
uhd-2e594ae877f99411d54f1a8e3d9be274d8b9eb35.zip
Merge branch 'maint'
Conflicts: host/include/uhd/transport/vrt_if_packet.hpp
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/fp_compare_delta_test.cpp26
-rw-r--r--host/tests/fp_compare_epsilon_test.cpp32
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 a38c3d2b0..36ff14756 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) {