From: andy wharmby Date: Sat, 24 Jan 2009 12:47:36 +0000 (+0000) Subject: New get_extension_funcs() and getrusage() tests. Tested on Windows, Linux and Linux... X-Git-Tag: php-5.4.0alpha1~191^2~4402 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fd66a6a57ebc7d80b1f79036f611556e0d13ba5;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..e73e89faa2 --- /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 +unicode(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..33e32a66a5 --- /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: get_extension_funcs() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +-- Too many arguments -- + +Warning: get_extension_funcs() expects exactly 1 parameter, 2 given 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..84647ba378 --- /dev/null +++ b/ext/standard/tests/general_functions/get_extension_funcs_variation.phpt @@ -0,0 +1,137 @@ +--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 -- + +Warning: get_extension_funcs() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: get_extension_funcs() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: get_extension_funcs() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- 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 -- + +Warning: get_extension_funcs() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- 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..e2a08ee617 --- /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, Unicode 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===