[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5670] Make a dubious diagnostic less severe and more info
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5670] Make a dubious diagnostic less severe and more informative |
Date: |
Tue, 02 Apr 2013 08:38:13 +0000 |
Revision: 5670
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5670
Author: chicares
Date: 2013-04-02 08:38:10 +0000 (Tue, 02 Apr 2013)
Log Message:
-----------
Make a dubious diagnostic less severe and more informative
Modified Paths:
--------------
lmi/trunk/ihs_irc7702.cpp
Modified: lmi/trunk/ihs_irc7702.cpp
===================================================================
--- lmi/trunk/ihs_irc7702.cpp 2013-03-27 14:53:27 UTC (rev 5669)
+++ lmi/trunk/ihs_irc7702.cpp 2013-04-02 08:38:10 UTC (rev 5670)
@@ -32,6 +32,7 @@
#include "assert_lmi.hpp"
#include "commutation_functions.hpp"
#include "materially_equal.hpp"
+#include "value_cast.hpp"
#include <algorithm>
#include <cmath>
@@ -211,7 +212,7 @@
//============================================================================
void Irc7702::ProcessGptPmt
- (int // a_Duration
+ (int a_Duration
,double& a_Pmt
,double& // a_CumPmt
)
@@ -222,7 +223,23 @@
{
return;
}
- LMI_ASSERT(CumPmts <= GptLimit);
+ // This assertion seems like a good idea:
+// LMI_ASSERT(CumPmts <= GptLimit);
+ // but it's incorrect when this function is called by
+ // AccountValue::TxTakeWD(): in that case, the cumulative GLP
+ // has been improperly updated by calling UpdateBOY7702() before
+ // ProcessAdjustableEvent().
+ if(GptLimit < CumPmts)
+ {
+ warning()
+ << "Apparent GPT violation before applying a "
+ << value_cast<std::string>(a_Pmt)
+ << " payment at duration " << a_Duration << ":"
+ << "\n " << value_cast<std::string>(GptLimit) << " limit is less
than"
+ << "\n " << value_cast<std::string>(CumPmts ) << " cumulative
premiums paid."
+ << LMI_FLUSH
+ ;
+ }
a_Pmt = std::min(a_Pmt ,round_max_premium(GptLimit - CumPmts));
CumPmts += a_Pmt;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5670] Make a dubious diagnostic less severe and more informative,
Greg Chicares <=