From: Ant Phillips Date: Wed, 10 Dec 2008 10:35:40 +0000 (+0000) Subject: Tests for bug #43841 and #45923 X-Git-Tag: NEWS~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0397dd836ba1b73707eb70f236879e43dda45ab7;p=php Tests for bug #43841 and #45923 --- diff --git a/ext/mbstring/tests/bug43841.phpt b/ext/mbstring/tests/bug43841.phpt new file mode 100644 index 0000000000..098d267bf2 --- /dev/null +++ b/ext/mbstring/tests/bug43841.phpt @@ -0,0 +1,86 @@ +--TEST-- +Test mb_strrpos() function : mb_strrpos offset is byte count for negative values +--XFAIL-- +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- + +-- Offset is -25 -- +Multibyte String: + +Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +ASCII String: +mb_strrpos: + +Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +strrpos: + +Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Offset is -24 -- +Multibyte String: + +Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +ASCII String: +mb_strrpos: + +Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +strrpos: + +Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Offset is -13 -- +Multibyte String: +bool(false) +ASCII String: +mb_strrpos: +bool(false) +strrpos: +bool(false) + +-- Offset is -12 -- +Multibyte String: +int(9) +ASCII String: +mb_strrpos: +int(9) +strrpos: +int(9) diff --git a/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt b/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt new file mode 100644 index 0000000000..73980f9700 --- /dev/null +++ b/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt @@ -0,0 +1,119 @@ +--TEST-- +Test mb_stripos() function : usage variations - Pass different integers as $offset argument +--XFAIL-- +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_stripos() : usage variations *** + +**-- Offset is: -10 --** +-- ASCII String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +--Multibyte String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) + +**-- Offset is: 0 --** +-- ASCII String -- +int(9) +--Multibyte String -- +int(9) + +**-- Offset is: 10 --** +-- ASCII String -- +int(20) +--Multibyte String -- +int(20) + +**-- Offset is: 20 --** +-- ASCII String -- +int(20) +--Multibyte String -- +int(20) + +**-- Offset is: 30 --** +-- ASCII String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +--Multibyte String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) + +**-- Offset is: 40 --** +-- ASCII String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +--Multibyte String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) + +**-- Offset is: 50 --** +-- ASCII String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +--Multibyte String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) + +**-- Offset is: 60 --** +-- ASCII String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +--Multibyte String -- + +Warning: mb_stripos(): Offset not contained in string. in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt b/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt new file mode 100644 index 0000000000..3f52f57fc8 --- /dev/null +++ b/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt @@ -0,0 +1,206 @@ +--TEST-- +Test mb_strripos() function : usage variations - pass different data types as $offset arg +--XFAIL-- +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing mb_strripos() : usage variations *** + +-- Iteration 1 -- +int(8) + +-- Iteration 2 -- +int(8) + +-- Iteration 3 -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Iteration 4 -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Iteration 5 -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Iteration 6 -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Iteration 7 -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +-- Iteration 8 -- +int(8) + +-- Iteration 9 -- +int(8) + +-- Iteration 10 -- +int(8) + +-- Iteration 11 -- +int(8) + +-- Iteration 12 -- +int(8) + +-- Iteration 13 -- +int(8) + +-- Iteration 14 -- +int(8) + +-- Iteration 15 -- +int(8) + +-- Iteration 16 -- + +Warning: mb_strripos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: mb_strripos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: mb_strripos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 19 -- + +Warning: mb_strripos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: mb_strripos() expects parameter 3 to be long, string given in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: mb_strripos() expects parameter 3 to be long, object given in %s on line %d +bool(false) + +-- Iteration 22 -- +int(8) + +-- Iteration 23 -- +int(8) + +-- Iteration 24 -- + +Warning: mb_strripos() expects parameter 3 to be long, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt b/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt new file mode 100644 index 0000000000..28401c219f --- /dev/null +++ b/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt @@ -0,0 +1,115 @@ +--TEST-- +Test mb_strripos() function : usage variations - Pass different integers as $offset argument +--XFAIL-- +--SKIPIF-- + +--FILE-- + + +--EXPECTF-- +*** Testing mb_strripos() : usage variations *** + +**-- Offset is: -10 --** +-- ASCII String -- +int(9) +--Multibyte String -- +int(9) + +**-- Offset is: 0 --** +-- ASCII String -- +int(20) +--Multibyte String -- +int(20) + +**-- Offset is: 10 --** +-- ASCII String -- +int(20) +--Multibyte String -- +int(20) + +**-- Offset is: 20 --** +-- ASCII String -- +int(20) +--Multibyte String -- +int(20) + +**-- Offset is: 30 --** +-- ASCII String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +--Multibyte String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +**-- Offset is: 40 --** +-- ASCII String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +--Multibyte String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +**-- Offset is: 50 --** +-- ASCII String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +--Multibyte String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) + +**-- Offset is: 60 --** +-- ASCII String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +--Multibyte String -- + +Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d +bool(false) +Done \ No newline at end of file