From: Raghubansh Kumar Date: Sat, 21 Jul 2007 17:14:50 +0000 (+0000) Subject: New testcases for fflush() function X-Git-Tag: php-5.2.4RC1~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff2a77b1d3c2d93a71ad4a244f9b9f1234b4d5c3;p=php New testcases for fflush() function --- diff --git a/ext/standard/tests/file/fflush_basic.phpt b/ext/standard/tests/file/fflush_basic.phpt new file mode 100755 index 0000000000..5cd81d7aa2 --- /dev/null +++ b/ext/standard/tests/file/fflush_basic.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test fflush() function: basic functionality +--FILE-- + + +--CLEAN-- + + +--EXPECTF-- +*** Testing fflush(): writing to a file and reading the contents *** +int(63) +bool(true) +first line of string +second line of string +third line of stringint(63) + +*** Testing fflush(): for return type *** +bool(true) + +*** Done *** diff --git a/ext/standard/tests/file/fflush_error.phpt b/ext/standard/tests/file/fflush_error.phpt new file mode 100644 index 0000000000..bfbd6cc1b1 --- /dev/null +++ b/ext/standard/tests/file/fflush_error.phpt @@ -0,0 +1,88 @@ +--TEST-- +Test fflush() function: error conditions +--FILE-- + + +--CLEAN-- + + +--EXPECTF-- +*** Testing error conditions *** +-- Testing fflush(): with zero argument -- + +Warning: Wrong parameter count for fflush() in %s on line %d +NULL +-- Testing fflush(): with more than expected number of arguments -- + +Warning: Wrong parameter count for fflush() in %s on line %d +NULL +-- Testing fflush(): with invalid arguments -- +-- Iteration 1 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +-- Iteration 2 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +-- Iteration 3 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +-- Iteration 4 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +-- Iteration 5 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +-- Iteration 6 -- + +Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/file/fflush_variation1-win32.phpt b/ext/standard/tests/file/fflush_variation1-win32.phpt new file mode 100644 index 0000000000..63cdf1721d --- /dev/null +++ b/ext/standard/tests/file/fflush_variation1-win32.phpt @@ -0,0 +1,526 @@ +--TEST-- +Test fflush() function: usage variations - files in different modes +--SKIPIF-- + + +--FILE-- + +--EXPECTF-- +*** Testing fflush(): with various types of files *** +-- Iteration 1 with file containing empty Data-- +-- File opened in w mode -- +bool(true) +bool(true) +int(0) +-- File opened in wb mode -- +bool(true) +bool(true) +int(0) +-- File opened in wt mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+t mode -- +bool(true) +bool(true) +int(0) +-- File opened in a mode -- +bool(true) +bool(true) +int(0) +-- File opened in ab mode -- +bool(true) +bool(true) +int(0) +-- File opened in at mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+t mode -- +bool(true) +bool(true) +int(0) +-- File opened in x mode -- +bool(true) +bool(true) +int(0) +-- File opened in xb mode -- +bool(true) +bool(true) +int(0) +-- File opened in xt mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+t mode -- +bool(true) +bool(true) +int(0) +-- Iteration 2 with file containing numeric Data-- +-- File opened in w mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in a mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in at mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in x mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- Iteration 3 with file containing text Data-- +-- File opened in w mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in a mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in at mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in x mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- Iteration 4 with file containing text_with_new_line Data-- +-- File opened in w mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in wb mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in wt mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(55) +-- File opened in w+ mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(55) +-- File opened in a mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in ab mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in at mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(65) +-- File opened in a+ mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(65) +-- File opened in x mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in xb mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in xt mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(55) +-- File opened in x+ mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(55) +-- Iteration 5 with file containing alphanumeric Data-- +-- File opened in w mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in a mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in at mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in x mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) diff --git a/ext/standard/tests/file/fflush_variation1.phpt b/ext/standard/tests/file/fflush_variation1.phpt new file mode 100755 index 0000000000..dc55fde8eb --- /dev/null +++ b/ext/standard/tests/file/fflush_variation1.phpt @@ -0,0 +1,526 @@ +--TEST-- +Test fflush() function: usage variations - files in different modes +--SKIPIF-- + + +--FILE-- + +--EXPECTF-- +*** Testing fflush(): with various types of files *** +-- Iteration 1 with file containing empty Data-- +-- File opened in w mode -- +bool(true) +bool(true) +int(0) +-- File opened in wb mode -- +bool(true) +bool(true) +int(0) +-- File opened in wt mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in w+t mode -- +bool(true) +bool(true) +int(0) +-- File opened in a mode -- +bool(true) +bool(true) +int(0) +-- File opened in ab mode -- +bool(true) +bool(true) +int(0) +-- File opened in at mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in a+t mode -- +bool(true) +bool(true) +int(0) +-- File opened in x mode -- +bool(true) +bool(true) +int(0) +-- File opened in xb mode -- +bool(true) +bool(true) +int(0) +-- File opened in xt mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+ mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+b mode -- +bool(true) +bool(true) +int(0) +-- File opened in x+t mode -- +bool(true) +bool(true) +int(0) +-- Iteration 2 with file containing numeric Data-- +-- File opened in w mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in a mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in at mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- File opened in x mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- Iteration 3 with file containing text Data-- +-- File opened in w mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in a mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in at mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- File opened in x mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- Iteration 4 with file containing text_with_new_line Data-- +-- File opened in w mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in wb mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in wt mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in a mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in ab mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in at mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- File opened in x mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in xb mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in xt mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- Iteration 5 with file containing alphanumeric Data-- +-- File opened in w mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in wb mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in wt mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in w+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in a mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in ab mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in at mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in a+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- File opened in x mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in xb mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in xt mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+ mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+b mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- File opened in x+t mode -- +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) diff --git a/ext/standard/tests/file/fflush_variation2.phpt b/ext/standard/tests/file/fflush_variation2.phpt new file mode 100755 index 0000000000..9498c978ef --- /dev/null +++ b/ext/standard/tests/file/fflush_variation2.phpt @@ -0,0 +1,442 @@ +--TEST-- +Test fflush() function: usage variations - links as resource +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing fflush(): with soft links to files opened in diff modes *** +-- Iteration 1 with file containing empty data -- +-- link opened in w mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in wb mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in wt mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in w+ mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in w+b mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in w+t mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in a mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in ab mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in at mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in a+ mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in a+b mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- link opened in a+t mode -- +bool(true) +bool(true) +bool(true) +int(0) +-- Iteration 2 with file containing numeric data -- +-- link opened in w mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in wb mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in wt mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in w+ mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in w+b mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in w+t mode -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +-- link opened in a mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- link opened in ab mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- link opened in at mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- link opened in a+ mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- link opened in a+b mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- link opened in a+t mode -- +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- Iteration 3 with file containing text data -- +-- link opened in w mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in wb mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in wt mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in w+ mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in w+b mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in w+t mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +-- link opened in a mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- link opened in ab mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- link opened in at mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- link opened in a+ mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- link opened in a+b mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- link opened in a+t mode -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- Iteration 4 with file containing text_with_new_line data -- +-- link opened in w mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in wb mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in wt mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in w+ mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in w+b mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in w+t mode -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +-- link opened in a mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- link opened in ab mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- link opened in at mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- link opened in a+ mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- link opened in a+b mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- link opened in a+t mode -- +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- Iteration 5 with file containing alphanumeric data -- +-- link opened in w mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in wb mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in wt mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in w+ mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in w+b mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in w+t mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +-- link opened in a mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- link opened in ab mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- link opened in at mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- link opened in a+ mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- link opened in a+b mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +-- link opened in a+t mode -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) + +--- Done --- diff --git a/ext/standard/tests/file/fflush_variation3.phpt b/ext/standard/tests/file/fflush_variation3.phpt new file mode 100755 index 0000000000..f239602486 --- /dev/null +++ b/ext/standard/tests/file/fflush_variation3.phpt @@ -0,0 +1,382 @@ +--TEST-- +Test fflush() function: usage variations - hard links as resource +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing fflush(): with hard links to files opened in diff modes *** +-- Iteration 1 with file containing empty data -- +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +bool(true) +bool(true) +int(0) +-- Iteration 2 with file containing numeric data -- +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +22222222222222222222222222222222222222222222222222int(50) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +bool(true) +bool(true) +bool(true) +222222222222222222222222222222222222222222222222222222222222int(60) +-- Iteration 3 with file containing text data -- +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text int(50) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +bool(true) +bool(true) +bool(true) +text text text text text text text text text text text text int(60) +-- Iteration 4 with file containing text_with_new_line data -- +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line of text +line +line of text +line +line of tint(50) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +bool(true) +bool(true) +bool(true) +line +line line +line of text +line +line of text +line +line of tint(60) +-- Iteration 5 with file containing alphanumeric data -- +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) +bool(true) +bool(true) +bool(true) +ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60) + +--- Done --- diff --git a/ext/standard/tests/file/fflush_variation4.phpt b/ext/standard/tests/file/fflush_variation4.phpt new file mode 100755 index 0000000000..cc0d9b0fb6 --- /dev/null +++ b/ext/standard/tests/file/fflush_variation4.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test fflush() function: usage variations - file opened in read-only mode +--FILE-- + +--EXPECTF-- +*** Testing fflush(): with file handles of files opened in various read modes *** +-- Iteration 1 with file opened in r mode -- +bool(true) +-- Iteration 2 with file opened in rb mode -- +bool(true) +-- Iteration 3 with file opened in rt mode -- +bool(true) + +--- Done ---