From d7fd465bae053d6c0c9b7ad4c80769b64ef2347f Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Wed, 6 Feb 2008 10:56:22 +0000 Subject: Fixing bug 44042 --- scripts/dev/generate_phpt.php | 165 ++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 86 deletions(-) (limited to 'scripts') diff --git a/scripts/dev/generate_phpt.php b/scripts/dev/generate_phpt.php index 8fc30db02c..c43a911d57 100644 --- a/scripts/dev/generate_phpt.php +++ b/scripts/dev/generate_phpt.php @@ -33,13 +33,16 @@ dirlist($opt['source_loc'], $c_file_count, $all_c); $test_info = get_loc_proto($all_c, $opt['name'], $opt['source_loc']); if (!$test_info['found']) { - echo "Exiting: Unable to find implementation of {$opt['name']} in {$opt['source_loc']}\n"; + echo "\nExiting: Unable to find implementation of {$opt['name']} in {$opt['source_loc']}\n"; + if ($test_info['falias']) { + //But it may be aliased to something else + echo "\n{$test_info['name']}() is an alias of {$test_info['alias']}() --- Write test cases for this instead \n"; + } exit(); } if ($test_info['falias']) { - //If this function is falias'd to another function direct the test case writer to the principle alias for tests - echo "{$test_info['name']}() is an alias of {$test_info['alias']}() --- please see testcases for {$test_info['alias']}() \n"; - exit(); + //If this function is falias'd to another function tell the test case writer about them + echo "\nNote: {$test_info['name']}() is an alias of {$test_info['alias']}() \n"; } if ($test_info['error'] != NULL) { echo $test_info['error']."\n"; @@ -330,8 +333,8 @@ function gen_array_with_diff_values($var_type, $array_name, $code_block) { $variation_array['float'] = array( "10.5", "-10.5", - "10.5e10", - "10.6E-10", + "10.1234567e10", + "10.7654321E-10", ".5" ); @@ -801,86 +804,6 @@ function gen_one_arg_code($fn_name, $arg_name, $arg_type, $code_block) { array_push ($code_block, "var_dump( $fn_name(\$$arg_name) );"); return $code_block; } -/* - * Function to get the name of the source file in which the function is implemented and the proto comment - * Arguments: - * $all_c => list of all c files in the PHP source - * $fname => function name - * $source => directory path of PHP source code - * Returns: - * $test_info = > array( source file, return type, parameters, falias, found, alias, error) - */ -function get_loc_proto($all_c, $fname, $source) { -//get location - $test_info['name'] = $fname; - $test_info['source_file'] = NULL; - $test_info['return_type'] = NULL; - $test_info['params'] = NULL; - $test_info['falias'] = false; - $test_info['found'] = false; - $test_info['alias'] = NULL; - $test_info['error'] = NULL; - - $escaped_source = preg_replace("/\\\/", "\\\\\\", $source); - $escaped_source = preg_replace("/\//", "\\\/", $escaped_source); - - - for ($i=0; $i -- cgit v1.2.1