The non-static version tests for the existence of the directory part of the
object only as is explicitly mentioned in the documentation, so do the test on
GetPath() and not GetFullPath() as we did since r72707.
Also add a unit test for this behaviour.
Closes #14771.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72718
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( !ShouldFollowLink() )
flags |= wxFILE_EXISTS_NO_FOLLOW;
- return Exists(GetFullPath(), flags);
+ return Exists(GetPath(), flags);
}
/* static */
CPPUNIT_ASSERT( !fn.Exists(wxFILE_EXISTS_DIR) );
CPPUNIT_ASSERT( fn.Exists() );
- wxFileName dirTemp(wxFileName::DirName(wxFileName::GetTempDir()));
+ const wxString& tempdir = wxFileName::GetTempDir();
+
+ wxFileName fileInTempDir(tempdir, "bloordyblop");
+ CPPUNIT_ASSERT( !fileInTempDir.Exists() );
+ CPPUNIT_ASSERT( fileInTempDir.DirExists() );
+
+ wxFileName dirTemp(wxFileName::DirName(tempdir));
CPPUNIT_ASSERT( !dirTemp.FileExists() );
CPPUNIT_ASSERT( dirTemp.DirExists() );