Annotation of embedaddon/php/ext/standard/tests/general_functions/usleep_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test usleep() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : void usleep ( int $micro_seconds )
6: * Description: Delays program execution for the given number of micro seconds.
7: * Source code: ext/standard/basic_functions.c
8: */
9:
10: set_time_limit(20);
11:
12: echo "*** Testing usleep() : error conditions ***\n";
13:
14: echo "\n-- Testing usleep() function with zero arguments --\n";
15: var_dump( usleep() );
16:
17: echo "\n-- Testing usleep() function with more than expected no. of arguments --\n";
18: $seconds = 10;
19: $extra_arg = 10;
20: var_dump( usleep($seconds, $extra_arg) );
21:
22: echo "\n-- Testing usleep() function with negative interval --\n";
23: $seconds = -10;
24: var_dump( usleep($seconds) );
25:
26: ?>
27: ===DONE===
28: --EXPECTF--
29: *** Testing usleep() : error conditions ***
30:
31: -- Testing usleep() function with zero arguments --
32:
33: Warning: usleep() expects exactly 1 parameter, 0 given in %s on line %d
34: NULL
35:
36: -- Testing usleep() function with more than expected no. of arguments --
37:
38: Warning: usleep() expects exactly 1 parameter, 2 given in %s on line %d
39: NULL
40:
41: -- Testing usleep() function with negative interval --
42:
43: Warning: usleep(): Number of microseconds must be greater than or equal to 0 in %s on line %d
44: bool(false)
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>