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
This commit is contained in:
Vadim Zeitlin 2012-02-25 23:49:32 +00:00
parent 69fa3d26d3
commit 41fec01fa9

View File

@ -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()) );