tony2001                Sat Feb  2 23:44:40 2008 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/standard/tests/math    bindec_basic_64bit.phpt 

  Modified files:              
    /php-src/ext/standard/tests/math    bindec_basic.phpt 
  Log:
  fix test, add 64bit version
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/bindec_basic.phpt?r1=1.1.4.2&r2=1.1.4.3&diff_format=u
Index: php-src/ext/standard/tests/math/bindec_basic.phpt
diff -u php-src/ext/standard/tests/math/bindec_basic.phpt:1.1.4.2 
php-src/ext/standard/tests/math/bindec_basic.phpt:1.1.4.3
--- php-src/ext/standard/tests/math/bindec_basic.phpt:1.1.4.2   Fri Feb  1 
17:27:43 2008
+++ php-src/ext/standard/tests/math/bindec_basic.phpt   Sat Feb  2 23:44:39 2008
@@ -1,5 +1,9 @@
 --TEST--
 Test bindec() - basic function test bindec()
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
 --FILE--
 <?php
 $values = array(111000111,
@@ -46,4 +50,4 @@
 int(0)
 int(1)
 int(0)
-int(0)
\ No newline at end of file
+int(0)

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/bindec_basic_64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/math/bindec_basic_64bit.phpt
+++ php-src/ext/standard/tests/math/bindec_basic_64bit.phpt
--TEST--
Test bindec() - basic function test bindec()
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
$values = array(111000111,
                                011100000,
                                1111111111111111111111111111111,
                                10000000000000000000000000000000,
                                100002001,
                                '111000111',
                                '011100000',
                                '1111111111111111111111111111111',
                                '10000000000000000000000000000000',
                                '100002001',
                                'abcdefg',
                                311015,
                                31101.3,
                                31.1013e5,
                                0x111ABC,
                                011237,                         
                                true,
                                false,
                                null);  

for ($i = 0; $i < count($values); $i++) {
        $res = bindec($values[$i]);
        var_dump($res);
}
?>
--EXPECTF--
int(455)
int(0)
int(32766)
int(5)
int(129)
int(455)
int(224)
int(2147483647)
int(2147483648)
int(129)
int(0)
int(13)
int(13)
int(26)
int(6)
int(0)
int(1)
int(0)
int(0)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to