r81602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81601‎ | r81602 | r81603 >
Date:20:24, 6 February 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
Reduce range of IPv6 tested by testValidIPs

By using steps of 0xF, the number of assertions is reduced from 70k
to 5k revisions. It is not that useful to test all of them.

Follow up r76569
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/IPTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/IPTest.php
@@ -102,7 +102,7 @@
103103 $this->assertTrue( IP::isValid( $ip ) , "$ip is a valid IPv4 address" );
104104 }
105105 }
106 - foreach ( range( 0x0, 0xFFFF ) as $i ) {
 106+ foreach ( range( 0x0, 0xFFFF, 0xF ) as $i ) {
107107 $a = sprintf( "%04x", $i );
108108 $b = sprintf( "%03x", $i );
109109 $c = sprintf( "%02x", $i );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76569Fix ranges formatting issue when testing for (g,z) in IPv6 address...hashar12:08, 12 November 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   21:15, 6 February 2011

Yeah, I was thinking that was overkill :)

Status & tagging log