From: andy wharmby Date: Sat, 24 Jan 2009 12:47:31 +0000 (+0000) Subject: New get_extension_funcs() and getrusage() tests. Tested on Windows, Linux and Linux... X-Git-Tag: php-5.2.9RC1~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9745da78efc979233295cb6425f91561d9ac21a;p=php New get_extension_funcs() and getrusage() tests. Tested on Windows, Linux and Linux 64 bit --- diff --git a/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt b/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt new file mode 100644 index 0000000000..d87eb4c0c8 --- /dev/null +++ b/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt @@ -0,0 +1,23 @@ +--TEST-- +Test get_extension_funcs() function: basic test +--FILE-- + +===DONE=== +--EXPECTF-- +Simple testcase for get_extension_funcs() function +string(5) "array" +bool(true) +===DONE=== diff --git a/ext/standard/tests/general_functions/get_extension_funcs_error.phpt b/ext/standard/tests/general_functions/get_extension_funcs_error.phpt new file mode 100644 index 0000000000..e1d51d43a9 --- /dev/null +++ b/ext/standard/tests/general_functions/get_extension_funcs_error.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test get_extension_funcs() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_extension_funcs() : error conditions *** + +-- Too few arguments -- + +Warning: Wrong parameter count for get_extension_funcs() in %s on line %d +NULL + +-- Too many arguments -- + +Warning: Wrong parameter count for get_extension_funcs() in %s on line %d +NULL + +-- Invalid extension name -- +bool(false) +===DONE=== diff --git a/ext/standard/tests/general_functions/get_extension_funcs_variation.phpt b/ext/standard/tests/general_functions/get_extension_funcs_variation.phpt new file mode 100644 index 0000000000..7204eaa6e8 --- /dev/null +++ b/ext/standard/tests/general_functions/get_extension_funcs_variation.phpt @@ -0,0 +1,135 @@ +--TEST-- +Test get_extension_funcs() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_extension_funcs() function: with unexpected inputs for 'module_name' argument *** +-- Iteration 1 -- +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- +bool(false) +-- Iteration 8 -- +bool(false) +-- Iteration 9 -- +bool(false) +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- Iteration 12 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- Iteration 13 -- +bool(false) +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +bool(false) +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- +bool(false) +-- Iteration 18 -- +bool(false) +-- Iteration 19 -- +bool(false) +-- Iteration 20 -- +bool(false) +-- Iteration 21 -- +bool(false) +-- Iteration 22 -- +bool(false) +===DONE=== diff --git a/ext/standard/tests/general_functions/getrusage_basic.phpt b/ext/standard/tests/general_functions/getrusage_basic.phpt new file mode 100644 index 0000000000..c9b34597cf --- /dev/null +++ b/ext/standard/tests/general_functions/getrusage_basic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test getrusage() function: basic test +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +Simple testcase for getrusage() function +User time used (seconds) %d +User time used (microseconds) %d +===DONE=== diff --git a/ext/standard/tests/general_functions/getrusage_error.phpt b/ext/standard/tests/general_functions/getrusage_error.phpt new file mode 100644 index 0000000000..b13d4f0cdc --- /dev/null +++ b/ext/standard/tests/general_functions/getrusage_error.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test getrusage() function : error conditions - incorrect number of args +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing getrusage() : error conditions *** + +-- Testing getrusage() function with more than expected no. of arguments -- + +Warning: getrusage() expects at most 1 parameter, 2 given in %s on line %d + +-- Testing getrusage() function with invalid argument - non-numeric STRING-- + +Warning: getrusage() expects parameter 1 to be long, string given in %s on line %d + +-- Testing getrusage() function with invalid argument - ARRAY-- + +Warning: getrusage() expects parameter 1 to be long, array given in %s on line %d + +-- Testing getrusage() function with invalid argument - OBJECT -- + +Warning: getrusage() expects parameter 1 to be long, object given in %s on line %d + +-- Testing getrusage() function with invalid argument - RESOURCE -- + +Warning: getrusage() expects parameter 1 to be long, resource given in %s on line %d +===DONE=== diff --git a/ext/standard/tests/general_functions/getrusage_variation1.phpt b/ext/standard/tests/general_functions/getrusage_variation1.phpt new file mode 100644 index 0000000000..3daf9e5e61 --- /dev/null +++ b/ext/standard/tests/general_functions/getrusage_variation1.phpt @@ -0,0 +1,142 @@ +--TEST-- +Test getrusage() function : usage variation - diff data types as $who arg +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing getrusage() : usage variations *** + +-- Iteration 1 -- +User time used (microseconds) %d + +-- Iteration 2 -- +User time used (microseconds) %d + +-- Iteration 3 -- +User time used (microseconds) %d + +-- Iteration 4 -- +User time used (microseconds) %d + +-- Iteration 5 -- +User time used (microseconds) %d + +-- Iteration 6 -- +User time used (microseconds) %d + +-- Iteration 7 -- +User time used (microseconds) %d + +-- Iteration 8 -- +User time used (microseconds) %d + +-- Iteration 9 -- +User time used (microseconds) %d + +-- Iteration 10 -- +User time used (microseconds) %d + +-- Iteration 11 -- +User time used (microseconds) %d + +-- Iteration 12 -- +User time used (microseconds) %d + +-- Iteration 13 -- +User time used (microseconds) %d + +-- Iteration 14 -- +User time used (microseconds) %d + +-- Iteration 15 -- +User time used (microseconds) %d + +-- Iteration 16 -- +User time used (microseconds) %d + +-- Iteration 17 -- +User time used (microseconds) %d + +-- Iteration 18 -- +User time used (microseconds) %d + +-- Iteration 19 -- +User time used (microseconds) %d + +-- Iteration 20 -- +User time used (microseconds) %d + +-- Iteration 21 -- +User time used (microseconds) %d +===DONE===