derick Mon Feb 25 22:32:26 2008 UTC
Added files:
/php-src/ext/wddx/tests 001-64bit.phpt
/php-src/ext/date/tests bug41523-64bit.phpt mktime-3-64bit.phpt
strtotime-mysql-64bit.phpt
strtotime3-64bit.phpt
Modified files:
/php-src/ext/wddx/tests 001.phpt
/php-src/ext/date php_date.c
/php-src/ext/date/tests bug41523.phpt mktime-3.phpt
strtotime-mysql.phpt strtotime3.phpt
Log:
- Fixed tests on 64bit platform.
http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/tests/001.phpt?r1=1.9&r2=1.10&diff_format=u
Index: php-src/ext/wddx/tests/001.phpt
diff -u php-src/ext/wddx/tests/001.phpt:1.9 php-src/ext/wddx/tests/001.phpt:1.10
--- php-src/ext/wddx/tests/001.phpt:1.9 Fri May 18 11:29:40 2007
+++ php-src/ext/wddx/tests/001.phpt Mon Feb 25 22:32:25 2008
@@ -1,7 +1,8 @@
--TEST--
-wddx unserialization test
+wddx unserialization test (32-bit)
--SKIPIF--
<?php if (!extension_loaded("wddx")) print "skip"; ?>
+<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK" ?>
--INI--
precision=14
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.166&r2=1.167&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.166 php-src/ext/date/php_date.c:1.167
--- php-src/ext/date/php_date.c:1.166 Sat Feb 23 17:03:53 2008
+++ php-src/ext/date/php_date.c Mon Feb 25 22:32:26 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.166 2008/02/23 17:03:53 helly Exp $ */
+/* $Id: php_date.c,v 1.167 2008/02/25 22:32:26 derick Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1193,7 +1193,7 @@
ret = php_idate(format[0], ts, 0);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date
format token.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date
format token");
RETURN_FALSE;
}
RETURN_LONG(ret);
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug41523.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/date/tests/bug41523.phpt
diff -u php-src/ext/date/tests/bug41523.phpt:1.2
php-src/ext/date/tests/bug41523.phpt:1.3
--- php-src/ext/date/tests/bug41523.phpt:1.2 Fri Jul 13 15:22:34 2007
+++ php-src/ext/date/tests/bug41523.phpt Mon Feb 25 22:32:26 2008
@@ -1,5 +1,7 @@
--TEST--
-Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30)
+Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (32 bit)
+--SKIPIF--
+<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set("UTC");
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/mktime-3.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/date/tests/mktime-3.phpt
diff -u php-src/ext/date/tests/mktime-3.phpt:1.4
php-src/ext/date/tests/mktime-3.phpt:1.5
--- php-src/ext/date/tests/mktime-3.phpt:1.4 Mon Dec 19 12:57:49 2005
+++ php-src/ext/date/tests/mktime-3.phpt Mon Feb 25 22:32:26 2008
@@ -1,5 +1,7 @@
--TEST--
-mktime() [3]
+mktime() [3] (32-bit)
+--SKIPIF--
+<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK" ?>
--INI--
error_reporting=2047
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime-mysql.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/date/tests/strtotime-mysql.phpt
diff -u php-src/ext/date/tests/strtotime-mysql.phpt:1.3
php-src/ext/date/tests/strtotime-mysql.phpt:1.4
--- php-src/ext/date/tests/strtotime-mysql.phpt:1.3 Sat Jun 17 12:48:20 2006
+++ php-src/ext/date/tests/strtotime-mysql.phpt Mon Feb 25 22:32:26 2008
@@ -1,5 +1,7 @@
--TEST--
-strtotime() and mysql timestamps
+strtotime() and mysql timestamps (32 bit)
+--SKIPIF--
+<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set('UTC');
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime3.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/date/tests/strtotime3.phpt
diff -u php-src/ext/date/tests/strtotime3.phpt:1.4
php-src/ext/date/tests/strtotime3.phpt:1.5
--- php-src/ext/date/tests/strtotime3.phpt:1.4 Sat Jun 17 12:48:20 2006
+++ php-src/ext/date/tests/strtotime3.phpt Mon Feb 25 22:32:26 2008
@@ -1,5 +1,7 @@
--TEST--
-strtotime() function
+strtotime() function (32 bit)
+--SKIPIF--
+<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set('Europe/Lisbon');
http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/tests/001-64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/wddx/tests/001-64bit.phpt
+++ php-src/ext/wddx/tests/001-64bit.phpt
--TEST--
wddx deserialization test (64-bit)
--SKIPIF--
<?php if (!extension_loaded("wddx")) print "skip"; ?>
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK" ?>
--INI--
precision=14
--FILE--
<?php
$path = dirname(__FILE__);
var_dump(wddx_deserialize(file_get_contents("{$path}/wddx.xml")));
?>
--EXPECT--
array(11) {
["aNull"]=>
NULL
["aString"]=>
string(8) "a string"
["aNumber"]=>
float(-12.456)
["aDateTime"]=>
int(897625932)
["aDateTime2"]=>
int(329632332)
["aDateTime3"]=>
int(2223088332)
["aBoolean"]=>
bool(true)
["anArray"]=>
array(2) {
[0]=>
int(10)
[1]=>
string(14) "second element"
}
["aBinary"]=>
string(11) "binary data"
["anObject"]=>
array(2) {
["s"]=>
string(8) "a string"
["n"]=>
float(-12.456)
}
["aRecordset"]=>
array(2) {
["NAME"]=>
array(2) {
[0]=>
string(8) "John Doe"
[1]=>
string(8) "Jane Doe"
}
["AGE"]=>
array(2) {
[0]=>
int(34)
[1]=>
int(31)
}
}
}
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug41523-64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/bug41523-64bit.phpt
+++ php-src/ext/date/tests/bug41523-64bit.phpt
--TEST--
Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (64 bit)
--SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set("UTC");
var_dump( date_parse('0000-00-00 00:00:00') );
var_dump( strtotime('0000-00-00 00:00:00') );
var_dump( $dt = new DateTime('0000-00-00 00:00:00') );
echo $dt->format( DateTime::ISO8601 ), "\n";
?>
--EXPECT--
array(12) {
["year"]=>
int(0)
["month"]=>
int(0)
["day"]=>
int(0)
["hour"]=>
int(0)
["minute"]=>
int(0)
["second"]=>
int(0)
["fraction"]=>
float(0)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(0)
["errors"]=>
array(0) {
}
["is_localtime"]=>
bool(false)
}
int(-62169984000)
object(DateTime)#1 (0) {
}
-0001-11-30T00:00:00+0000
--UEXPECT--
array(12) {
[u"year"]=>
int(0)
[u"month"]=>
int(0)
[u"day"]=>
int(0)
[u"hour"]=>
int(0)
[u"minute"]=>
int(0)
[u"second"]=>
int(0)
[u"fraction"]=>
float(0)
[u"warning_count"]=>
int(0)
[u"warnings"]=>
array(0) {
}
[u"error_count"]=>
int(0)
[u"errors"]=>
array(0) {
}
[u"is_localtime"]=>
bool(false)
}
int(-62169984000)
object(DateTime)#1 (0) {
}
-0001-11-30T00:00:00+0000
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/mktime-3-64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/mktime-3-64bit.phpt
+++ php-src/ext/date/tests/mktime-3-64bit.phpt
--TEST--
mktime() [3] (64-bit)
--SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK" ?>
--INI--
error_reporting=2047
--FILE--
<?php
$tzs = array("America/Toronto", "Europe/Oslo");
$years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 2001);
foreach ($tzs as $tz) {
echo $tz, "\n";
date_default_timezone_set($tz);
foreach ($years as $year) {
printf("Y: %4d - ", $year);
$ret = mktime(1, 1, 1, 1, 1, $year);
if ($ret == FALSE) {
echo "out of range\n";
} else {
echo date("F ".DATE_ISO8601, $ret), "\n";
}
}
echo "\n";
}
?>
--EXPECT--
America/Toronto
Y: 0 - January 2000-01-01T01:01:01-0500
Y: 69 - January 2069-01-01T01:01:01-0500
Y: 70 - January 1970-01-01T01:01:01-0500
Y: 71 - January 1971-01-01T01:01:01-0500
Y: 99 - January 1999-01-01T01:01:01-0500
Y: 100 - January 2000-01-01T01:01:01-0500
Y: 105 - January 2005-01-01T01:01:01-0500
Y: 1900 - January 1900-01-01T01:01:01-0500
Y: 1901 - January 1901-01-01T01:01:01-0500
Y: 1902 - January 1902-01-01T01:01:01-0500
Y: 1999 - January 1999-01-01T01:01:01-0500
Y: 2000 - January 2000-01-01T01:01:01-0500
Y: 2001 - January 2001-01-01T01:01:01-0500
Europe/Oslo
Y: 0 - January 2000-01-01T01:01:01+0100
Y: 69 - January 2069-01-01T01:01:01+0100
Y: 70 - January 1970-01-01T01:01:01+0100
Y: 71 - January 1971-01-01T01:01:01+0100
Y: 99 - January 1999-01-01T01:01:01+0100
Y: 100 - January 2000-01-01T01:01:01+0100
Y: 105 - January 2005-01-01T01:01:01+0100
Y: 1900 - January 1900-01-01T01:01:01+0100
Y: 1901 - January 1901-01-01T01:01:01+0100
Y: 1902 - January 1902-01-01T01:01:01+0100
Y: 1999 - January 1999-01-01T01:01:01+0100
Y: 2000 - January 2000-01-01T01:01:01+0100
Y: 2001 - January 2001-01-01T01:01:01+0100
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime-mysql-64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/strtotime-mysql-64bit.phpt
+++ php-src/ext/date/tests/strtotime-mysql-64bit.phpt
--TEST--
strtotime() and mysql timestamps (64 bit)
--SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set('UTC');
/* Format: YYYYMMDDHHMMSS */
$d[] = '19970523091528';
$d[] = '20001231185859';
$d[] = '20800410101010'; // overflow..
foreach($d as $date) {
$time = strtotime($date);
if (is_integer($time)) {
var_dump(date('r', $time));
} else {
var_dump($time);
}
}
?>
--EXPECT--
string(31) "Fri, 23 May 1997 09:15:28 +0000"
string(31) "Sun, 31 Dec 2000 18:58:59 +0000"
string(31) "Wed, 10 Apr 2080 10:10:10 +0000"
--UEXPECT--
unicode(31) "Fri, 23 May 1997 09:15:28 +0000"
unicode(31) "Sun, 31 Dec 2000 18:58:59 +0000"
unicode(31) "Wed, 10 Apr 2080 10:10:10 +0000"
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime3-64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/strtotime3-64bit.phpt
+++ php-src/ext/date/tests/strtotime3-64bit.phpt
--TEST--
strtotime() function (64 bit)
--SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
--FILE--
<?php
date_default_timezone_set('Europe/Lisbon');
$time = 1150494719; // 16/June/2006
$strs = array(
'',
" \t\r\n000",
'yesterday',
'22:49:12',
'22:49:12 bogusTZ',
'22.49.12.42GMT',
'22.49.12.42bogusTZ',
't0222',
't0222 t0222',
'022233',
'022233 bogusTZ',
'2-3-2004',
'2.3.2004',
'20060212T23:12:23UTC',
'20060212T23:12:23 bogusTZ',
'2006167', //pgydotd
'Jan-15-2006', //pgtextshort
'2006-Jan-15', //pgtextreverse
'10/Oct/2000:13:55:36 +0100', //clf
'10/Oct/2000:13:55:36 +00100', //clf
'2006',
'1986', // year
'JAN',
'January',
);
foreach ($strs as $str) {
$t = strtotime($str, $time);
if (is_integer($t)) {
var_dump(date(DATE_RFC2822, $t));
} else {
var_dump($t);
}
}
?>
--EXPECT--
bool(false)
bool(false)
string(31) "Thu, 15 Jun 2006 00:00:00 +0100"
string(31) "Fri, 16 Jun 2006 22:49:12 +0100"
bool(false)
string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
bool(false)
string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
string(31) "Mon, 16 Jun 0222 02:22:00 -0036"
string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
bool(false)
string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
string(31) "Sun, 12 Feb 2006 23:12:23 +0000"
bool(false)
string(31) "Fri, 16 Jun 2006 00:00:00 +0100"
string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
string(31) "Tue, 10 Oct 2000 13:55:36 +0100"
bool(false)
string(31) "Fri, 16 Jun 2006 20:06:00 +0100"
string(31) "Mon, 16 Jun 1986 22:51:59 +0100"
string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
--UEXPECT--
bool(false)
bool(false)
unicode(31) "Thu, 15 Jun 2006 00:00:00 +0100"
unicode(31) "Fri, 16 Jun 2006 22:49:12 +0100"
bool(false)
unicode(31) "Fri, 16 Jun 2006 23:49:12 +0100"
bool(false)
unicode(31) "Fri, 16 Jun 2006 02:22:00 +0100"
unicode(31) "Mon, 16 Jun 0222 02:22:00 -0036"
unicode(31) "Fri, 16 Jun 2006 02:22:33 +0100"
bool(false)
unicode(31) "Tue, 02 Mar 2004 00:00:00 +0000"
unicode(31) "Tue, 02 Mar 2004 00:00:00 +0000"
unicode(31) "Sun, 12 Feb 2006 23:12:23 +0000"
bool(false)
unicode(31) "Fri, 16 Jun 2006 00:00:00 +0100"
unicode(31) "Sun, 15 Jan 2006 00:00:00 +0000"
unicode(31) "Sun, 15 Jan 2006 00:00:00 +0000"
unicode(31) "Tue, 10 Oct 2000 13:55:36 +0100"
bool(false)
unicode(31) "Fri, 16 Jun 2006 20:06:00 +0100"
unicode(31) "Mon, 16 Jun 1986 22:51:59 +0100"
unicode(31) "Mon, 16 Jan 2006 00:00:00 +0000"
unicode(31) "Mon, 16 Jan 2006 00:00:00 +0000"
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php