From: Antony Dovgal Date: Tue, 6 Nov 2007 12:54:13 +0000 (+0000) Subject: fix tests, add 64bit versions X-Git-Tag: RELEASE_2_0_0a1~1439 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a579d09bb758918b840bfcdbf2f7eca527adaf02;p=php fix tests, add 64bit versions --- diff --git a/ext/standard/tests/strings/vsprintf_basic7.phpt b/ext/standard/tests/strings/vsprintf_basic7.phpt index 436471d081..e0e339a7ee 100644 --- a/ext/standard/tests/strings/vsprintf_basic7.phpt +++ b/ext/standard/tests/strings/vsprintf_basic7.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : basic functionality - unsigned format +--SKIPIF-- + --FILE-- +--FILE-- + +--EXPECTF-- +*** Testing vsprintf() : basic functionality - using unsigned format *** +string(20) "18446744073709550505" +string(41) "18446744073709550505 18446744073708317049" +string(62) "18446744073709550505 18446744073708317049 18446744073707206184" +Done +--UEXPECTF-- +*** Testing vsprintf() : basic functionality - using unsigned format *** +unicode(20) "18446744073709550505" +unicode(41) "18446744073709550505 18446744073708317049" +unicode(62) "18446744073709550505 18446744073708317049 18446744073707206184" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation11.phpt b/ext/standard/tests/strings/vsprintf_variation11.phpt index 3a48bca1b6..a3cc7c734f 100644 --- a/ext/standard/tests/strings/vsprintf_variation11.phpt +++ b/ext/standard/tests/strings/vsprintf_variation11.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - octal formats with octal values +--SKIPIF-- + --FILE-- +--FILE-- + + +--EXPECTF-- +*** Testing vsprintf() : octal formats with octal values *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(25) "1777777777777777777777 1 " + +-- Iteration 3 -- +string(60) "1777777777760000000000 o, 17777777777 1777777777760000000001" + +-- Iteration 4 -- +string(49) " 1777777777777776543211 0000" + +-- Iteration 5 -- +string(54) "111 2222 1777777777777777444445 1777777777777733333334" + +-- Iteration 6 -- +string(17) "11073 7653 123 12" + +-- Iteration 7 -- +string(6) "% %o o" + +-- Iteration 8 -- +string(7) "1 2 3 4" +Done +--UEXPECTF-- +*** Testing vsprintf() : octal formats with octal values *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(25) "1777777777777777777777 1 " + +-- Iteration 3 -- +unicode(60) "1777777777760000000000 o, 17777777777 1777777777760000000001" + +-- Iteration 4 -- +unicode(49) " 1777777777777776543211 0000" + +-- Iteration 5 -- +unicode(54) "111 2222 1777777777777777444445 1777777777777733333334" + +-- Iteration 6 -- +unicode(17) "11073 7653 123 12" + +-- Iteration 7 -- +unicode(6) "% %o o" + +-- Iteration 8 -- +unicode(7) "1 2 3 4" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation12.phpt b/ext/standard/tests/strings/vsprintf_variation12.phpt index f588f93905..b61df97fdb 100644 --- a/ext/standard/tests/strings/vsprintf_variation12.phpt +++ b/ext/standard/tests/strings/vsprintf_variation12.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - octal formats with non-octal values +--SKIPIF-- + --FILE-- +--FILE-- +"12twelve"), + array("3"), array("4"), array("1"), array("2") ), + + // array of boolean data + array( true, TRUE, false, + TRUE, 0, FALSE, 1, + true, false, TRUE, + 0, 1, 1, 0, + 1, TRUE, 0, FALSE), + +); + +// looping to test vsprintf() with different octal formats from the above $format array +// and with non-octal values from the above $args_array array +$counter = 1; +foreach($args_array as $args) { + echo "\n-- Iteration $counter --\n"; + var_dump( vsprintf($formats, $args) ); + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing vsprintf() : octal formats and non-octal values *** + +-- Iteration 1 -- +string(149) "2 0 12 + 361100 o 1777777777777777775456 2322 + + 30071 14 1777777777777777777764 1777777777777777416700 + 12 361100 2 0" + +-- Iteration 2 -- +string(201) "2 1777777777777777777776 2 + 361100 o 1777777777777720715133 57062645 + + 57060664 4475347 1777777777777721631371 1777777777777720717336 + 2 361100 2 1777777777777777777776" + +-- Iteration 3 -- +string(99) "0 0 0 + 173 o 1777777777777777777605 173 + + 2322 0 $0 _0 + 0 173 0 0" + +-- Iteration 4 -- +string(75) "1 1 1 + 1 o 1 1 + + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 5 -- +string(75) "1 1 0 + 1 o 0 1 + + #0 1 $1 _0 + 0 1 1 1" +Done +--UEXPECTF-- +*** Testing vsprintf() : octal formats and non-octal values *** + +-- Iteration 1 -- +unicode(149) "2 0 12 + 361100 o 1777777777777777775456 2322 + + 30071 14 1777777777777777777764 1777777777777777416700 + 12 361100 2 0" + +-- Iteration 2 -- +unicode(201) "2 1777777777777777777776 2 + 361100 o 1777777777777720715133 57062645 + + 57060664 4475347 1777777777777721631371 1777777777777720717336 + 2 361100 2 1777777777777777777776" + +-- Iteration 3 -- +unicode(99) "0 0 0 + 173 o 1777777777777777777605 173 + + 2322 0 $0 _0 + 0 173 0 0" + +-- Iteration 4 -- +unicode(75) "1 1 1 + 1 o 1 1 + + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 5 -- +unicode(75) "1 1 0 + 1 o 0 1 + + #0 1 $1 _0 + 0 1 1 1" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation13.phpt b/ext/standard/tests/strings/vsprintf_variation13.phpt index 1e2fe6e7f6..dc0b20a4a1 100644 --- a/ext/standard/tests/strings/vsprintf_variation13.phpt +++ b/ext/standard/tests/strings/vsprintf_variation13.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - hexa formats with hexa values +--SKIPIF-- + --FILE-- +--FILE-- + + +--EXPECTF-- +*** Testing vsprintf() : hexa formats with hexa values *** + +-- Iteration 1 -- +string(1) "0" + +-- Iteration 2 -- +string(21) "ffffffffffffffff 1 22" + +-- Iteration 3 -- +string(36) "7fffffff x, 7000000 ffffffff80000000" + +-- Iteration 4 -- +string(43) " ffffffffffed2979 0000" + +-- Iteration 5 -- +string(30) "#1 2222 1b6db ffffffffbbbbbbbc" + +-- Iteration 6 -- +string(12) "123b fab 0 a" + +-- Iteration 7 -- +string(5) "%34 x" + +-- Iteration 8 -- +string(7) "1 2 3 4" +Done +--UEXPECTF-- +*** Testing vsprintf() : hexa formats with hexa values *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(21) "ffffffffffffffff 1 22" + +-- Iteration 3 -- +unicode(36) "7fffffff x, 7000000 ffffffff80000000" + +-- Iteration 4 -- +unicode(43) " ffffffffffed2979 0000" + +-- Iteration 5 -- +unicode(30) "#1 2222 1b6db ffffffffbbbbbbbc" + +-- Iteration 6 -- +unicode(12) "123b fab 0 a" + +-- Iteration 7 -- +unicode(5) "%34 x" + +-- Iteration 8 -- +unicode(7) "1 2 3 4" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation14.phpt b/ext/standard/tests/strings/vsprintf_variation14.phpt index 0a5e7b4a9d..149b4812f0 100644 --- a/ext/standard/tests/strings/vsprintf_variation14.phpt +++ b/ext/standard/tests/strings/vsprintf_variation14.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - hexa formats with non-hexa values +--SKIPIF-- + --FILE-- +--FILE-- +"12twelve"), + array("3"), array("4"), array("1"), array("2") ), + + // array of boolean data + array( true, TRUE, false, + TRUE, 0, FALSE, 1, + true, TRUE, FALSE, + 0, 1, 1, 0, + 1, TRUE, 0, FALSE), + +); + +// looping to test vsprintf() with different hexa formats from the above $format array +// and with non-hexa values from the above $args_array array + +$counter = 1; +foreach($args_array as $args) { + echo "\n-- Iteration $counter --\n"; + var_dump( vsprintf($formats, $args) ); + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing vsprintf() : hexa formats and non-hexa values *** + +-- Iteration 1 -- +string(125) "2 0 a + 1e240 x fffffffffffffb2e 4d2 + + 3039 c fffffffffffffff4 fffffffffffe1dc0 + a 1e240 2 0" + +-- Iteration 2 -- +string(164) "2 fffffffffffffffe 2 + 1e240 x ffffffffff439a5b bc65a5 + + bc61b4 127ae7 ffffffffff4732f9 ffffffffff439ede + 2 1e240 2 fffffffffffffffe" + +-- Iteration 3 -- +string(90) "0 0 0 + 7b x ffffffffffffff85 7b + + 4d2 0 $0 _0 + 0 7b 0 0" + +-- Iteration 4 -- +string(75) "1 1 1 + 1 x 1 1 + + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 5 -- +string(75) "1 1 0 + 1 x 0 1 + + #0 1 $1 _0 + 0 1 1 1" +Done +--UEXPECTF-- +*** Testing vsprintf() : hexa formats and non-hexa values *** + +-- Iteration 1 -- +unicode(125) "2 0 a + 1e240 x fffffffffffffb2e 4d2 + + 3039 c fffffffffffffff4 fffffffffffe1dc0 + a 1e240 2 0" + +-- Iteration 2 -- +unicode(164) "2 fffffffffffffffe 2 + 1e240 x ffffffffff439a5b bc65a5 + + bc61b4 127ae7 ffffffffff4732f9 ffffffffff439ede + 2 1e240 2 fffffffffffffffe" + +-- Iteration 3 -- +unicode(90) "0 0 0 + 7b x ffffffffffffff85 7b + + 4d2 0 $0 _0 + 0 7b 0 0" + +-- Iteration 4 -- +unicode(75) "1 1 1 + 1 x 1 1 + + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 5 -- +unicode(75) "1 1 0 + 1 x 0 1 + + #0 1 $1 _0 + 0 1 1 1" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation15.phpt b/ext/standard/tests/strings/vsprintf_variation15.phpt index 02caca59c9..01dac33eea 100644 --- a/ext/standard/tests/strings/vsprintf_variation15.phpt +++ b/ext/standard/tests/strings/vsprintf_variation15.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - unsigned formats with unsigned values +--SKIPIF-- + --FILE-- +--FILE-- + +--EXPECTF-- +*** Testing vsprintf() : unsigned formats and unsigned values *** + +-- Iteration 1 -- +string(16) "1234567 342391 0" + +-- Iteration 2 -- +string(24) "12345678900 u 1234 12345" + +-- Iteration 3 -- +string(25) " 1234000 0 120" + +-- Iteration 4 -- +string(10) "#1 0 $0 10" + +-- Iteration 5 -- +string(7) "1 2 3 4" +Done +--UEXPECTF-- +*** Testing vsprintf() : unsigned formats and unsigned values *** + +-- Iteration 1 -- +unicode(16) "1234567 342391 0" + +-- Iteration 2 -- +unicode(24) "12345678900 u 1234 12345" + +-- Iteration 3 -- +unicode(25) " 1234000 0 120" + +-- Iteration 4 -- +unicode(10) "#1 0 $0 10" + +-- Iteration 5 -- +unicode(7) "1 2 3 4" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation16.phpt b/ext/standard/tests/strings/vsprintf_variation16.phpt index 7e76a1282b..4bee1341df 100644 --- a/ext/standard/tests/strings/vsprintf_variation16.phpt +++ b/ext/standard/tests/strings/vsprintf_variation16.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - unsigned formats with signed and other types of values +--SKIPIF-- + --FILE-- +--FILE-- +"12twelve"), + array("3"), array("4"), array("1"), array("2") ), + + // array of boolean data + array( true, TRUE, false, + TRUE, 0, FALSE, 1, + true, TRUE, FALSE, + 0, 1, 1, 0, + 1, TRUE, 0, FALSE), + +); + +// looping to test vsprintf() with different unsigned formats from the above $format array +// and with signed and other types of values from the above $args_array array +$counter = 1; +foreach($args_array as $args) { + echo "\n-- Iteration $counter --\n"; + var_dump( vsprintf($formats, $args) ); + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing vsprintf() : unsigned formats and signed & other types of values *** + +-- Iteration 1 -- +string(143) "2 0 10 + 123456 u 1234 20000000000 + 2000000000000 22000000000000 12345 + 12 18446744073709551604 18446744073709428160 _3 + 10 123456 2 0" + +-- Iteration 2 -- +string(98) "0 0 0 + 123 u 18446744073709551493 123 + 0 0 0 + 1234 0 $0 _0 + 0 123 0 0" + +-- Iteration 3 -- +string(76) "1 1 1 + 1 u 1 1 + 1 1 1 + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 4 -- +string(76) "1 1 0 + 1 u 0 1 + 1 1 0 + #0 1 $1 _0 + 0 1 1 1" +Done +--UEXPECTF-- +*** Testing vsprintf() : unsigned formats and signed & other types of values *** + +-- Iteration 1 -- +unicode(143) "2 0 10 + 123456 u 1234 20000000000 + 2000000000000 22000000000000 12345 + 12 18446744073709551604 18446744073709428160 _3 + 10 123456 2 0" + +-- Iteration 2 -- +unicode(98) "0 0 0 + 123 u 18446744073709551493 123 + 0 0 0 + 1234 0 $0 _0 + 0 123 0 0" + +-- Iteration 3 -- +unicode(76) "1 1 1 + 1 u 1 1 + 1 1 1 + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 4 -- +unicode(76) "1 1 0 + 1 u 0 1 + 1 1 0 + #0 1 $1 _0 + 0 1 1 1" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation19.phpt b/ext/standard/tests/strings/vsprintf_variation19.phpt index 355793aae7..12648088f8 100644 --- a/ext/standard/tests/strings/vsprintf_variation19.phpt +++ b/ext/standard/tests/strings/vsprintf_variation19.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - with whitespaces in format strings +--SKIPIF-- + --FILE-- +--FILE-- + +--EXPECTF-- +*** Testing vsprintf() : with white spaces in format strings *** + +-- Iteration 1 -- +string(13) "111 222 333" + +-- Iteration 2 -- +string(29) "1.100000 0.200000 -0.600000" + +-- Iteration 3 -- +string(29) "1.120000 -1.130000 0.230000" + +-- Iteration 4 -- +string(9) "1 10 11" + +-- Iteration 5 -- +string(7) "A B C" + +-- Iteration 6 -- +string(38) "2.000000e+1 2.000000e-1 -2.000000e+1" + +-- Iteration 7 -- +string(28) "18446744073709551605 22 33" + +-- Iteration 8 -- +string(30) "12 1777777777777777777755 23" + +-- Iteration 9 -- +string(24) "11 ffffffffffffffde 33" + +-- Iteration 10 -- +string(24) "11 FFFFFFFFFFFFFFDE 33" + +-- Iteration 11 -- +string(38) "2.000000E+1 2.000000E-1 -2.000000E+1" +Done +--UEXPECTF-- +*** Testing vsprintf() : with white spaces in format strings *** + +-- Iteration 1 -- +unicode(13) "111 222 333" + +-- Iteration 2 -- +unicode(29) "1.100000 0.200000 -0.600000" + +-- Iteration 3 -- +unicode(29) "1.120000 -1.130000 0.230000" + +-- Iteration 4 -- +unicode(9) "1 10 11" + +-- Iteration 5 -- +unicode(7) "A B C" + +-- Iteration 6 -- +unicode(38) "2.000000e+1 2.000000e-1 -2.000000e+1" + +-- Iteration 7 -- +unicode(28) "18446744073709551605 22 33" + +-- Iteration 8 -- +unicode(30) "12 1777777777777777777755 23" + +-- Iteration 9 -- +unicode(24) "11 ffffffffffffffde 33" + +-- Iteration 10 -- +unicode(24) "11 FFFFFFFFFFFFFFDE 33" + +-- Iteration 11 -- +unicode(38) "2.000000E+1 2.000000E-1 -2.000000E+1" +Done diff --git a/ext/standard/tests/strings/vsprintf_variation4.phpt b/ext/standard/tests/strings/vsprintf_variation4.phpt index f9afe74a3c..37c9c606e9 100644 --- a/ext/standard/tests/strings/vsprintf_variation4.phpt +++ b/ext/standard/tests/strings/vsprintf_variation4.phpt @@ -1,5 +1,9 @@ --TEST-- Test vsprintf() function : usage variations - int formats with non-integer values +--SKIPIF-- + --FILE-- +--FILE-- +"12twelve"), + array("3"), array("4"), array("1"), array("2") ), + + // array of boolean data + array( true, TRUE, false, + TRUE, 0, FALSE, 1, + true, false, TRUE, FALSE, + 0, 1, 1, 0, + 1, TRUE, 0, FALSE), + +); + +// looping to test vsprintf() with different int formats from the above $format array +// and with non-int values from the above $args_array array +$counter = 1; +foreach($args_array as $args) { + echo "\n-- Iteration $counter --\n"; + var_dump( vsprintf($formats, $args) ); + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing vsprintf() : int formats and non-integer values *** + +-- Iteration 1 -- +string(112) "2 +0 10 + 123456 d -1234 1234 + 20000000000 200000 4000 22000000 + 12345 12 -12 -123456 + 10 123456 2 0" + +-- Iteration 2 -- +string(92) "0 +0 0 + 123 d -123 123 + 0 0 123456 0000 + 1234 0 $0 _0 + 0 123 0 0" + +-- Iteration 3 -- +string(81) "1 +1 1 + 1 d 1 1 + 1 1 1 0001 + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 4 -- +string(81) "1 +1 0 + 1 d 0 1 + 1 0 1 0000 + #0 1 $1 _0 + 0 1 1 1" +Done +--UEXPECTF-- +*** Testing vsprintf() : int formats and non-integer values *** + +-- Iteration 1 -- +unicode(112) "2 +0 10 + 123456 d -1234 1234 + 20000000000 200000 4000 22000000 + 12345 12 -12 -123456 + 10 123456 2 0" + +-- Iteration 2 -- +unicode(92) "0 +0 0 + 123 d -123 123 + 0 0 123456 0000 + 1234 0 $0 _0 + 0 123 0 0" + +-- Iteration 3 -- +unicode(81) "1 +1 1 + 1 d 1 1 + 1 1 1 0001 + #1 1 $1 _1 + 1 1 1 1" + +-- Iteration 4 -- +unicode(81) "1 +1 0 + 1 d 0 1 + 1 0 1 0000 + #0 1 $1 _0 + 0 1 1 1" +Done