cvs: php4(PHP_4_2_0) /ext/standard/tests/array count_recursive.phpt /ext/standard/tests/math pow.phpt
| From: | Sander Roobol | Date: | Thu, 21 Mar 2002 14:23:24 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /ext/standard/tests/array count_recursive.phpt /ext/standard/tests/math pow.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10523@lists.php.net to get a copy of this message | ||
sander Thu Mar 21 09:23:24 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/standard/tests/array count_recursive.phpt
/php4/ext/standard/tests/math pow.phpt
Log:
MFH: more tests for pow() and count()
Index: php4/ext/standard/tests/array/count_recursive.phpt
diff -u php4/ext/standard/tests/array/count_recursive.phpt:1.2
php4/ext/standard/tests/array/count_recursive.phpt:1.2.2.1
--- php4/ext/standard/tests/array/count_recursive.phpt:1.2 Wed Jan 9 11:03:36 2002
+++ php4/ext/standard/tests/array/count_recursive.phpt Thu Mar 21 09:23:24 2002
@@ -26,6 +26,12 @@
print "Testing various types with no second argument.\n";
print "COUNT_NORMAL: should be 1, is ".count("string")."\n";
print "COUNT_NORMAL: should be 2, is ".count(array("a",
array("b")))."\n";
+
+$arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL),
+ array(array(array(array(array(NULL))))));
+print "Testing really cool arrays ;)\n";
+print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n";
+print "COUNT_RECURSIVE: should be 13, is ".count($arr, COUNT_RECURSIVE)."\n";
?>
--EXPECT--
Testing NULL...
@@ -42,4 +48,7 @@
COUNT_RECURSIVE: should be 1, is 1
Testing various types with no second argument.
COUNT_NORMAL: should be 1, is 1
-COUNT_NORMAL: should be 2, is 2
+COUNT_NORMAL: should be 2, is 2
+Testing really cool arrays ;)
+COUNT_NORMAL: should be 3, is 3
+COUNT_RECURSIVE: should be 13, is 13
Index: php4/ext/standard/tests/math/pow.phpt
diff -u php4/ext/standard/tests/math/pow.phpt:1.11 php4/ext/standard/tests/math/pow.phpt:1.11.2.1
--- php4/ext/standard/tests/math/pow.phpt:1.11 Tue Mar 5 04:00:56 2002
+++ php4/ext/standard/tests/math/pow.phpt Thu Mar 21 09:23:24 2002
@@ -3,7 +3,7 @@
--POST--
--GET--
--FILE--
-<?php // $Id: pow.phpt,v 1.11 2002/03/05 09:00:56 derick Exp $
+<?php // $Id: pow.phpt,v 1.11.2.1 2002/03/21 14:23:24 sander Exp $
define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF);
define('LONG_MIN', -LONG_MAX - 1);
@@ -118,6 +118,12 @@
1.0 === pow( 2.0, 0)
2.0 === pow( 2.0, 1)
4.0 === pow( 2.0, 2)
+ 2.0 === pow( 4, 0.5)
+ 2.0 === pow( 4.0, 0.5)
+ 3.0 === pow( 27, 1/3)
+ 3.0 === pow(27.0, 1/3)
+ 0.5 === pow( 4, -0.5)
+ 0.5 === pow( 4.0, -0.5)
LONG_MAX-1 === pow(LONG_MAX-1,1)
LONG_MIN+1 === pow(LONG_MIN+1,1)
(LONG_MAX-1)*(LONG_MAX-1) ~== pow(LONG_MAX-1,2)