[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master edb098f 02/13: Strengthen unit tests
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master edb098f 02/13: Strengthen unit tests |
Date: |
Fri, 9 Apr 2021 18:42:36 -0400 (EDT) |
branch: master
commit edb098ffa4624ad9f1edc114935c571d561f073d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Strengthen unit tests
---
commutation_functions_test.cpp | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/commutation_functions_test.cpp b/commutation_functions_test.cpp
index 8e71db8..e8ae311 100644
--- a/commutation_functions_test.cpp
+++ b/commutation_functions_test.cpp
@@ -57,24 +57,40 @@ std::vector<double> const& sample_q()
void test_fundamentals()
{
// default ctors
- OLCommFns olcf0;
- ULCommFns ulcf0;
+ OLCommFns olcf_empty;
+ ULCommFns ulcf_empty;
+ LMI_TEST(olcf_empty. D().empty());
+ LMI_TEST(ulcf_empty.aD().empty());
+
+ // explicit ctors
+ OLCommFns olcf0 {{0.01}, {0.01}};
+ ULCommFns ulcf0 {{0.01}, {0.01}, {0.01}, mce_option1_for_7702,
mce_monthly};
+ LMI_TEST(!olcf0. D().empty());
+ LMI_TEST(!ulcf0.aD().empty());
// copy
OLCommFns olcf1(olcf0);
ULCommFns ulcf1(ulcf0);
+ LMI_TEST(!olcf1. D().empty());
+ LMI_TEST(!ulcf1.aD().empty());
// copy-assign
olcf0 = olcf1;
ulcf0 = ulcf1;
+ LMI_TEST(!olcf0. D().empty());
+ LMI_TEST(!ulcf0.aD().empty());
// move
OLCommFns olcf2(std::move(olcf0));
ULCommFns ulcf2(std::move(ulcf0));
+ LMI_TEST(!olcf2. D().empty());
+ LMI_TEST(!ulcf2.aD().empty());
// move-assign
olcf2 = std::move(olcf1);
ulcf2 = std::move(ulcf1);
+ LMI_TEST(!olcf2. D().empty());
+ LMI_TEST(!ulcf2.aD().empty());
}
/// Exactly reproduce Table 2 from Eckley's paper.
- [lmi-commits] [lmi] master updated (8aa09b9 -> a32cee0), Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 79741b1 01/13: Assert a precondition more consistently, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 358c5c9 06/13: Modernize, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master edb098f 02/13: Strengthen unit tests,
Greg Chicares <=
- [lmi-commits] [lmi] master 2a3d961 03/13: Measure cost of a needless transcendental calculation, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 6bc828a 05/13: Realign, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 290dc89 10/13: Remove a source of inaccuracy [285], Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master a32cee0 13/13: Hoist a division, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 1e49ee3 04/13: Revise 'round_to' documentation [286], Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 1bead9e 08/13: Purge unwanted, commented-out code, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master ce9ed5c 07/13: Add an inchoate test of power-of-ten scaling, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master 858d037 09/13: Include appropriate headers, and say why they're included, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master ca63009 11/13: Expunge an obsolete comment, Greg Chicares, 2021/04/09
- [lmi-commits] [lmi] master c41faec 12/13: Resolve a marked defect [284], Greg Chicares, 2021/04/09