[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.
- [lmi-commits] [lmi] master updated (55873f1 -> ce8b814), Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 485d642 4/8: Augment unit tests, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master be56aad 2/8: Move and rename a present-value function, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 873c574 6/8: Expunge an unneeded overload, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master ac0da7b 3/8: Use a more appropriate unit-test macro,
Greg Chicares <=
- [lmi-commits] [lmi] master 951a9c9 1/8: Improve IRR speed measurements, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 81ede74 5/8: Reimplement fv(), Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master ce8b814 8/8: Record speed measurements, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 7c21f2a 7/8: Optionally trace IRR iterations, Greg Chicares, 2021/07/09