lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0a9d880 2/4: Use output_file_existence_checke


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0a9d880 2/4: Use output_file_existence_checker in the create/open UI test
Date: Mon, 30 Jul 2018 10:36:22 -0400 (EDT)

branch: master
commit 0a9d8804f338bb37a7a51d2aa56d302435e4f898
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Use output_file_existence_checker in the create/open UI test
    
    Reuse this helper class instead of using wxWidgets functions such as
    wxFileExists() and wxRemoveFile() directly for consistency with the
    other tests, where Boost.Filesystem, rather than wxWidgets, is used for
    the file operations.
    
    No real changes.
---
 wx_test_create_open.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/wx_test_create_open.cpp b/wx_test_create_open.cpp
index a488701..81812e5 100644
--- a/wx_test_create_open.cpp
+++ b/wx_test_create_open.cpp
@@ -25,9 +25,9 @@
 #include "mvc_controller.hpp"
 #include "version.hpp"
 #include "wx_test_case.hpp"
+#include "wx_test_output.hpp"
 
 #include <wx/dialog.h>
-#include <wx/scopeguard.h>
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
@@ -52,6 +52,8 @@ void do_test_create_open
     wxString const file = test.get_test_file_path_for(basename);
     LMI_ASSERT(!wxFileExists(file));
 
+    output_file_existence_checker output_file{file.ToStdString()};
+
     wxUIActionSimulator z;
     z.Char('n', wxMOD_CONTROL); // new file
     z.Char(key               ); // choose document type
@@ -72,8 +74,7 @@ void do_test_create_open
         );
     wxYield();
 
-    LMI_ASSERT(wxFileExists(file));
-    wxON_BLOCK_EXIT1(wxRemoveFile, file);
+    LMI_ASSERT(output_file.exists());
 
     z.Char('l', wxMOD_CONTROL); // close document
     wxYield();



reply via email to

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