r89027 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89026‎ | r89027 | r89028 >
Date:08:38, 28 May 2011
Author:hashar
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/normal/CleanUpTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/normal/CleanUpTest.php
@@ -140,8 +140,8 @@
141141 * @todo document
142142 */
143143 function doTestDoubleBytes( $head, $tail ) {
144 - for( $first = 0xc0; $first < 0x100; $first++ ) {
145 - for( $second = 0x80; $second < 0x100; $second++ ) {
 144+ for( $first = 0xc0; $first < 0x100; $first+=2 ) {
 145+ for( $second = 0x80; $second < 0x100; $second+=2 ) {
146146 $char = $head . chr( $first ) . chr( $second ) . $tail;
147147 $clean = UtfNormal::cleanUp( $char );
148148 $x = sprintf( "%02X,%02X", $first, $second );
@@ -184,8 +184,8 @@
185185
186186 /** @todo document */
187187 function doTestTripleBytes( $head, $tail ) {
188 - for( $first = 0xc0; $first < 0x100; $first++ ) {
189 - for( $second = 0x80; $second < 0x100; $second++ ) {
 188+ for( $first = 0xc0; $first < 0x100; $first+=2 ) {
 189+ for( $second = 0x80; $second < 0x100; $second+=2 ) {
190190 #for( $third = 0x80; $third < 0x100; $third++ ) {
191191 for( $third = 0x80; $third < 0x81; $third++ ) {
192192 $char = $head . chr( $first ) . chr( $second ) . chr( $third ) . $tail;

Status & tagging log