+
+ // Test wxFileName::Exists
+ // The wxFILE_EXISTS_NO_FOLLOW flag should override DontFollowLink()
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing file existence" + msg,
+ false,
+ linktofile.Exists(wxFILE_EXISTS_REGULAR | wxFILE_EXISTS_NO_FOLLOW)
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing directory existence" + msg,
+ false,
+ linktodir.Exists(wxFILE_EXISTS_DIR | wxFILE_EXISTS_NO_FOLLOW)
+ );
+ // and the static versions
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing file existence" + msg,
+ false,
+ wxFileName::Exists(linktofile.GetFullPath(), wxFILE_EXISTS_REGULAR | wxFILE_EXISTS_NO_FOLLOW)
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing file existence" + msg,
+ true,
+ wxFileName::Exists(linktofile.GetFullPath(), wxFILE_EXISTS_REGULAR)
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing directory existence" + msg,
+ false,
+ wxFileName::Exists(linktodir.GetFullPath(), wxFILE_EXISTS_DIR | wxFILE_EXISTS_NO_FOLLOW)
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "Testing directory existence" + msg,
+ true,
+ wxFileName::Exists(linktodir.GetFullPath(), wxFILE_EXISTS_DIR)
+ );