Annotation of embedaddon/php/ext/posix/tests/posix_strerror_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test posix_strerror() function : error conditions 
                      3: --SKIPIF--
                      4: <?php 
                      5:        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9: /* Prototype  : proto string posix_strerror(int errno)
                     10:  * Description: Retrieve the system error message associated with the given errno. 
                     11:  * Source code: ext/posix/posix.c
                     12:  * Alias to functions: 
                     13:  */
                     14: 
                     15: echo "*** Testing posix_strerror() : error conditions ***\n";
                     16: 
                     17: echo "\n-- Testing posix_strerror() function with Zero arguments --\n";
                     18: var_dump( posix_strerror() );
                     19: 
                     20: echo "\n-- Testing posix_strerror() function with more than expected no. of arguments --\n";
                     21: $errno = posix_get_last_error();
                     22: $extra_arg = 10;
                     23: var_dump( posix_strerror($errno, $extra_arg) );
                     24: 
                     25: echo "\n-- Testing posix_strerror() function with invalid error number --\n";
                     26: $errno = -999;
                     27: echo gettype( posix_strerror($errno) )."\n";
                     28: 
                     29: echo "Done";
                     30: ?>
                     31: --EXPECTF--
                     32: *** Testing posix_strerror() : error conditions ***
                     33: 
                     34: -- Testing posix_strerror() function with Zero arguments --
                     35: 
                     36: Warning: posix_strerror() expects exactly 1 parameter, 0 given in %s on line %d
                     37: bool(false)
                     38: 
                     39: -- Testing posix_strerror() function with more than expected no. of arguments --
                     40: 
                     41: Warning: posix_strerror() expects exactly 1 parameter, 2 given in %s on line %d
                     42: bool(false)
                     43: 
                     44: -- Testing posix_strerror() function with invalid error number --
                     45: string
                     46: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>