lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ac0da7b 3/8: Use a more appropriate unit-test


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ac0da7b 3/8: Use a more appropriate unit-test macro
Date: Fri, 9 Jul 2021 01:41:16 -0400 (EDT)

branch: master
commit ac0da7bb2f9221f2ce92c4cd3ad52e62cb9bb1fd
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Use a more appropriate unit-test macro
---
 financial_test.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/financial_test.cpp b/financial_test.cpp
index 5bf881c..40357d4 100644
--- a/financial_test.cpp
+++ b/financial_test.cpp
@@ -119,22 +119,22 @@ int test_main(int, char*[])
     // exactly.
 
     irr_helper<double*> xxx(pmts, pmts + 1, bfts[0], 5);
-    LMI_TEST(2.0 == xxx());
+    LMI_TEST_EQUAL(2.0, xxx());
 
-    LMI_TEST(( 2.0 == irr_helper<double*>(pmts, pmts + 1, bfts[0], 5)()));
+    LMI_TEST_EQUAL( 2.0, irr_helper<double*>(pmts, pmts + 1, bfts[0], 5)());
 
-    LMI_TEST(( 2.0 == irr_helper<double*>(pmts, pmts + 3, bfts[2], 5)()));
+    LMI_TEST_EQUAL( 2.0, irr_helper<double*>(pmts, pmts + 3, bfts[2], 5)());
 
-    LMI_TEST((-1.0 == irr_helper<double*>(pmts, pmts + 3, 0.0    , 5)()));
+    LMI_TEST_EQUAL(-1.0, irr_helper<double*>(pmts, pmts + 3, 0.0    , 5)());
 
     // Test with arrays.
     double cash_flows[4] = {pmts[0], pmts[1], pmts[2], -bfts[2]};
-    LMI_TEST(2.0 == irr(cash_flows, 4 + cash_flows, 5));
+    LMI_TEST_EQUAL(2.0, irr(cash_flows, 4 + cash_flows, 5));
 
     // Test with vectors.
     std::vector<double> v(cash_flows, 4 + cash_flows);
-    LMI_TEST(2.0 == irr(v.begin(), v.end(), 0.0, 5));
-    LMI_TEST(2.0 == irr(v.begin(), v.end(), 5));
+    LMI_TEST_EQUAL(2.0, irr(v.begin(), v.end(), 0.0, 5));
+    LMI_TEST_EQUAL(2.0, irr(v.begin(), v.end(), 5));
 
     std::vector<double> p; // Payments.
     std::vector<double> b; // Benefits.



reply via email to

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