From af02c4193b12da0943432ab1ecef6609969f2932 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 28 May 2011 08:38:14 +0000 Subject: [PATCH] Only run CleanUpTest on a quarter of the cases. Speed up the testDoubleBytes & testTripleBytes which generates 32k assertions. The processing took 12 and 18 seconds respectively on my computer, now down to 8k assertions. --- tests/phpunit/includes/normal/CleanUpTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/includes/normal/CleanUpTest.php b/tests/phpunit/includes/normal/CleanUpTest.php index 1ac43d7258..d5ad18d856 100644 --- a/tests/phpunit/includes/normal/CleanUpTest.php +++ b/tests/phpunit/includes/normal/CleanUpTest.php @@ -140,8 +140,8 @@ class CleanUpTest extends MediaWikiTestCase { * @todo document */ function doTestDoubleBytes( $head, $tail ) { - for( $first = 0xc0; $first < 0x100; $first++ ) { - for( $second = 0x80; $second < 0x100; $second++ ) { + for( $first = 0xc0; $first < 0x100; $first+=2 ) { + for( $second = 0x80; $second < 0x100; $second+=2 ) { $char = $head . chr( $first ) . chr( $second ) . $tail; $clean = UtfNormal::cleanUp( $char ); $x = sprintf( "%02X,%02X", $first, $second ); @@ -184,8 +184,8 @@ class CleanUpTest extends MediaWikiTestCase { /** @todo document */ function doTestTripleBytes( $head, $tail ) { - for( $first = 0xc0; $first < 0x100; $first++ ) { - for( $second = 0x80; $second < 0x100; $second++ ) { + for( $first = 0xc0; $first < 0x100; $first+=2 ) { + for( $second = 0x80; $second < 0x100; $second+=2 ) { #for( $third = 0x80; $third < 0x100; $third++ ) { for( $third = 0x80; $third < 0x81; $third++ ) { $char = $head . chr( $first ) . chr( $second ) . chr( $third ) . $tail; -- 2.20.1