lmi-commits
[Top][All Lists]
Advanced

[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.



reply via email to

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