From 5361f1838b2b3091e813f9c06c428c003caaa512 Mon Sep 17 00:00:00 2001 From: Brian Shire Date: Mon, 4 Jun 2007 01:23:22 +0000 Subject: [PATCH] MFB: fix sprintf/printf %u tests so they work correctly on both 32-bit and 64-bit. (broken in previous fix) --- ext/standard/tests/array/bug35014_64bit.phpt | 4 +- ext/standard/tests/strings/bug23894.phpt | 20 +-- ext/standard/tests/strings/bug26973.phpt | 20 +-- ext/standard/tests/strings/printf_64bit.phpt | 6 +- ext/standard/tests/strings/sprintf_f_2.phpt | 136 +++++++++---------- 5 files changed, 93 insertions(+), 93 deletions(-) diff --git a/ext/standard/tests/array/bug35014_64bit.phpt b/ext/standard/tests/array/bug35014_64bit.phpt index aa2d7242a1..0f151c9753 100644 --- a/ext/standard/tests/array/bug35014_64bit.phpt +++ b/ext/standard/tests/array/bug35014_64bit.phpt @@ -42,5 +42,5 @@ int(3) int(9) float(1) int(9999999800000001) -float(2.8404260053903E+20) -int(8589934590) +float(1.219953680145E+30) +float(3.6893488147419E+19) diff --git a/ext/standard/tests/strings/bug23894.phpt b/ext/standard/tests/strings/bug23894.phpt index 0724f945f5..070304b589 100644 --- a/ext/standard/tests/strings/bug23894.phpt +++ b/ext/standard/tests/strings/bug23894.phpt @@ -8,13 +8,13 @@ var_dump($test, bin2hex((binary)$test)); $test = sprintf("% 13u", $a); var_dump($test, bin2hex((binary)$test)); ?> ---EXPECT-- -string(4) "-012" -string(8) "2d303132" -string(13) " 4294967284" -string(26) "20202034323934393637323834" ---UEXPECT-- -unicode(4) "-012" -unicode(8) "2d303132" -unicode(13) " 4294967284" -unicode(26) "20202034323934393637323834" +--EXPECTREGEX-- +string\(4\) \"-012\" +string\(8\) \"2d303132\" +(string\(13\) \" 4294967284\"|string\(20\) \"18446744073709551604\") +(string\(26\) \"20202034323934393637323834\"|string\(40\) \"3138343436373434303733373039353531363034\") +--UEXPECTREGEX-- +unicode\(4\) \"-012\" +unicode\(8\) \"2d303132\" +(unicode\(13\) \" 4294967284\"|unicode\(20\) \"18446744073709551604\") +(unicode\(26\) \"20202034323934393637323834\"|unicode\(40\) \"3138343436373434303733373039353531363034\") diff --git a/ext/standard/tests/strings/bug26973.phpt b/ext/standard/tests/strings/bug26973.phpt index 4a586ecaa2..9de3be4929 100644 --- a/ext/standard/tests/strings/bug26973.phpt +++ b/ext/standard/tests/strings/bug26973.phpt @@ -18,17 +18,17 @@ printf("%05u\n", 200); printf("%05u\n", -200); ?> ---EXPECT-- -+0200 --0200 -+200.000000 --200.000000 +--EXPECTREGEX-- +\+0200 +\-0200 +\+200\.000000 +\-200\.000000 00200 -4294967096 +(4294967096|18446744073709551416) --- 00200 --0200 -200.000000 --200.000000 +\-0200 +200\.000000 +\-200\.000000 00200 -4294967096 +(4294967096|18446744073709551416) diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 9d78d0c7a4..10ea360c04 100755 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -531,11 +531,11 @@ Array 0 1 -4294967295 +18446744073709551615 2 -4294967294 +18446744073709551614 23333333 -4271633963 +18446744073686218283 1234 *** Output for octal type *** diff --git a/ext/standard/tests/strings/sprintf_f_2.phpt b/ext/standard/tests/strings/sprintf_f_2.phpt index 1c391f3122..f6681939fc 100755 --- a/ext/standard/tests/strings/sprintf_f_2.phpt +++ b/ext/standard/tests/strings/sprintf_f_2.phpt @@ -80,71 +80,71 @@ $number = 362525200; var_dump(sprintf("%.3e", $number)); // outputs 3.63e+8 ?> ---EXPECT-- -string(7) "100.426" -string(6) "100.43" -string(3) "100" -string(3) "100" -string(3) "144" -string(3) "144" -string(34) "There are 100 monkeys in the world" -string(28) "The 100.1 contains 0 monkeys" -string(30) "The world contains 100 monkeys" -string(76) "The world contains 100 monkeys. - That's a nice world full of 100 monkeys." -string(33) "%b = '10100111101010011010101101'" -string(8) "%c = 'A'" -string(15) "%d = '43951789'" -string(18) "%e = '4.395179e+7'" -string(15) "%u = '43951789'" -string(17) "%u = '4251015507'" -string(22) "%f = '43951789.000000'" -string(16) "%o = '247523255'" -string(15) "%s = '43951789'" -string(14) "%x = '29ea6ad'" -string(14) "%X = '29EA6AD'" -string(17) "%+d = '+43951789'" -string(17) "%+d = '-43951789'" -string(8) "[monkey]" -string(12) "[ monkey]" -string(12) "[monkey ]" -string(12) "[0000monkey]" -string(12) "[####monkey]" -string(12) "[many monke]" -string(10) "2006-12-18" -string(6) "123.10" -string(8) "3.625e+8" ---UEXPECT-- -unicode(7) "100.426" -unicode(6) "100.43" -unicode(3) "100" -unicode(3) "100" -unicode(3) "144" -unicode(3) "144" -unicode(34) "There are 100 monkeys in the world" -unicode(28) "The 100.1 contains 0 monkeys" -unicode(30) "The world contains 100 monkeys" -unicode(76) "The world contains 100 monkeys. - That's a nice world full of 100 monkeys." -unicode(33) "%b = '10100111101010011010101101'" -unicode(8) "%c = 'A'" -unicode(15) "%d = '43951789'" -unicode(18) "%e = '4.395179e+7'" -unicode(15) "%u = '43951789'" -unicode(17) "%u = '4251015507'" -unicode(22) "%f = '43951789.000000'" -unicode(16) "%o = '247523255'" -unicode(15) "%s = '43951789'" -unicode(14) "%x = '29ea6ad'" -unicode(14) "%X = '29EA6AD'" -unicode(17) "%+d = '+43951789'" -unicode(17) "%+d = '-43951789'" -unicode(8) "[monkey]" -unicode(12) "[ monkey]" -unicode(12) "[monkey ]" -unicode(12) "[0000monkey]" -unicode(12) "[####monkey]" -unicode(12) "[many monke]" -unicode(10) "2006-12-18" -unicode(6) "123.10" -unicode(8) "3.625e+8" +--EXPECTREGEX-- +string\(7\) \"100\.426\" +string\(6\) \"100\.43\" +string\(3\) \"100\" +string\(3\) \"100\" +string\(3\) \"144\" +string\(3\) \"144\" +string\(34\) \"There are 100 monkeys in the world\" +string\(28\) \"The 100\.1 contains 0 monkeys\" +string\(30\) \"The world contains 100 monkeys\" +string\(76\) \"The world contains 100 monkeys. + That's a nice world full of 100 monkeys\.\" +string\(33\) \"%b = '10100111101010011010101101'\" +string\(8\) \"%c = 'A'\" +string\(15\) \"%d = '43951789'\" +string\(18\) \"%e = '4\.395179e\+7'\" +string\(15\) \"%u = '43951789'\" +(string\(17\) \"%u = '4251015507'\"|string\(27\) \"%u = '18446744073665599827'\") +string\(22\) \"%f = '43951789\.000000'\" +string\(16\) \"%o = '247523255'\" +string\(15\) \"%s = '43951789'\" +string\(14\) \"%x = '29ea6ad'\" +string\(14\) \"%X = '29EA6AD'\" +string\(17\) \"%\+d = '\+43951789'\" +string\(17\) \"%\+d = '-43951789'\" +string\(8\) \"\[monkey\]\" +string\(12\) \"\[ monkey\]\" +string\(12\) \"\[monkey \]\" +string\(12\) \"\[0000monkey\]\" +string\(12\) \"\[####monkey\]\" +string\(12\) \"\[many monke\]\" +string\(10\) \"2006-12-18\" +string\(6\) \"123\.10\" +string\(8\) \"3\.625e\+8\" +--UEXPECTREGEX-- +unicode\(7\) \"100\.426\" +unicode\(6\) \"100\.43\" +unicode\(3\) \"100\" +unicode\(3\) \"100\" +unicode\(3\) \"144\" +unicode\(3\) \"144\" +unicode\(34\) \"There are 100 monkeys in the world\" +unicode\(28\) \"The 100\.1 contains 0 monkeys\" +unicode\(30\) \"The world contains 100 monkeys\" +unicode\(76\) \"The world contains 100 monkeys. + That's a nice world full of 100 monkeys\.\" +unicode\(33\) \"%b = '10100111101010011010101101'\" +unicode\(8\) \"%c = 'A'\" +unicode\(15\) \"%d = '43951789'\" +unicode\(18\) \"%e = '4\.395179e\+7'\" +unicode\(15\) \"%u = '43951789'\" +(unicode\(17\) \"%u = '4251015507'\"|unicode\(27\) \"%u = '18446744073665599827'\") +unicode\(22\) \"%f = '43951789\.000000'\" +unicode\(16\) \"%o = '247523255'\" +unicode\(15\) \"%s = '43951789'\" +unicode\(14\) \"%x = '29ea6ad'\" +unicode\(14\) \"%X = '29EA6AD'\" +unicode\(17\) \"%\+d = '\+43951789'\" +unicode\(17\) \"%\+d = '-43951789'\" +unicode\(8\) \"\[monkey\]\" +unicode\(12\) \"\[ monkey\]\" +unicode\(12\) \"\[monkey \]\" +unicode\(12\) \"\[0000monkey\]\" +unicode\(12\) \"\[####monkey\]\" +unicode\(12\) \"\[many monke\]\" +unicode\(10\) \"2006-12-18\" +unicode\(6\) \"123\.10\" +unicode\(8\) \"3\.625e\+8\" -- 2.40.0