cvs: ZendEngine2 /tests int_overflow_32bit.phpt int_underflow_32bit.phpt
| From: | Antony Dovgal | Date: | Thu, 28 Sep 2006 11:45:55 +0000 |
| Subject: | cvs: ZendEngine2 /tests int_overflow_32bit.phpt int_underflow_32bit.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5278@lists.php.net to get a copy of this message | ||
tony2001 Thu Sep 28 11:45:55 2006 UTC
Modified files:
/ZendEngine2/tests int_overflow_32bit.phpt int_underflow_32bit.phpt
Log:
add new tests
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_32bit.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/int_overflow_32bit.phpt
diff -u /dev/null ZendEngine2/tests/int_overflow_32bit.phpt:1.2
--- /dev/null Thu Sep 28 11:45:55 2006
+++ ZendEngine2/tests/int_overflow_32bit.phpt Thu Sep 28 11:45:55 2006
@@ -0,0 +1,29 @@
+--TEST--
+testing integer overflow (32bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ 2147483648,
+ 2147483649,
+ 2147483658,
+ 2147483748,
+ 2147484648,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-2147483648)
+int(-2147483647)
+int(-2147483638)
+int(-2147483548)
+int(-2147482648)
+Done
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_underflow_32bit.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/int_underflow_32bit.phpt
diff -u /dev/null ZendEngine2/tests/int_underflow_32bit.phpt:1.2
--- /dev/null Thu Sep 28 11:45:55 2006
+++ ZendEngine2/tests/int_underflow_32bit.phpt Thu Sep 28 11:45:55 2006
@@ -0,0 +1,29 @@
+--TEST--
+testing integer underflow (32bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ -2147483648,
+ -2147483649,
+ -2147483658,
+ -2147483748,
+ -2147484648,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+Done