diff options
Diffstat (limited to '_test')
-rw-r--r-- | _test/cases/inc/indexer_idx_indexlengths.test.php | 61 | ||||
-rw-r--r-- | _test/lib/cli_reporter.php | 8 |
2 files changed, 8 insertions, 61 deletions
diff --git a/_test/cases/inc/indexer_idx_indexlengths.test.php b/_test/cases/inc/indexer_idx_indexlengths.test.php index d1339a111..8565639be 100644 --- a/_test/cases/inc/indexer_idx_indexlengths.test.php +++ b/_test/cases/inc/indexer_idx_indexlengths.test.php @@ -56,66 +56,5 @@ class indexer_idx_indexlengths_test extends UnitTestCase { } } -class indexer_idx_indexlengths_time extends UnitTestCase { - - /** - * Test the time improvments of the new function - * Time reference for 10000 call oneWords: 4,6s - * It's 90% faster - */ - function test_oneWord(){ - global $conf; - $filter[8] = array('dokuwiki'); - $start = microtime(true); - for ($i = 0; $i < 10000; $i++) { - $result = idx_indexLengths(&$filter); - } - $end = microtime(true); - $time = $end - $start; - $timeref = 4.6*0.10; // actual execution time of 4,6s for 10000 calls - echo "1) 10% ref : $timeref -> $time \n"; - $this->assertTrue($time < $timeref); - } - - /** - * Test the time improvments of the new function - * Time reference for 10000 call moreWords: 4,6s - * It's 90% faster - */ - function test_moreWords() { - global $conf; - $filter = array( 4 => array('test'), 8 => array('dokuwiki'), 7 => array('powered')); - // more words should return the indexes - $start = microtime(true); - for ($i = 0; $i < 10000; $i++) { - $result = idx_indexLengths(&$filter); - } - $end = microtime(true); - $time = $end - $start; - $timeref = 4.6*0.10; // actual execution time of 4,6s for 10000 calls - echo "2) 10% ref : $timeref -> $time \n"; - $this->assertTrue($time < $timeref); - } - - /** - * Test the time improvments of the new function - * Time reference for 10000 call on minValue: 4,9s - * Sould be at least 65% faster - * Test fail with no cache - */ - function test_minValue() { - global $conf; - $filter = 5; - $start = microtime(true); - for ($i = 0; $i < 10000; $i++) { - $result = idx_indexLengths(&$filter); - } - $end = microtime(true); - $time = $end - $start; - $timeref = 4.9 * 0.35; // actual execution time of 4,9s for 10000 calls - echo "3) 35% ref : $timeref -> $time \n"; - $this->assertTrue($time < $timeref); - } -} //Setup VIM: ex: et ts=4 enc=utf-8 : diff --git a/_test/lib/cli_reporter.php b/_test/lib/cli_reporter.php index e83911c73..3ad88119d 100644 --- a/_test/lib/cli_reporter.php +++ b/_test/lib/cli_reporter.php @@ -62,6 +62,14 @@ class CLIReporter extends SimpleReporter { } /** + * reset failinfo + */ + function paintPass($message) { + parent::paintPass($message); + $this->_failinfo = ''; + } + + /** * Paint exception faildetail to STDERR. */ function paintException($message) { |