diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-03-22 19:54:24 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-03-22 19:54:24 +0100 |
commit | 0a93d4eccf405f7145694a21c4412ba213b50a4a (patch) | |
tree | 834ccabbf69b091bb6f97531abef864756a2c0a3 /tests | |
parent | 5b03de9a66cf418ea2f269c9f061f44ca2146eb7 (diff) | |
download | nextcloud-server-0a93d4eccf405f7145694a21c4412ba213b50a4a.tar.gz nextcloud-server-0a93d4eccf405f7145694a21c4412ba213b50a4a.zip |
loosen tests for mtime and ctime a bit
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/filestorage.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php index 9ffa0eca9cb..4858234a2d8 100644 --- a/tests/lib/filestorage.php +++ b/tests/lib/filestorage.php @@ -135,10 +135,12 @@ abstract class Test_FileStorage extends UnitTestCase { $ctimeEnd=time(); $cTime=$this->instance->filectime('/lorem.txt'); $mTime=$this->instance->filemtime('/lorem.txt'); - $this->assertTrue($ctimeStart<=$cTime); - $this->assertTrue($cTime<=$ctimeEnd); - $this->assertTrue($ctimeStart<=$mTime); - $this->assertTrue($mTime<=$ctimeEnd); + if($cTime!=-1){//not everything can support ctime + $this->assertTrue(($ctimeStart-1)<=$cTime); + $this->assertTrue($cTime<=($ctimeEnd+1)); + } + $this->assertTrue(($ctimeStart-1)<=$mTime); + $this->assertTrue($mTime<=($ctimeEnd+1)); $this->assertEqual(filesize($textFile),$this->instance->filesize('/lorem.txt')); $stat=$this->instance->stat('/lorem.txt'); @@ -153,8 +155,8 @@ abstract class Test_FileStorage extends UnitTestCase { $originalCTime=$cTime; $cTime=$this->instance->filectime('/lorem.txt'); $mTime=$this->instance->filemtime('/lorem.txt'); - $this->assertTrue($mtimeStart<=$mTime); - $this->assertTrue($mTime<=$mtimeEnd); + $this->assertTrue(($mtimeStart-1)<=$mTime); + $this->assertTrue($mTime<=($mtimeEnd+1)); $this->assertEqual($cTime,$originalCTime); if($this->instance->touch('/lorem.txt',100)!==false){ @@ -170,8 +172,8 @@ abstract class Test_FileStorage extends UnitTestCase { $mtimeEnd=time(); $originalCTime=$cTime; $mTime=$this->instance->filemtime('/lorem.txt'); - $this->assertTrue($mtimeStart<=$mTime); - $this->assertTrue($mTime<=$mtimeEnd); + $this->assertTrue(($mtimeStart-1)<=$mTime); + $this->assertTrue($mTime<=($mtimeEnd+1)); } public function testSearch(){ |