Thread: [Cs-content-commits] SF.net SVN: cs-content:[449] trunk/1.0/tests/testOfCSFileSystem.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-19 20:14:11
|
Revision: 449 http://cs-content.svn.sourceforge.net/cs-content/?rev=449&view=rev Author: crazedsanity Date: 2009-08-19 20:14:05 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Gives reason for error if there was one... NOTE::: test_basic_rw() is randomly failing, not sure why (maybe it is pulling the last line and finding it blank?) Modified Paths: -------------- trunk/1.0/tests/testOfCSFileSystem.php Modified: trunk/1.0/tests/testOfCSFileSystem.php =================================================================== --- trunk/1.0/tests/testOfCSFileSystem.php 2009-08-19 16:14:43 UTC (rev 448) +++ trunk/1.0/tests/testOfCSFileSystem.php 2009-08-19 20:14:05 UTC (rev 449) @@ -160,7 +160,7 @@ $this->writer->go_to_line($randomLine); $lineContents = $this->writer->get_next_line(); - $this->assertTrue(preg_match('/^line #'. $randomLine .' /', $lineContents)); + $this->assertTrue(preg_match('/^line #'. $randomLine .' /', $lineContents), 'Random line #'. $randomLine .' did not start with '. $randomLine .': ('. $lineContents .')'); } $this->writer->go_to_last_line(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-20 14:29:32
|
Revision: 450 http://cs-content.svn.sourceforge.net/cs-content/?rev=450&view=rev Author: crazedsanity Date: 2009-08-20 14:29:20 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Fix test so it doesn't check a line that is known to be blank... /tests/testOfCSFileSystem.php: * test_basic_rw(): -- set the random line to have a max of the actual number of lines -1 (prevents an off-by-one error). Modified Paths: -------------- trunk/1.0/tests/testOfCSFileSystem.php Modified: trunk/1.0/tests/testOfCSFileSystem.php =================================================================== --- trunk/1.0/tests/testOfCSFileSystem.php 2009-08-19 20:14:05 UTC (rev 449) +++ trunk/1.0/tests/testOfCSFileSystem.php 2009-08-20 14:29:20 UTC (rev 450) @@ -155,7 +155,7 @@ $linesToTest = 100; for($i=0;$i<$linesToTest;$i++) { - $randomLine = rand(0, $actualNum); + $randomLine = rand(0, ($actualNum -1)); $this->writer->go_to_line($randomLine); $lineContents = $this->writer->get_next_line(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-09-15 22:15:10
|
Revision: 460 http://cs-content.svn.sourceforge.net/cs-content/?rev=460&view=rev Author: crazedsanity Date: 2009-09-15 20:53:51 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Make sure file reading/writing tests ONLY work with files (not folders). Modified Paths: -------------- trunk/1.0/tests/testOfCSFileSystem.php Modified: trunk/1.0/tests/testOfCSFileSystem.php =================================================================== --- trunk/1.0/tests/testOfCSFileSystem.php 2009-09-15 20:28:18 UTC (rev 459) +++ trunk/1.0/tests/testOfCSFileSystem.php 2009-09-15 20:53:51 UTC (rev 460) @@ -67,16 +67,24 @@ //okay, read all the files & make the writer create them. $matchSize = array(); foreach($insideLs as $file=>$data) { - $this->assertEqual(1, $this->writer->create_file($file)); - - $this->assertNotEqual($this->writer->realcwd, $this->reader->realcwd); - - //now read data out of one & write into the other, make sure they're the same size. - $fileSize = $this->writer->write($this->reader->read($file), $file); - $this->assertEqual($fileSize, $data['size']); - - //now get rid of the new file. - $this->writer->rm($file); + if($data['type'] == 'file') { + $this->assertEqual(1, $this->writer->create_file($file)); + + $this->assertNotEqual($this->writer->realcwd, $this->reader->realcwd); + + //now read data out of one & write into the other, make sure they're the same size. + $fileSize = $this->writer->write($this->reader->read($file), $file); + if(!$this->assertEqual($fileSize, $data['size'], "Invalid file size for '". $file ."' (". $fileSize ." != ". $data['size'] .")")) { + $this->gfObj->debug_print($this->writer->ls($file)); + $this->gfObj->debug_print($this->reader->ls($file)); + + $this->gfObj->debug_print($this->writer); + $this->gfObj->debug_print($this->reader); + } + + //now get rid of the new file. + $this->writer->rm($file); + } } //lets take the contents of ALL of those files, push it into one big file, and make sure it is identical. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |