cvs: php4 /ext/standard/tests/math 001.phpt abs.phpt pow.phpt round.phpt

From: Date: Mon, 22 Oct 2001 09:44:27 +0000
Subject: cvs: php4 /ext/standard/tests/math 001.phpt abs.phpt pow.phpt round.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7911@lists.php.net to get a copy of this message
jeroen Mon Oct 22 05:44:27 2001 EDT Added files: /php4/ext/standard/tests/math abs.phpt round.phpt Removed files: /php4/ext/standard/tests/math 001.phpt Modified files: /php4/ext/standard/tests/math pow.phpt Log: Make math tests pass, round & co don't work this way, and there was an error in expected output Index: php4/ext/standard/tests/math/pow.phpt diff -u php4/ext/standard/tests/math/pow.phpt:1.4 php4/ext/standard/tests/math/pow.phpt:1.5 --- php4/ext/standard/tests/math/pow.phpt:1.4 Fri Oct 5 19:37:08 2001 +++ php4/ext/standard/tests/math/pow.phpt Mon Oct 22 05:44:27 2001 @@ -3,7 +3,8 @@ --POST-- --GET-- --FILE-- -<?php +<?php // $Id: pow.phpt,v 1.5 2001/10/22 09:44:27 jeroen Exp $ + define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), Index: php4/ext/standard/tests/math/abs.phpt +++ php4/ext/standard/tests/math/abs.phpt --TEST-- Simple math tests --POST-- --GET-- --FILE-- <?php // $Id: abs.phpt,v 1.1 2001/10/22 09:44:27 jeroen Exp $ define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS 1 === abs(-1) 1.5 === abs(-1.5) 1 === abs("-1") 1.5 === abs("-1.5") -LONG_MIN+1 === abs(LONG_MIN-1) -LONG_MIN === abs(LONG_MIN) -(LONG_MIN+1) === abs(LONG_MIN+1) TESTS; include('../../../../tests/quicktester.inc'); --EXPECT-- 1,1,0,0 OK Index: php4/ext/standard/tests/math/round.phpt +++ php4/ext/standard/tests/math/round.phpt --TEST-- Simple math tests --POST-- --GET-- --FILE-- <?php // $Id: round.phpt,v 1.1 2001/10/22 09:44:27 jeroen Exp $ define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS -1 ~== ceil(-1.5) 2 ~== ceil( 1.5) -2 ~== floor(-1.5) 1 ~== floor(1.5) LONG_MIN ~== ceil(LONG_MIN - 0.5) LONG_MIN+1 ~== ceil(LONG_MIN + 0.5) LONG_MIN-1 ~== round(LONG_MIN - 0.6) LONG_MIN ~== round(LONG_MIN - 0.4) LONG_MIN ~== round(LONG_MIN + 0.4) LONG_MIN+1 ~== round(LONG_MIN + 0.6) LONG_MIN-1 ~== floor(LONG_MIN - 0.5) LONG_MIN ~== floor(LONG_MIN + 0.5) LONG_MAX ~== ceil(LONG_MAX - 0.5) LONG_MAX+1 ~== ceil(LONG_MAX + 0.5) LONG_MAX-1 ~== round(LONG_MAX - 0.6) LONG_MAX ~== round(LONG_MAX - 0.4) LONG_MAX ~== round(LONG_MAX + 0.4) LONG_MAX+1 ~== round(LONG_MAX + 0.6) LONG_MAX-1 ~== floor(LONG_MAX - 0.5) LONG_MAX ~== floor(LONG_MAX + 0.5) TESTS; include('../../../../tests/quicktester.inc'); --EXPECT-- 1,1,0,0 OK

« previous php.cvs (#7911) next »