r81610 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81609‎ | r81610 | r81611 >
Date:22:14, 6 February 2011
Author:hashar
Status:ok
Tags:
Comment:
Ignore code coverage for compatibility and shell functions

The compatibility functions in GlobalFunctions are just wrapper for
their equivalent in the Fallback class. We should test the implementation
and we can safely ignore those wrappers.

Shell functions ignored make use of sleep() which is evil. They also
do some outputs to the console which is probably hard to test properly.
Given they are not critical, I just ignore their code coverage, we can
still test them though :)
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -22,29 +22,33 @@
2323 */
2424
2525 if( !function_exists( 'iconv' ) ) {
 26+ /** @codeCoverageIgnore */
2627 function iconv( $from, $to, $string ) {
2728 return Fallback::iconv( $from, $to, $string );
2829 }
2930 }
3031
3132 if ( !function_exists( 'mb_substr' ) ) {
 33+ /** @codeCoverageIgnore */
3234 function mb_substr( $str, $start, $count='end' ) {
3335 return Fallback::mb_substr( $str, $start, $count );
3436 }
3537
 38+ /** @codeCoverageIgnore */
3639 function mb_substr_split_unicode( $str, $splitPos ) {
3740 return Fallback::mb_substr_split_unicode( $str, $splitPos );
3841 }
3942 }
4043
4144 if ( !function_exists( 'mb_strlen' ) ) {
 45+ /** @codeCoverageIgnore */
4246 function mb_strlen( $str, $enc = '' ) {
4347 return Fallback::mb_strlen( $str, $enc );
4448 }
4549 }
4650
4751 if( !function_exists( 'mb_strpos' ) ) {
48 -
 52+ /** @codeCoverageIgnore */
4953 function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
5054 return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding );
5155 }
@@ -52,6 +56,7 @@
5357 }
5458
5559 if( !function_exists( 'mb_strrpos' ) ) {
 60+ /** @codeCoverageIgnore */
5661 function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
5762 return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding );
5863 }
@@ -60,10 +65,13 @@
6166
6267 // Support for Wietse Venema's taint feature
6368 if ( !function_exists( 'istainted' ) ) {
 69+ /** @codeCoverageIgnore */
6470 function istainted( $var ) {
6571 return 0;
6672 }
 73+ /** @codeCoverageIgnore */
6774 function taint( $var, $level = 0 ) {}
 75+ /** @codeCoverageIgnore */
6876 function untaint( $var, $level = 0 ) {}
6977 define( 'TC_HTML', 1 );
7078 define( 'TC_SHELL', 1 );
@@ -73,8 +81,6 @@
7482 }
7583 /// @endcond
7684
77 -
78 -
7985 /**
8086 * Like array_diff( $a, $b ) except that it works with two-dimensional arrays.
8187 */
@@ -3067,6 +3073,7 @@
30683074 * Should low-performance queries be disabled?
30693075 *
30703076 * @return Boolean
 3077+ * @codeCoverageIgnore
30713078 */
30723079 function wfQueriesMustScale() {
30733080 global $wgMiserMode;
@@ -3125,6 +3132,7 @@
31263133 /**
31273134 * Load an extension messages file
31283135 * @deprecated in 1.16, warnings in 1.18, remove in 1.20
 3136+ * @codeCoverageIgnore
31293137 */
31303138 function wfLoadExtensionMessages( $extensionName, $langcode = false ) {
31313139 wfDeprecated( __FUNCTION__ );
@@ -3262,6 +3270,7 @@
32633271 /**
32643272 * Count down from $n to zero on the terminal, with a one-second pause
32653273 * between showing each number. For use in command-line scripts.
 3274+ * @codeCoverageIgnore
32663275 */
32673276 function wfCountDown( $n ) {
32683277 for ( $i = $n; $i >= 0; $i-- ) {
@@ -3281,6 +3290,7 @@
32823291 * Generate a random 32-character hexadecimal token.
32833292 * @param $salt Mixed: some sort of salt, if necessary, to add to random
32843293 * characters before hashing.
 3294+ * @codeCoverageIgnore
32853295 */
32863296 function wfGenerateToken( $salt = '' ) {
32873297 $salt = serialize( $salt );

Status & tagging log