From 8058f9fd111e07fe6c8ef8ae91b6da5a4d0d6f90 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 26 Jun 2006 23:35:22 +0000 Subject: [PATCH] add new tests --- ext/zlib/tests/004.phpt | 89 ++++++++++++++++++++++++++++++++++++++ ext/zlib/tests/004.txt.gz | Bin 0 -> 150 bytes ext/zlib/tests/005.phpt | 72 ++++++++++++++++++++++++++++++ ext/zlib/tests/006.phpt | 73 +++++++++++++++++++++++++++++++ ext/zlib/tests/007.phpt | 51 ++++++++++++++++++++++ 5 files changed, 285 insertions(+) create mode 100644 ext/zlib/tests/004.phpt create mode 100644 ext/zlib/tests/004.txt.gz create mode 100644 ext/zlib/tests/005.phpt create mode 100644 ext/zlib/tests/006.phpt create mode 100644 ext/zlib/tests/007.phpt diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt new file mode 100644 index 0000000000..a758b8c7b3 --- /dev/null +++ b/ext/zlib/tests/004.phpt @@ -0,0 +1,89 @@ +--TEST-- +gzfile() with various invalid params +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d +NULL +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(37) "When you\'re taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +Done diff --git a/ext/zlib/tests/004.txt.gz b/ext/zlib/tests/004.txt.gz new file mode 100644 index 0000000000000000000000000000000000000000..07805db7558078115fc0dc63a4426a87508d382a GIT binary patch literal 150 zcmV;H0BQdpiwFo?U!X()128Z&E_8Tw06mQ{4gxU@1pB;VJ3d0g3#iS-cZmqL6gx!W z^%x}RygS!d1Kh@V0JhN>q*^qS#RPf;R27L%W^soQ` E06hOe-2eap literal 0 HcmV?d00001 diff --git a/ext/zlib/tests/005.phpt b/ext/zlib/tests/005.phpt new file mode 100644 index 0000000000..f43985b1b1 --- /dev/null +++ b/ext/zlib/tests/005.phpt @@ -0,0 +1,72 @@ +--TEST-- +gzcompress()/gzuncompress() and invalid params +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: gzcompress(): compression level (1000) must be within -1..9 in %s on line %d +bool(false) +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" + +Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: gzuncompress(): data error in %s on line %d +bool(false) + +Warning: gzuncompress(): length (-1) must be greater or equal zero in %s on line %d +bool(false) + +Warning: gzuncompress(): data error in %s on line %d +bool(false) + +Warning: gzuncompress(): data error in %s on line %d +bool(false) +string(94) "Answer me, it can't be so hard +Cry to relieve what's in your heart +Desolation, grief and agony" +string(94) "Answer me, it can't be so hard +Cry to relieve what's in your heart +Desolation, grief and agony" + +Warning: gzuncompress(): data error in %s on line %d +bool(false) +Done diff --git a/ext/zlib/tests/006.phpt b/ext/zlib/tests/006.phpt new file mode 100644 index 0000000000..1ddb563784 --- /dev/null +++ b/ext/zlib/tests/006.phpt @@ -0,0 +1,73 @@ +--TEST-- +gzdeflate()/gzinflate() and invalid params +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: gzdeflate(): compression level (1000) must be within -1..9 in %s on line %d +bool(false) +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" +string(%d) "%s" + +Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d +NULL +bool(false) + +Warning: gzinflate(): data error in %s on line %d +bool(false) + +Warning: gzinflate(): length (-1) must be greater or equal zero in %s on line %d +bool(false) + +Warning: gzinflate(): data error in %s on line %d +bool(false) + +Warning: gzinflate(): data error in %s on line %d +bool(false) +string(94) "Answer me, it can't be so hard +Cry to relieve what's in your heart +Desolation, grief and agony" +string(94) "Answer me, it can't be so hard +Cry to relieve what's in your heart +Desolation, grief and agony" + +Warning: gzinflate(): data error in %s on line %d +bool(false) +Done diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt new file mode 100644 index 0000000000..ec37b99de6 --- /dev/null +++ b/ext/zlib/tests/007.phpt @@ -0,0 +1,51 @@ +--TEST-- +gzencode() and invalid params +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d +NULL + +Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d +bool(false) + +Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d +bool(false) + +Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d +bool(false) +string(%d) "%s" +string(%d) "%s" + +Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d +bool(false) +string(%d) "%s" +string(%d) "%s" +Done -- 2.50.1