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:
@@ -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
|
||||||
(
|
(
|
||||||
|
Reference in New Issue
Block a user