lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master d07c63a 06/13: Conditionalize a block


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d07c63a 06/13: Conditionalize a block
Date: Sat, 15 Jun 2019 20:25:36 -0400 (EDT)

branch: master
commit d07c63a6a84d56290393074523fa58578dcde306
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Conditionalize a block
    
    Review with '--ignore-space-change' to verify that the block has been
    properly moved and indented.
---
 verify_products.cpp | 119 ++++++++++++++++++++++++++++------------------------
 1 file changed, 64 insertions(+), 55 deletions(-)

diff --git a/verify_products.cpp b/verify_products.cpp
index 1c52314..a6bc78e 100644
--- a/verify_products.cpp
+++ b/verify_products.cpp
@@ -71,64 +71,73 @@ void verify_one_cell
         return;
         }
 
-    if(0 == t)
+    switch(db.query<oenum_7702_q_whence>(DB_Irc7702QWhence))
         {
-        std::cout
-            << "7702 q PROBLEM: " << product_name
-            << " nonexistent table zero"
-            << ' ' << gender
-            << ' ' << smoking
-            << std::endl
-            ;
-        return;
-        }
+        case oe_7702_q_builtin:
+            {
+            }
+        case oe_7702_q_external_table:
+            {
+            if(0 == t)
+                {
+                std::cout
+                    << "7702 q PROBLEM: " << product_name
+                    << " nonexistent table zero"
+                    << ' ' << gender
+                    << ' ' << smoking
+                    << std::endl
+                    ;
+                return;
+                }
 
-    std::vector<double> const v0 = cso_table
-        (era
-        ,oe_orthodox // No other option currently supported for 7702.
-        ,a_b
-        ,mce_gender (gender).value()
-        ,mce_smoking(smoking).value()
-        );
-    std::string const f = AddDataDir(p.datum("Irc7702QFilename"));
-    actuarial_table const a(f, t);
-    std::vector<double> const v1 = a.values
-        (a.min_age()
-        ,1 + a.max_age() - a.min_age()
-        );
+            std::vector<double> const v0 = cso_table
+                (era
+                ,oe_orthodox // No other option currently supported for 7702.
+                ,a_b
+                ,mce_gender (gender).value()
+                ,mce_smoking(smoking).value()
+                );
+            std::string const f = AddDataDir(p.datum("Irc7702QFilename"));
+            actuarial_table const a(f, t);
+            std::vector<double> const v1 = a.values
+                (a.min_age()
+                ,1 + a.max_age() - a.min_age()
+                );
 
-    if(v0 == v1)
-        {
-        std::cout
-            << "7702 q okay: table " << t
-            << ' ' << gender
-            << ' ' << smoking
-            << std::endl
-            ;
-        }
-    else
-        {
-        std::cout
-            << "7702 q PROBLEM: " << product_name
-            << ' ' << gender
-            << ' ' << smoking
-            << std::endl
-            ;
-        std::cout
-            << "\n  CSO era: " << era
-            << "\n  ALB or ANB: " << a_b
-            << "\n  table file: " << f
-            << "\n  table number: " << t
-            << "\n  min age: " << a.min_age()
-            << "\n  max age: " << a.max_age()
-            << "\n  cso length: " << lmi::ssize(v0)
-            << "\n  table length: " << lmi::ssize(v1)
-            << "\n  v0.front(): " << v0.front()
-            << "\n  v1.front(): " << v1.front()
-            << "\n  v0.back (): " << v0.back ()
-            << "\n  v1.back (): " << v1.back ()
-            << std::endl
-            ;
+            if(v0 == v1)
+                {
+                std::cout
+                    << "7702 q okay: table " << t
+                    << ' ' << gender
+                    << ' ' << smoking
+                    << std::endl
+                    ;
+                }
+            else
+                {
+                std::cout
+                    << "7702 q PROBLEM: " << product_name
+                    << ' ' << gender
+                    << ' ' << smoking
+                    << std::endl
+                    ;
+                std::cout
+                    << "\n  CSO era: " << era
+                    << "\n  ALB or ANB: " << a_b
+                    << "\n  table file: " << f
+                    << "\n  table number: " << t
+                    << "\n  min age: " << a.min_age()
+                    << "\n  max age: " << a.max_age()
+                    << "\n  cso length: " << lmi::ssize(v0)
+                    << "\n  table length: " << lmi::ssize(v1)
+                    << "\n  v0.front(): " << v0.front()
+                    << "\n  v1.front(): " << v1.front()
+                    << "\n  v0.back (): " << v0.back ()
+                    << "\n  v1.back (): " << v1.back ()
+                    << std::endl
+                    ;
+                }
+            }
         }
 }
 } // Unnamed namespace.



reply via email to

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