lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master c9da0f6 07/24: Assert "length" is same in two


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c9da0f6 07/24: Assert "length" is same in two classes
Date: Wed, 30 Dec 2020 18:46:57 -0500 (EST)

branch: master
commit c9da0f615e640934c8c26441453d358b056cb85f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Assert "length" is same in two classes
    
    Classes BasicValues and product_database both have "length" members
    representing the number of years to normal maturity. Asserting that
    they're consistent ensures that product_database::length() can be used
    for early initialization of some BasicValues data members.
---
 ihs_basicval.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index be6a2f2..28364b8 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -179,6 +179,7 @@ void BasicValues::Init()
 
     database().query_into(DB_MaturityAge   , EndtAge);
     Length = EndtAge - IssueAge;
+    LMI_ASSERT(database().length() == Length);
 
     database().query_into(DB_LedgerType    , ledger_type_);
     database().query_into(DB_Nonillustrated, nonillustrated_);
@@ -269,6 +270,7 @@ void BasicValues::GPTServerInit()
 
     database().query_into(DB_MaturityAge   , EndtAge);
     Length = EndtAge - IssueAge;
+    LMI_ASSERT(database().length() == Length);
 
     yare_input_.ExtraMonthlyCustodialFee  .resize(Length);
     yare_input_.ExtraCompensationOnAssets .resize(Length);



reply via email to

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