[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()
- [lmi-commits] [lmi] master updated (97d2acd -> 6eb2614), Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 934e2f6 04/10: Emphasize that [lr]trim() removes no internal superfluity, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 3e089d5 03/10: Fix defect introduced 20110801T2357Z: arguments omitted, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master e52e02c 02/10: GUI sequence parser diagnostics: generalize code, improve documentation, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 987adcc 06/10: Get sequence parser diagnostics from exception, not function, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 6eb2614 10/10: Improve unit test,
Greg Chicares <=
- [lmi-commits] [lmi] master 601f252 07/10: Throw any parser diagnostics from interval_representation(), Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master aee673f 05/10: Fix defect introduced 20170205T2107Z: fixed the wrong problem, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master e411ac4 09/10: Throw any parser errors from all *_representation() functions, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 502fedc 01/10: Improve [lr]trim unit test and documentation, Greg Chicares, 2017/02/05
- [lmi-commits] [lmi] master 4f05707 08/10: Omit unhelpful file name and line number from a warning, Greg Chicares, 2017/02/05