lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6077] Implement rectified test specification


From: Greg Chicares
Subject: [lmi-commits] [6077] Implement rectified test specification
Date: Mon, 15 Dec 2014 14:06:14 +0000

Revision: 6077
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6077
Author:   chicares
Date:     2014-12-15 14:06:13 +0000 (Mon, 15 Dec 2014)
Log Message:
-----------
Implement rectified test specification

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/wx_test_default_input.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-12-15 14:00:24 UTC (rev 6076)
+++ lmi/trunk/ChangeLog 2014-12-15 14:06:13 UTC (rev 6077)
@@ -34913,3 +34913,9 @@
 Refactor. See:
   http://lists.nongnu.org/archive/html/lmi/2014-12/msg00075.html
 
+20141215T1406Z <address@hidden> [516]
+
+  wx_test_default_input.cpp
+Implement rectified test specification. See:
+  http://lists.nongnu.org/archive/html/lmi/2014-12/msg00075.html
+

Modified: lmi/trunk/wx_test_default_input.cpp
===================================================================
--- lmi/trunk/wx_test_default_input.cpp 2014-12-15 14:00:24 UTC (rev 6076)
+++ lmi/trunk/wx_test_default_input.cpp 2014-12-15 14:06:13 UTC (rev 6077)
@@ -31,19 +31,12 @@
 #include "illustrator.hpp"
 #include "input.hpp"
 #include "wx_test_case.hpp"
+#include "wx_test_date.hpp"
 
 #include <wx/log.h>
 
 #include <sstream>
 
-// ERASE THIS BLOCK COMMENT WHEN IMPLEMENTATION COMPLETE. The block
-// comment below changes the original specification, and does not
-// yet describe the present code. Desired changes:
-//  - Run this test only when the '--distribution' option is given.
-//  - Write selected parameters to stdout as prescribed.
-//  - "EffectiveDate" is now compared to the first day of the current
-//    month, but should instead equal the first day of the next month.
-
 /// Test selected parameters in the user-customizable default cell.
 ///
 /// Run this test only when the '--distribution' option is given.
@@ -71,17 +64,37 @@
 
 LMI_WX_TEST_CASE(default_input)
 {
-    calendar_date const today;
-    calendar_date const first_of_month(today.year(), today.month(), 1);
+    if(!is_distribution_test())
+        {
+        return;
+        }
 
     Input const& cell = default_cell();
     calendar_date effective_date;
     std::istringstream is(cell["EffectiveDate"].str());
     LMI_ASSERT(is >> effective_date);
-    LMI_ASSERT_EQUAL(effective_date, first_of_month);
 
+    calendar_date const first_of_next_month = get_first_next_month(today());
+
+    wxLogMessage
+        ("EffectiveDate: %s; expected: %s"
+        ,dump_date(effective_date)
+        ,dump_date(first_of_next_month)
+        );
+    if(effective_date != first_of_next_month)
+        {
+        wxLogWarning("Effective date is different from the expected date.");
+        }
+
     std::string const general_account_rate = cell["GeneralAccountRate"].str();
     LMI_ASSERT(!general_account_rate.empty());
-    wxLogMessage("GeneralAccountRate is \"%s\"", general_account_rate.c_str());
+
+    std::string const product_name = cell["ProductName"].str();
+
+    wxLogMessage
+        ("ProductName=\"%s\"; GeneralAccountRate=\"%s\""
+        ,product_name
+        ,general_account_rate
+        );
 }
 




reply via email to

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