From 41fec01fa9e009d84fe353aa494725328d850af1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 25 Feb 2012 23:49:32 +0000 Subject: [PATCH] Remove temporary files created by wxFileName unit test case. Don't leave temporary files created by wxFileName::CreateTempFileName() lying around. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/filename/filenametest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp index b46ecff63a..5647448345 100644 --- a/tests/filename/filenametest.cpp +++ b/tests/filename/filenametest.cpp @@ -24,6 +24,7 @@ #include "wx/filename.h" #include "wx/filefn.h" #include "wx/stdpaths.h" +#include "wx/scopeguard.h" #ifdef __WXMSW__ #include "wx/msw/registry.h" @@ -639,6 +640,7 @@ void FileNameTestCase::TestGetTimes() { wxFileName fn(wxFileName::CreateTempFileName("filenametest")); CPPUNIT_ASSERT( fn.IsOk() ); + wxON_BLOCK_EXIT1( wxRemoveFile, fn.GetFullPath() ); wxDateTime dtAccess, dtMod, dtCreate; CPPUNIT_ASSERT( fn.GetTimes(&dtAccess, &dtMod, &dtCreate) ); @@ -654,6 +656,7 @@ void FileNameTestCase::TestExists() { wxFileName fn(wxFileName::CreateTempFileName("filenametest")); CPPUNIT_ASSERT( fn.IsOk() ); + wxON_BLOCK_EXIT1( wxRemoveFile, fn.GetFullPath() ); CPPUNIT_ASSERT( fn.FileExists() ); CPPUNIT_ASSERT( !wxFileName::DirExists(fn.GetFullPath()) ); -- 2.45.2