lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6047] Rectify test specification


From: Greg Chicares
Subject: [lmi-commits] [6047] Rectify test specification
Date: Sat, 06 Dec 2014 14:53:23 +0000

Revision: 6047
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6047
Author:   chicares
Date:     2014-12-06 14:53:22 +0000 (Sat, 06 Dec 2014)
Log Message:
-----------
Rectify test specification

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

Modified: lmi/trunk/wx_test_expiry_dates.cpp
===================================================================
--- lmi/trunk/wx_test_expiry_dates.cpp  2014-12-06 11:40:16 UTC (rev 6046)
+++ lmi/trunk/wx_test_expiry_dates.cpp  2014-12-06 14:53:22 UTC (rev 6047)
@@ -35,18 +35,37 @@
 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/operations.hpp>
 
-/*
-    Test expiry dates validity.
+/// Validate dates in the 'expiry' file.
+///
+/// Write the begin and end dates to stdout, as JDN and as YYYYMMDD,
+/// all on a single line, e.g.:
+///   begin: 2457024 2015-01-01  end: 2457055 2015-02-01
+/// (Those are the dates that would normally be expected for a
+/// distribution prepared in December 2014.)
+///
+/// Validate dates only when the '--distribution' option is given.
+///  - The begin date should be the first day of the next month.
+///  - The end date should be the first day of the month after next.
+/// Binaries are normally distributed toward the end of a month for
+/// use throughout the following month. Consequently, these tests will
+/// pass if run when a regular distribution is prepared, but they will
+/// fail if rerun on the begin date--and that's exactly as desired:
+/// such "failure" is not an error. (Incidentally, this illuminates
+/// our decision to write all GUI-test output to stdout, not stderr.)
+///
+/// (When '--distribution' is not given, we had considered writing a
+/// line to stdout saying that the tests had been skipped. But that is
+/// not necessary, because in our normal workflow we'll compare each
+/// '--distribution' run to a previously-saved '--distribution' run,
+/// and diffs will make it obvious that the tests have been skipped.)
+///
+/// Occasionally "interim" distributions are issued, e.g., to add an
+/// urgently-needed feature or to fix a critical mistake. They are
+/// to be tested in the same way as regular distributions. All regular
+/// distributions resemble each other; each "interim" distribution is
+/// irregular in its own way, and its validation "failures" are not
+/// errors, but may indeed convey useful information.
 
-    3. Inspect dates in 'expiry'. The values change every month and
-       the first value can differ among each distribution.
-
-      A. Distributions beginning before the first of the month:
-          2456596 2456628
-
-      B. Distributions beginning on the first of the month:
-          2456598 2456628
- */
 LMI_WX_TEST_CASE(expiry_dates)
 {
     fs::path expiry_path(global_settings::instance().data_directory() / 
"expiry");
@@ -59,6 +78,7 @@
     LMI_ASSERT(is);
     LMI_ASSERT(is.eof());
 
+// This comment is no longer applicable in light of the revised specification:
     // The begin date must either be the first of month itself or a date in the
     // previous month, in which case we're interested in the end of the
     // following month and not the same one.
@@ -85,6 +105,9 @@
         days_in_month = calendar_date(year, month, 1).days_in_month();
         }
 
+// code below uses last day of month
+// instead, use first day of the month after next
     calendar_date const end_of_month(year, month, days_in_month);
     LMI_ASSERT_EQUAL(end, end_of_month);
 }
+




reply via email to

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