From d54cf79cbc2a62a590695438fc9da452791f6f99 Mon Sep 17 00:00:00 2001 From: Felix De Vliegher Date: Sun, 22 Jun 2008 13:31:10 +0000 Subject: [PATCH] Testcases for vfprintf(), testfest task #133. --- .../tests/strings/vfprintf_basic.phpt | 72 +++++++++++++++ .../tests/strings/vfprintf_error1.phpt | 47 ++++++++++ .../tests/strings/vfprintf_error2.phpt | 49 +++++++++++ .../tests/strings/vfprintf_error3.phpt | 55 ++++++++++++ .../tests/strings/vfprintf_error4.phpt | 44 ++++++++++ .../tests/strings/vfprintf_variation1.phpt | 87 +++++++++++++++++++ 6 files changed, 354 insertions(+) create mode 100644 ext/standard/tests/strings/vfprintf_basic.phpt create mode 100644 ext/standard/tests/strings/vfprintf_error1.phpt create mode 100644 ext/standard/tests/strings/vfprintf_error2.phpt create mode 100644 ext/standard/tests/strings/vfprintf_error3.phpt create mode 100644 ext/standard/tests/strings/vfprintf_error4.phpt create mode 100644 ext/standard/tests/strings/vfprintf_variation1.phpt diff --git a/ext/standard/tests/strings/vfprintf_basic.phpt b/ext/standard/tests/strings/vfprintf_basic.phpt new file mode 100644 index 0000000000..f6a7733f60 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_basic.phpt @@ -0,0 +1,72 @@ +--TEST-- +Test vfprintf() function : basic functionality +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing vfprintf() : basic functionality *** +unicode(17) "Foo is 30 and bar" +int(17) +unicode(11) "bar bar bar" +int(11) +unicode(8) "54 digit" +int(8) +unicode(3) "1 0" +int(3) +unicode(5) "A B C" +int(5) +unicode(35) "1.000000e+3 2.000000E+4 2.000000e+2" +int(35) +unicode(2) "50" +int(2) +unicode(35) "Testing 1001 6 2.550200 foobar f 41" +int(35) +===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt new file mode 100644 index 0000000000..232aef5811 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test vfprintf() function : error conditions (more than expected arguments) +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--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=== diff --git a/ext/standard/tests/strings/vfprintf_error2.phpt b/ext/standard/tests/strings/vfprintf_error2.phpt new file mode 100644 index 0000000000..b010c4bd10 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_error2.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test vfprintf() function : error conditions (less than expected arguments) +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +-- Testing vfprintf() function with less 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 + +Warning: Wrong parameter count for vfprintf() in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_error3.phpt b/ext/standard/tests/strings/vfprintf_error3.phpt new file mode 100644 index 0000000000..f8ec4f371e --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_error3.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test vfprintf() function : error conditions (wrong argument types) +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +-- Testing vfprintf() function with wrong variable types as argument -- + +Notice: Array to string conversion in %s on line %d +int(5) +unicode(5) "Array" +int(9) +unicode(9) "Foo fake" +===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt new file mode 100644 index 0000000000..384d9cd740 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -0,0 +1,44 @@ +--TEST-- +Test vfprintf() function : error conditions (various conditions) +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +-- Testing vfprintf() function with other strangeties -- + +Warning: vfprintf(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Warning: vfprintf(): Zero is not a valid argument number in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt new file mode 100644 index 0000000000..b41c381117 --- /dev/null +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -0,0 +1,87 @@ +--TEST-- +Test vfprintf() function : variation functionality +--INI-- +precision=14 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing vfprintf() : variation functionality *** +unicode(6) "format" +int(6) +unicode(17) "Foo is 30 and bar" +int(17) +unicode(14) "Foobar testing" +int(14) +unicode(11) "bar bar bar" +int(11) +unicode(2) "50" +int(2) +unicode(0) "" +int(0) +unicode(38) "Testing 1001 6 2.550200 30 foobar f 41" +int(38) +bool(false) +bool(false) +bool(false) +bool(false) +===DONE=== -- 2.50.1