lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6114] Refactor to simplify planned reuse


From: Greg Chicares
Subject: [lmi-commits] [6114] Refactor to simplify planned reuse
Date: Sun, 01 Mar 2015 17:55:32 +0000

Revision: 6114
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6114
Author:   chicares
Date:     2015-03-01 17:55:31 +0000 (Sun, 01 Mar 2015)
Log Message:
-----------
Refactor to simplify planned reuse

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

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-03-01 17:47:17 UTC (rev 6113)
+++ lmi/trunk/ChangeLog 2015-03-01 17:55:31 UTC (rev 6114)
@@ -35697,3 +35697,9 @@
 Add a helper for finding an MVC window by name. See:
   http://lists.nongnu.org/archive/html/lmi/2015-02/msg00012.html
 
+20150301T1755Z <address@hidden> [516]
+
+  wx_test_validate_output.cpp
+Refactor to simplify planned reuse. See:
+  http://lists.nongnu.org/archive/html/lmi/2015-02/msg00012.html
+

Modified: lmi/trunk/wx_test_validate_output.cpp
===================================================================
--- lmi/trunk/wx_test_validate_output.cpp       2015-03-01 17:47:17 UTC (rev 
6113)
+++ lmi/trunk/wx_test_validate_output.cpp       2015-03-01 17:55:31 UTC (rev 
6114)
@@ -37,6 +37,20 @@
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
+namespace
+{
+
+// Return the suffix for the spreadsheet files.
+//
+// This is just a shorter synonym for the existing function.
+inline
+std::string const& tsv_ext()
+{
+    return configurable_settings::instance().spreadsheet_file_extension();
+}
+
+} // anonymous namespace
+
 // Consider renaming this file to 'wx_test_spreadsheet_output.cpp'
 // e.g., because its purpose is to test *spreadsheet* output only.
 // To us at least, to "validate" a file suggests checking its
@@ -126,12 +140,10 @@
 
 LMI_WX_TEST_CASE(validate_output_illustration)
 {
-    std::string const&
-        ext = configurable_settings::instance().spreadsheet_file_extension();
-
     // Build the path existence of which we're going to check and ensure that
     // it doesn't exist before the start of the test.
-    output_file_existence_checker unnamed_trace("unnamed.monthly_trace" + ext);
+    output_file_existence_checker
+        unnamed_trace("unnamed.monthly_trace" + tsv_ext());
 
     struct enter_comment_in_illustration_dialog
         :public wxExpectModalBase<MvcController>
@@ -178,11 +190,8 @@
 {
     skip_if_not_supported("unnamed.mec");
 
-    std::string const&
-        ext = configurable_settings::instance().spreadsheet_file_extension();
-
     // Test creation of the output file when opening a new MEC testing 
document.
-    output_file_existence_checker unnamed_output("unnamed.mec" + ext);
+    output_file_existence_checker unnamed_output("unnamed.mec" + tsv_ext());
 
     wxUIActionSimulator ui;
     ui.Char('n', wxMOD_CONTROL);    // "File|New"




reply via email to

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