lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5791] Test untrapped precondition failures


From: Greg Chicares
Subject: [lmi-commits] [5791] Test untrapped precondition failures
Date: Tue, 15 Oct 2013 09:16:29 +0000

Revision: 5791
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5791
Author:   chicares
Date:     2013-10-15 09:16:27 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
Test untrapped precondition failures

Modified Paths:
--------------
    lmi/trunk/gpt_test.cpp

Modified: lmi/trunk/gpt_test.cpp
===================================================================
--- lmi/trunk/gpt_test.cpp      2013-10-13 15:37:14 UTC (rev 5790)
+++ lmi/trunk/gpt_test.cpp      2013-10-15 09:16:27 UTC (rev 5791)
@@ -101,11 +101,13 @@
   public:
     static void test()
         {
+        test_invariants();
         test_premium_calculations();
         assay_speed();
         }
 
   private:
+    static void test_invariants();
     static void test_premium_calculations();
     static void assay_speed();
 
@@ -194,6 +196,35 @@
     return gpt_cf_triad(q_m, glp_ic, glp_ig, gsp_ic, gsp_ig, v_parms());
 }
 
+void gpt_test::test_invariants()
+{
+    gpt_scalar_parms parms =
+        {     0   // duration
+        ,  1000.0 // target
+        ,120000.0 // f3bft
+        ,100000.0 // endt_bft
+        ,100000.0 // chg_sa_amt
+        ,     0.0 // qab_gio_amt
+        ,100000.0 // qab_adb_amt
+        ,     0.0 // qab_term_amt
+        ,     0.0 // qab_spouse_amt
+        ,     0.0 // qab_child_amt
+        ,     0.0 // qab_waiver_amt
+        };
+
+    initialize(0);
+    gpt_cf_triad const z = instantiate_cf();
+
+    parms.duration = -1;
+    double const x0 = z.calculate_premium(oe_gsp, mce_option1_for_7702, parms);
+
+    parms.duration = q_m.size();
+    double const x1 = z.calculate_premium(oe_gsp, mce_option1_for_7702, parms);
+
+    // Values are bogus, if this line is even reached:
+    std::cout << x0 << ' ' << x1 << std::endl;
+}
+
 /// The obsolescent GPT class more or less requires this ugliness.
 
 Irc7702* ugliness = 0;




reply via email to

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