lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5987] Test default input.


From: Vadim Zeitlin
Subject: [lmi-commits] [5987] Test default input.
Date: Tue, 14 Oct 2014 23:26:00 +0000

Revision: 5987
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5987
Author:   zeitlin
Date:     2014-10-14 23:25:59 +0000 (Tue, 14 Oct 2014)
Log Message:
-----------
Test default input.

2. Inspect '*default.ill' for the following variable data:

 A. This date differs each month
    <EffectiveDate>2456598</EffectiveDate>

 B. Rates can change each month and differ among each distribution
    <GeneralAccountRate>0.042 [0, 1); 0.037 [1, maturity)</GeneralAccountRate>

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

Modified: lmi/trunk/main_wx_test.cpp
===================================================================
--- lmi/trunk/main_wx_test.cpp  2014-10-14 23:25:53 UTC (rev 5986)
+++ lmi/trunk/main_wx_test.cpp  2014-10-14 23:25:59 UTC (rev 5987)
@@ -27,8 +27,11 @@
 #endif
 
 #include "assert_lmi.hpp"
+#include "calendar_date.hpp"
 #include "configurable_settings.hpp"
 #include "force_linking.hpp"
+#include "illustrator.hpp"
+#include "input.hpp"
 #include "main_common.hpp"              // initialize_application()
 #include "msw_workarounds.hpp"
 #include "path_utility.hpp"             // initialize_filesystem()
@@ -57,11 +60,13 @@
         {
         test_about_dialog_version();
         test_configurable_settings();
+        test_default_input();
         }
 
   private:
     static void test_about_dialog_version();
     static void test_configurable_settings();
+    static void test_default_input();
 };
 
 void application_test::test_about_dialog_version()
@@ -119,6 +124,20 @@
         }
 }
 
+void application_test::test_default_input()
+{
+    calendar_date const today;
+    calendar_date const first_of_month(today.year(), today.month(), 1);
+
+    Input const& cell = default_cell();
+    calendar_date const effective_date = 
exact_cast<tnr_date>(cell["EffectiveDate"])->value();
+    LMI_ASSERT(first_of_month == effective_date);
+
+    std::string const general_account_date = 
exact_cast<numeric_sequence>(cell["GeneralAccountRate"])->value();
+    LMI_ASSERT(!general_account_date.empty());
+    wxLogMessage("GeneralAccountRate is \"%s\"", general_account_date.c_str());
+}
+
 // Application to drive the tests
 class SkeletonTest : public Skeleton
 {




reply via email to

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