lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6eb2614 10/10: Improve unit test


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6eb2614 10/10: Improve unit test
Date: Mon, 6 Feb 2017 04:10:56 +0000 (UTC)

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

    Improve unit test
---
 input_test.cpp |   40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/input_test.cpp b/input_test.cpp
index b7f4b95..612b0ab 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -355,46 +355,46 @@ void input_test::test_obsolete_history()
     z.InforceYear  = 0;
     z.InforceMonth = 0;
     // For new business, history is irrelevant.
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("0"    , 
"1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("0"    
, "1"           , true));
     // Year 0, month 1: one year of history.
     z.InforceYear  = 0;
     z.InforceMonth = 1;
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("0"    , 
"1"           , true));
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"1"           , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("0"    
, "1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1"    
, "1"           , true));
     // Year 1, month 0: one year of history.
     z.InforceYear  = 1;
     z.InforceMonth = 0;
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("0"    , 
"1"           , true));
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"1"           , true));
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"1;2"         , true));
-    BOOST_TEST(1 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"2"           , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("0"    
, "1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1"    
, "1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1"    
, "1;2"         , true));
+    BOOST_TEST_EQUAL(1, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "2"           , true));
     // "History" after first year doesn't matter.
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "1"           , true));
     // Year 1, month 1: two years of history.
     z.InforceYear  = 1;
     z.InforceMonth = 1;
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"1"           , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1"    
, "1"           , true));
     // No conflict: history is a "subset" of specamt.
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"1;2;3"       , true));
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"1"           , true));
-    BOOST_TEST(1 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"2"           , true));
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"1;2"         , true));
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"2;3"         , true));
-    BOOST_TEST(0 == z.must_overwrite_specamt_with_obsolete_history("1;2;3", 
"1;2;3"       , true));
+    BOOST_TEST_EQUAL(0, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "1;2;3"       , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "1"           , true));
+    BOOST_TEST_EQUAL(1, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "2"           , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1"    
, "1;2"         , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "2;3"         , true));
+    BOOST_TEST_EQUAL(0, 
z.must_overwrite_specamt_with_obsolete_history("1;2;3", "1;2;3"       , true));
     // Warn if a keyword is used--this one's meaning depends on context.
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"1;corridor"  , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "1;corridor"  , true));
     // Keyword may engender "obvious" false positives.
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1;2"  , 
"1;2;corridor", true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1;2"  
, "1;2;corridor", true));
     // This would have been forbidden: history was numeric only.
-//  BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("X"    , 
"1"           , true));
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("1"    , 
"X"           , true));
+//  BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("X"    
, "1"           , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("1"    
, "X"           , true));
     // This case differs little from the preceding one, but formerly it
     // had a different outcome. Reason: non-numeric substrings were
     // interepreted as zero, simply because realize_vector() exited
     // early if the input-sequence parser emitted any diagnostics. Now,
     // however, any parser diagnostic raises an exception, which causes
     // must_overwrite_specamt_with_obsolete_history() to return 2.
-    BOOST_TEST(2 == z.must_overwrite_specamt_with_obsolete_history("0"    , 
"X"           , true));
+    BOOST_TEST_EQUAL(2, z.must_overwrite_specamt_with_obsolete_history("0"    
, "X"           , true));
 }
 
 void input_test::assay_speed()



reply via email to

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