diff options
author | Ferenc Kovacs <tyrael@php.net> | 2011-09-27 00:53:41 +0000 |
---|---|---|
committer | Ferenc Kovacs <tyrael@php.net> | 2011-09-27 00:53:41 +0000 |
commit | 3945c4f9a6135b3570411d85d7cf67559c8bd952 (patch) | |
tree | 0de38ac52f25079b2ef0b40cd07027c70eb2ed96 /ext/calendar | |
parent | 60093a0ca5dee88c6064148c42c03364b2969628 (diff) | |
download | php-git-3945c4f9a6135b3570411d85d7cf67559c8bd952.tar.gz |
split the ext/calendar/tests/bug53574.phpt into two test, as we expect different result on 32 and 64 bit
Diffstat (limited to 'ext/calendar')
-rw-r--r-- | ext/calendar/tests/bug53574_1.phpt | 36 | ||||
-rw-r--r-- | ext/calendar/tests/bug53574_2.phpt (renamed from ext/calendar/tests/bug53574.phpt) | 13 |
2 files changed, 43 insertions, 6 deletions
diff --git a/ext/calendar/tests/bug53574_1.phpt b/ext/calendar/tests/bug53574_1.phpt new file mode 100644 index 0000000000..51f9b4266f --- /dev/null +++ b/ext/calendar/tests/bug53574_1.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #53574 (Integer overflow in SdnToJulian; leads to segfault) +--SKIPIF-- +<?php +include 'skipif.inc'; +if (PHP_INT_SIZE != 4) { + die("skip this test is for 32bit platform only"); +} +?> +--FILE-- +<?php +$x = 882858043; + +var_dump(cal_from_jd($x, CAL_JULIAN)); +--EXPECT-- +array(9) { + ["date"]=> + string(5) "0/0/0" + ["month"]=> + int(0) + ["day"]=> + int(0) + ["year"]=> + int(0) + ["dow"]=> + int(5) + ["abbrevdayname"]=> + string(3) "Fri" + ["dayname"]=> + string(6) "Friday" + ["abbrevmonth"]=> + string(0) "" + ["monthname"]=> + string(0) "" +} + diff --git a/ext/calendar/tests/bug53574.phpt b/ext/calendar/tests/bug53574_2.phpt index e426991354..45e15cb398 100644 --- a/ext/calendar/tests/bug53574.phpt +++ b/ext/calendar/tests/bug53574_2.phpt @@ -1,14 +1,15 @@ --TEST-- Bug #53574 (Integer overflow in SdnToJulian; leads to segfault) --SKIPIF-- -<?php include 'skipif.inc'; ?> +<?php +include 'skipif.inc'; +if (PHP_INT_SIZE == 4) { + die("skip this test is for 64bit platform only"); +} +?> --FILE-- <?php -if (PHP_INT_MAX == 0x7FFFFFFF) { - $x = 882858043; -} else { - $x = 3315881921229094912; -} +$x = 3315881921229094912; var_dump(cal_from_jd($x, CAL_JULIAN)); --EXPECT-- |