nlopess Mon Mar 17 17:20:27 2008 UTC Modified files: /php-src run-tests.php Log: MFB: detect duplicate sections http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.344&r2=1.345&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.344 php-src/run-tests.php:1.345 --- php-src/run-tests.php:1.344 Wed Mar 5 20:11:35 2008 +++ php-src/run-tests.php Mon Mar 17 17:20:27 2008 @@ -24,7 +24,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: run-tests.php,v 1.344 2008/03/05 20:11:35 lstrojny Exp $ */ +/* $Id: run-tests.php,v 1.345 2008/03/17 17:20:27 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -447,7 +447,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.344 $'."\n"; + echo '$Revision: 1.345 $'."\n"; exit(1); default: echo "Illegal switch specified!\n"; @@ -1053,16 +1053,7 @@ "; // Load the sections of the test file. - $section_text = array( - 'TEST' => '', - 'SKIPIF' => '', - 'GET' => '', - 'COOKIE' => '', - 'POST_RAW' => '', - 'POST' => '', - 'UPLOAD' => '', - 'ARGS' => '', - ); + $section_text = array('TEST' => ''); $fp = fopen($file, "rt") or error("Cannot open test file: $file"); @@ -1087,6 +1078,12 @@ // Match the beginning of a section. if (preg_match('/^--([_A-Z]+)--/', $line, $r)) { $section = $r[1]; + + if (isset($section_text[$section])) { + $bork_info = "duplicated $section section"; + $borked = true; + } + $section_text[$section] = ''; $secfile = $section == 'FILE' || $section == 'FILEEOF' || $section == 'FILE_EXTERNAL'; $secdone = false; @@ -1454,7 +1451,7 @@ $env['HTTP_COOKIE'] = ''; } - $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : ''; + $args = isset($section_text['ARGS']) ? ' -- '.$section_text['ARGS'] : ''; if (array_key_exists('POST_RAW', $section_text) && !empty($section_text['POST_RAW'])) { $post = trim($section_text['POST_RAW']);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php