com php-src: Implement FR #65462: Please add tests for gregorian and jewish overflow fixes: ext/calendar/tests/jdtogregorian_overflow.p hpt
ext/calendar/tests/jdtojewish_overflow.phpt

From: Date: Thu, 28 Jul 2016 17:59:14 +0000
Subject: com php-src: Implement FR #65462: Please add tests for gregorian and jewish overflow fixes: ext/calendar/tests/jdtogregorian_overflow.p hpt
ext/calendar/tests/jdtojewish_overflow.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93465@lists.php.net to get a copy of this message
Commit: 5c458c9b025f6f654497f5e3d2ee53b4d1561454 Author: Christoph M. Becker <cmb@php.net> Thu, 28 Jul 2016 19:59:14 +0200 Parents: 7ab39e2faef499c8a1857205fa332d2e38a0a584 Branches: PHP-5.6 PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5c458c9b025f6f654497f5e3d2ee53b4d1561454 Log: Implement FR #65462: Please add tests for gregorian and jewish overflow fixes Bugs: https://bugs.php.net/65462 Changed paths: A ext/calendar/tests/jdtogregorian_overflow.phpt A ext/calendar/tests/jdtojewish_overflow.phpt Diff: diff --git a/ext/calendar/tests/jdtogregorian_overflow..phpt b/ext/calendar/tests/jdtogregorian_overflow.phpt new file mode 100644 index 0000000..28f5298 --- /dev/null +++ b/ext/calendar/tests/jdtogregorian_overflow.phpt @@ -0,0 +1,28 @@ +--TEST-- +jdtogregorian(): test overflow +--CREDITS-- +neweracracker@gmail.com +--SKIPIF-- +<?php +if (!extension_loaded('calendar')) die('skip ext/calendar required'); +if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only'); +?> +--FILE-- +<?php +for ($i=536838860; $i<536838870; $i++) { + echo $i, ':', jdtogregorian($i), PHP_EOL; +} +echo 'DONE', PHP_EOL; +?> +--EXPECT-- +536838860:10/11/1465102 +536838861:10/12/1465102 +536838862:10/13/1465102 +536838863:10/14/1465102 +536838864:10/15/1465102 +536838865:10/16/1465102 +536838866:10/17/1465102 +536838867:0/0/0 +536838868:0/0/0 +536838869:0/0/0 +DONE diff --git a/ext/calendar/tests/jdtojewish_overflow.phpt b/ext/calendar/tests/jdtojewish_overflow.phpt new file mode 100644 index 0000000..1d1c2ee --- /dev/null +++ b/ext/calendar/tests/jdtojewish_overflow.phpt @@ -0,0 +1,27 @@ +--TEST-- +jdtojewish(): test overflow +--CREDITS-- +neweracracker@gmail.com +--SKIPIF-- +<?php +if (!extension_loaded('calendar')) die('skip ext/calendar required'); +?> +--FILE-- +<?php +for ($i=324542840; $i<324542850; $i++) { + echo $i, ':', jdtojewish($i), PHP_EOL; +} +echo 'DONE', PHP_EOL; +?> +--EXPECT-- +324542840:12/7/887605 +324542841:12/8/887605 +324542842:12/9/887605 +324542843:12/10/887605 +324542844:12/11/887605 +324542845:12/12/887605 +324542846:12/13/887605 +324542847:0/0/0 +324542848:0/0/0 +324542849:0/0/0 +DONE

« previous php.cvs (#93465) next »