[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6c0c0f0 3/4: Add numerous failing unit tests
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6c0c0f0 3/4: Add numerous failing unit tests |
Date: |
Sun, 18 Mar 2018 20:02:19 -0400 (EDT) |
branch: master
commit 6c0c0f04ad4f374710aaa5d46fc204f1acd40b4d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Add numerous failing unit tests
---
miscellany_test.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/miscellany_test.cpp b/miscellany_test.cpp
index 59f27e1..1e4686a 100644
--- a/miscellany_test.cpp
+++ b/miscellany_test.cpp
@@ -374,6 +374,24 @@ void test_scale_power()
// ...just as this "worked" above...
// BOOST_TEST_EQUAL( 9, scale_power( 9, 0.0,
999'999'999'999'999.1));
// but wouldn't have "worked" with the value 999'999'999'999'999.01
+
+ // Test threshold values for scale_power=8.
+
+ BOOST_TEST_EQUAL( 0, scale_power( 8, 0.0,
99'999'999.0));
+ BOOST_TEST_EQUAL( 3, scale_power( 8, 0.0,
99'999'999.1));
+ BOOST_TEST_EQUAL( 3, scale_power( 8, 0.0,
99'999'999'999.0));
+ BOOST_TEST_EQUAL( 6, scale_power( 8, 0.0,
99'999'999'999.1));
+ BOOST_TEST_EQUAL( 6, scale_power( 8, 0.0,
99'999'999'999'999.0));
+ BOOST_TEST_EQUAL( 9, scale_power( 8, 0.0,
99'999'999'999'999.1));
+
+ // Test threshold values for scale_power=7.
+
+ BOOST_TEST_EQUAL( 0, scale_power( 7, 0.0,
9'999'999.0));
+ BOOST_TEST_EQUAL( 3, scale_power( 7, 0.0,
9'999'999.1));
+ BOOST_TEST_EQUAL( 3, scale_power( 7, 0.0,
9'999'999'999.0));
+ BOOST_TEST_EQUAL( 6, scale_power( 7, 0.0,
9'999'999'999.1));
+ BOOST_TEST_EQUAL( 6, scale_power( 7, 0.0,
9'999'999'999'999.0));
+ BOOST_TEST_EQUAL( 9, scale_power( 7, 0.0,
9'999'999'999'999.1));
}
void test_trimming()