| Antony Dovgal 2006-09-28, 7:56 am |
| tony2001 Thu Sep 28 12:08:44 2006 UTC
Modified files:
/ZendEngine2/tests int_overflow_64bit.phpt int_underflow_64bit.phpt
Log:
new tests
http://cvs.php.net/viewvc.cgi/ZendE...2&diff_format=u
Index: ZendEngine2/tests/int_overflow_64bit.phpt
diff -u /dev/null ZendEngine2/tests/int_overflow_64bit.phpt:1.2
--- /dev/null Thu Sep 28 12:08:44 2006
+++ ZendEngine2/tests/int_overflow_64bit.phpt Thu Sep 28 12:08:44 2006
@@ -0,0 +1,29 @@
+--TEST--
+testing integer overflow (64bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ 9223372036854775808,
+ 9223372036854775809,
+ 9223372036854775818,
+ 9223372036854775908,
+ 9223372036854776808,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+Done
http://cvs.php.net/viewvc.cgi/ZendE...2&diff_format=u
Index: ZendEngine2/tests/int_underflow_64bit.phpt
diff -u /dev/null ZendEngine2/tests/int_underflow_64bit.phpt:1.2
--- /dev/null Thu Sep 28 12:08:44 2006
+++ ZendEngine2/tests/int_underflow_64bit.phpt Thu Sep 28 12:08:44 2006
@@ -0,0 +1,29 @@
+--TEST--
+testing integer underflow (64bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ -9223372036854775808,
+ -9223372036854775809,
+ -9223372036854775818,
+ -9223372036854775908,
+ -9223372036854776808,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+Done
|