lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b282c3f 1/8: Add simple unit tests


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b282c3f 1/8: Add simple unit tests
Date: Sat, 17 Mar 2018 19:12:56 -0400 (EDT)

branch: master
commit b282c3fe9105a783078dfc2fe5d4ccd2a84f3cc5
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Add simple unit tests
---
 miscellany_test.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/miscellany_test.cpp b/miscellany_test.cpp
index 8c483e5..b8ecebd 100644
--- a/miscellany_test.cpp
+++ b/miscellany_test.cpp
@@ -293,6 +293,14 @@ void test_prefix_and_suffix()
     BOOST_TEST(!ends_with  (s, "KLMNOP"));
 }
 
+void test_scale_power()
+{
+    BOOST_TEST_EQUAL( 0, scale_power( 9,               0.0,               
0.0));
+    BOOST_TEST_EQUAL( 0, scale_power( 9,               0.0,     
999'999'999.0));
+    BOOST_TEST_EQUAL( 0, scale_power( 9,     -99'999'999.0,               
0.0));
+    BOOST_TEST_EQUAL( 0, scale_power( 9,     999'999'999.0,     
999'999'999.0));
+}
+
 void test_trimming()
 {
     char const*const superfluous = " ;";
@@ -337,6 +345,7 @@ int test_main(int, char*[])
     test_minmax();
     test_page_count();
     test_prefix_and_suffix();
+    test_scale_power();
     test_trimming();
 
     return 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]