lmi
[Top][All Lists]
Advanced

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

[lmi] Outdated GUI test data


From: Vadim Zeitlin
Subject: [lmi] Outdated GUI test data
Date: Fri, 26 Jun 2020 23:53:10 +0200

 Hello,

 If you haven't noticed it yet, the "paste census" GUI test doesn't pass
any longer starting from today with the following error

---------------------------------- >8 --------------------------------------
NOTE: starting the test suite
paste_census: started
Alarum: Input validation problems for '':
Interval [ 0, 0 ) is improper: it ends before it begins.

[input_realization.cpp : 267]

paste_census: ERROR (Input validation problems for '': Interval [ 0, 0 ) is 
improper: it ends before it begins.  [input_realization.cpp : 267] )
time=1041ms (for all tests)
FAILURE: 1 out of 1 test failed.
---------------------------------- >8 --------------------------------------

 It took me some time to understand what happened here (as I didn't see how
could our grid changes result in this), but finally I realized what the
real problem was: it's the passage of time.

 The unit test uses the following data, see wx_test_paste_census.cpp:

---------------------------------- >8 --------------------------------------
    char const* const census_data =
        "Gender\tDateOfBirth\tEmployeeClass\tSpecifiedAmount\n"
        "\n"
        "Female\t19851231\tClerical\t100000, @65; 50000\n"
        "Male\t19801130\tClerical\t200000, @65; 50000\n"
        "Female\t19751029\tTechnical\t300000, @65; 50000\n"
        "Male\t19700928\tTechnical\t400000, @65; 50000\n"
        "Female\t19650827\tSupervisor\t500000, @65; 50000\n"
        "Male\t19600726\tAttorney\t600000, @65; 75000\n"
        "Female\t19560625\tPresident\t700000, @65; 100000\n"
        ;
---------------------------------- >8 --------------------------------------

and the last sequence has just become invalid because the interval "until
age 65" became empty since 20200626, i.e. today.

 So the minimal fix allowing the test to pass again is

---------------------------------- >8 --------------------------------------
diff --git a/wx_test_paste_census.cpp b/wx_test_paste_census.cpp
index 986a5ad80..332d87ce6 100644
--- a/wx_test_paste_census.cpp
+++ b/wx_test_paste_census.cpp
@@ -307,7 +307,7 @@ wxGrid* find_census_grid_window()
         "Male\t19700928\tTechnical\t400000, @65; 50000\n"
         "Female\t19650827\tSupervisor\t500000, @65; 50000\n"
         "Male\t19600726\tAttorney\t600000, @65; 75000\n"
-        "Female\t19550625\tPresident\t700000, @65; 100000\n"
+        "Female\t19560625\tPresident\t700000, @65; 100000\n"
         ;

     int const number_of_rows =
---------------------------------- >8 --------------------------------------
but I'm not sure we want to return to this problem in a year, os perhaps it
would be worth increasing this further and maybe also modify the date in
the line before it, to not have to return to this problem in 4 years
neither? I can live with it arising again in 10 years, I think...

 Anyhow, please let me know if you'd prefer to fix it in some different way
or if you'd like me to send you a proper patch with the fix above.

 Thanks,
VZ

Attachment: pgpofVGYOA33r.pgp
Description: PGP signature


reply via email to

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