diff options
author | Raghubansh Kumar <kraghuba@php.net> | 2008-06-20 04:21:58 +0000 |
---|---|---|
committer | Raghubansh Kumar <kraghuba@php.net> | 2008-06-20 04:21:58 +0000 |
commit | 48b0cc41349653c401b6d7a973e0054b20ac4548 (patch) | |
tree | 7eee46095ce3a91a2355685e0e31524da0c1dfc9 /ext/standard/tests/strings/vfprintf_error1.phpt | |
parent | 2bb7df3504fd7fbbd1fa04dee0a8095fe557cc77 (diff) | |
download | php-git-48b0cc41349653c401b6d7a973e0054b20ac4548.tar.gz |
New testcases for vfprintf(), Committed for Felix De Vliegher, TestFest Task No: 124, Tested on RHEL5 -32bit, WinXP-32bit
Added *.txt to .cvsignore
Diffstat (limited to 'ext/standard/tests/strings/vfprintf_error1.phpt')
-rw-r--r-- | ext/standard/tests/strings/vfprintf_error1.phpt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt new file mode 100644 index 0000000000..b8cc170973 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test vfprintf() function : error conditions (more than expected arguments) +--CREDITS-- +Felix De Vliegher <felix.devliegher@gmail.com> +--INI-- +precision=14 +--FILE-- +<?php +/* Prototype : int vfprintf(resource stream, string format, array args) + * Description: Output a formatted string into a stream + * Source code: ext/standard/formatted_print.c + * Alias to functions: + */ + +// Open handle +$file = 'vfprintf_test.txt'; +$fp = fopen( $file, "a+" ); + +echo "\n-- Testing vfprintf() function with more than expected no. of arguments --\n"; +$format = 'string_val'; +$args = array( 1, 2 ); +$extra_arg = 10; +var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); +var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); + +// Close handle +fclose($fp); + +?> +===DONE=== +--CLEAN-- +<?php + +$file = 'vfprintf_text.txt'; +unlink( $file ); + +?> +--EXPECTF-- +-- Testing vfprintf() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for vfprintf() in %s on line %d +NULL + +Warning: Wrong parameter count for vfprintf() in %s on line %d +NULL +===DONE=== |