Remove symlinks time comparison tests from wxFileName test

These tests don't seem to be sound, it's possible for one second or more to
pass between the two calls to GetTimes() and it's apparently possible for the
access time on the symlink to not change (due to /tmp being mounted with
"noatime" option perhaps?), resulting in Travis CI build failures.
This commit is contained in:
Vadim Zeitlin
2016-02-13 18:46:46 +01:00
parent 54c874d488
commit ed09b7b6c0

View File

@@ -827,9 +827,6 @@ void FileNameTestCase::TestSymlinks()
wxFileName tmpfn(wxFileName::DirName(tmpdir)); wxFileName tmpfn(wxFileName::DirName(tmpdir));
wxDateTime dtAccessTmp, dtModTmp, dtCreateTmp;
CPPUNIT_ASSERT(tmpfn.GetTimes(&dtAccessTmp, &dtModTmp, &dtCreateTmp));
// Create a temporary directory // Create a temporary directory
#ifdef __VMS #ifdef __VMS
wxString name = tmpdir + ".filenametestXXXXXX]"; wxString name = tmpdir + ".filenametestXXXXXX]";
@@ -917,18 +914,6 @@ void FileNameTestCase::TestSymlinks()
linktodir.GetTimes(&dtAccess, &dtMod, &dtCreate) linktodir.GetTimes(&dtAccess, &dtMod, &dtCreate)
); );
// IsEqualTo() should be true only when dereferencing. Don't test each
// individually: accessing to create the link will have updated some
bool equal = dtCreate.IsEqualTo(dtCreateTmp) &&
dtMod.IsEqualTo(dtModTmp) &&
dtAccess.IsEqualTo(dtAccessTmp);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"Comparing directory times" + msg,
deref,
equal
);
// Test (File|Dir)Exists() // Test (File|Dir)Exists()
CPPUNIT_ASSERT_EQUAL_MESSAGE CPPUNIT_ASSERT_EQUAL_MESSAGE
( (