[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 4b5d3e3 1/4: Write some assertions but don't
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 4b5d3e3 1/4: Write some assertions but don't enable them yet |
Date: |
Fri, 2 Nov 2018 07:42:53 -0400 (EDT) |
branch: master
commit 4b5d3e3e93d517f1d85a20dc785dcdac1b51228b
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Write some assertions but don't enable them yet
Enabling these assertions now would cause unwanted system-testing
regressions. Using a currency class would prevent that, not by magic,
but by forcing an explicit rounding decision.
---
ihs_avmly.cpp | 9 +++++++++
test_coding_rules.cpp | 1 +
2 files changed, 10 insertions(+)
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 2d41dd8..eb2171d 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1466,6 +1466,15 @@ double AccountValue::GetPremLoad
double AccountValue::GetRefundableSalesLoad() const
{
return CumulativeSalesLoad * YearsSalesLoadRefundRate;
+#if 0
+ // CURRENCY !! Assertions such as these are desirable, but adding
+ // them now would cause regression artifacts.
+ LMI_ASSERT(0.0 <= CumulativeSalesLoad);
+ LMI_ASSERT(0.0 <= YearsSalesLoadRefundRate);
+ double const z = CumulativeSalesLoad * YearsSalesLoadRefundRate;
+ LMI_ASSERT(0.0 <= z);
+ return z;
+#endif // 0
}
//============================================================================
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index dd7f504..94973ab 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -693,6 +693,7 @@ void check_defect_markers(file const& f)
true
&& "BOOST " != z[1]
&& "COMPILER " != z[1]
+ && "CURRENCY " != z[1]
&& "CYGWIN " != z[1]
&& "DATABASE " != z[1]
&& "DBO3 " != z[1]