From abb12f5d7b82c40bc11eb374130e1607fad76d31 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 17 Jan 2013 17:41:58 +0100 Subject: [PATCH] Added test cases for ZEND_SIGNED_MULTIPLY_LONG() Before making changes to the implementation of ZEND_SIGNED_MULTIPLY_LONG(), add some test cases to make sure the various implementations remain equivalent. --- Zend/tests/zend_signed_multiply-32bit.phpt | 14 ++++++++++++++ Zend/tests/zend_signed_multiply-64bit.phpt | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Zend/tests/zend_signed_multiply-32bit.phpt create mode 100644 Zend/tests/zend_signed_multiply-64bit.phpt diff --git a/Zend/tests/zend_signed_multiply-32bit.phpt b/Zend/tests/zend_signed_multiply-32bit.phpt new file mode 100644 index 0000000000..0a42bd42d8 --- /dev/null +++ b/Zend/tests/zend_signed_multiply-32bit.phpt @@ -0,0 +1,14 @@ +--TEST-- +Zend signed multiply 32-bit +--SKIPIF-- + 0) print "skip Running on 64-bit target"; ?> +--FILE-- + +--EXPECTF-- +int(-2147450880) +int(2147483646) +float(-2147516415) diff --git a/Zend/tests/zend_signed_multiply-64bit.phpt b/Zend/tests/zend_signed_multiply-64bit.phpt new file mode 100644 index 0000000000..86e5292ff6 --- /dev/null +++ b/Zend/tests/zend_signed_multiply-64bit.phpt @@ -0,0 +1,14 @@ +--TEST-- +Zend signed multiply 64-bit +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +int(-9223372034707292160) +int(9223372036854775806) +float(-9.2233720390023E+18) -- 2.50.1