summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-04-18 10:43:10 +0200
committerRemi Collet <fedora@famillecollet.com>2015-04-18 10:43:10 +0200
commit97b4f1e66a8b8bbbcb6513152e4f3db489c450e1 (patch)
tree53c5e37770aafcd440acc90d4e63ba3a82611b90
parent1474f47656ebc2f91db499e3f5207f5d8068cad6 (diff)
php 5.5: backport patch from 5.6 for date tests
-rw-r--r--php-5.5.14-noNO.patch43
-rw-r--r--php-5.5.24-datetests.patch337
-rw-r--r--php55.spec6
3 files changed, 340 insertions, 46 deletions
diff --git a/php-5.5.14-noNO.patch b/php-5.5.14-noNO.patch
deleted file mode 100644
index 52f54ab..0000000
--- a/php-5.5.14-noNO.patch
+++ /dev/null
@@ -1,43 +0,0 @@
---- ext/standard/tests/strings/setlocale_variation2.phpt.orig 2014-06-11 16:10:00.259326468 +0200
-+++ ext/standard/tests/strings/setlocale_variation2.phpt 2014-06-11 16:16:14.396138997 +0200
-@@ -52,6 +52,7 @@
- //try different locale names
- $failure_locale = array();
- $success_count = 0;
-+$expected = 0;
-
- echo "-- Test setlocale() with all available locale in the system --\n";
- // gather all locales installed in the system(stored $all_system_locales),
-@@ -61,6 +62,10 @@
- if(setlocale(LC_ALL,$value )){
- $success_count++;
- }
-+ else if ($value == 'no_NO.ISO-8859-1') {
-+ // ignore this one, see rhbz #971416
-+ $expected++;
-+ }
- else{
- //failure values are put in to an array $failure_locale
- $failure_locale[] = $value;
-@@ -69,11 +74,11 @@
-
- echo "No of locales found on the machine = ".count($all_system_locales)."\n";
- echo "No of setlocale() success = ".$success_count."\n";
--echo "Expected no of failures = 0\n";
-+echo "Expected no of failures = $expected\n";
- echo "Test ";
- // check if there were any failure of setlocale() function earlier, if any
- // failure then dump the list of failing locales
--if($success_count != count($all_system_locales)){
-+if(($success_count + $expected) != count($all_system_locales)){
- echo "FAILED\n";
- echo "Names of locale() for which setlocale() failed ...\n";
- var_dump($failure_locale);
-@@ -89,6 +94,6 @@
- -- Test setlocale() with all available locale in the system --
- No of locales found on the machine = %d
- No of setlocale() success = %d
--Expected no of failures = 0
-+Expected no of failures = %d
- Test PASSED
- Done
diff --git a/php-5.5.24-datetests.patch b/php-5.5.24-datetests.patch
new file mode 100644
index 0000000..9e78cc7
--- /dev/null
+++ b/php-5.5.24-datetests.patch
@@ -0,0 +1,337 @@
+Ignore "Factory" which is not available with system tzdata
+
+Backport various fix from 5.6
+
+--- a/ext/date/tests/bug66985.phpt 2014-10-30 07:32:03.297693403 +0100
++++ b/ext/date/tests/bug66985.phpt 2014-10-30 07:32:45.138877977 +0100
+@@ -3,7 +3,7 @@
+ --FILE--
+ <?php
+ $zones = array(
+- "CST6CDT", "Cuba", "Egypt", "Eire", "EST5EDT", "Factory", "GB-Eire",
++ "CST6CDT", "Cuba", "Egypt", "Eire", "EST5EDT", "GB-Eire",
+ "GMT0", "Greenwich", "Hongkong", "Iceland", "Iran", "Israel", "Jamaica",
+ "Japan", "Kwajalein", "Libya", "MST7MDT", "Navajo", "NZ-CHAT", "Poland",
+ "Portugal", "PST8PDT", "Singapore", "Turkey", "Universal", "W-SU",
+@@ -45,11 +45,6 @@
+ )
+ DateTimeZone Object
+ (
+- [timezone_type] => 3
+- [timezone] => Factory
+-)
+-DateTimeZone Object
+-(
+ [timezone_type] => 3
+ [timezone] => GB-Eire
+ )
+From cd93b120c3cfb129bca7365f48015c46abeb0333 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Apr 2015 07:47:47 +0200
+Subject: [PATCH] Make date transitions tests more flexible
+
+zic in recent glibc (2.20) introduce a new transitionn
+so use a range to avoid failure when total number
+of transitions is different (243/244)
+---
+ ext/date/tests/DateTimeZone_getTransitions_basic1.phpt | 6 +++---
+ ext/date/tests/timezone_transitions_get_basic1.phpt | 10 +++++-----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt b/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt
+index f3640d1..d178080 100644
+--- a/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt
++++ b/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt
+@@ -16,7 +16,7 @@ date_default_timezone_set("Europe/London");
+ // Create a DateTimeZone object
+ $tz = new DateTimeZone("Europe/London");
+
+-$tran = $tz->getTransitions();
++$tran = $tz->getTransitions(-306972000, -37241999);
+
+ if (!is_array($tran)) {
+ echo "TEST FAILED: Expected an array\n";
+@@ -25,14 +25,14 @@ if (!is_array($tran)) {
+ echo "\n-- Total number of transitions: " . count($tran). " --\n";
+
+ echo "\n-- Format a sample entry for Spring 1963 --\n";
+-var_dump( $tran[97] );
++var_dump( $tran[6] );
+
+ ?>
+ ===DONE===
+ --EXPECT--
+ *** Testing DateTimeZone::getTransitions() : basic functionality ***
+
+--- Total number of transitions: 243 --
++-- Total number of transitions: 18 --
+
+ -- Format a sample entry for Spring 1963 --
+ array(5) {
+diff --git a/ext/date/tests/timezone_transitions_get_basic1.phpt b/ext/date/tests/timezone_transitions_get_basic1.phpt
+index eb6cf99..97c5f0c 100644
+--- a/ext/date/tests/timezone_transitions_get_basic1.phpt
++++ b/ext/date/tests/timezone_transitions_get_basic1.phpt
+@@ -18,24 +18,24 @@ $tz = timezone_open("Europe/London");
+
+ $tran = timezone_transitions_get($tz);
+
+-echo "\n-- Get all transitions --\n";
+-$tran = timezone_transitions_get($tz);
++echo "\n-- Get all 60s transitions --\n";
++$tran = timezone_transitions_get($tz, -306972000, -37241999);
+ var_dump( gettype($tran) );
+
+ echo "\n-- Total number of transitions: " . count($tran). " --\n";
+
+ echo "\n-- Format a sample entry pfor Spring 1963 --\n";
+-var_dump( $tran[97] );
++var_dump( $tran[6] );
+
+ ?>
+ ===DONE===
+ --EXPECT--
+ *** Testing timezone_transitions_get() : basic functionality ***
+
+--- Get all transitions --
++-- Get all 60s transitions --
+ string(5) "array"
+
+--- Total number of transitions: 243 --
++-- Total number of transitions: 18 --
+
+ -- Format a sample entry pfor Spring 1963 --
+ array(5) {
+--
+2.1.4
+
+From 984f4b09e028b93e6ab3b738d9bde670fca6fc95 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Apr 2015 09:11:39 +0200
+Subject: [PATCH] relax bigbang content (new zic)
+
+---
+ ext/date/tests/bug48058.phpt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ext/date/tests/bug48058.phpt b/ext/date/tests/bug48058.phpt
+index 46a1918..87d2190 100644
+--- a/ext/date/tests/bug48058.phpt
++++ b/ext/date/tests/bug48058.phpt
+@@ -20,10 +20,10 @@ array(5) {
+ ["time"]=>
+ string(%d) "%s"
+ ["offset"]=>
+- int(3600)
++ int(%s)
+ ["isdst"]=>
+- bool(true)
++ bool(%s)
+ ["abbr"]=>
+- string(3) "BST"
++ string(%d) "%s"
+ }
+ 10000002008-02-28T12:00:00+0000
+--
+2.1.4
+
+From 3c81e945a3c61ea3ec00eeb946e95a1f9b92b956 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Apr 2015 09:28:29 +0200
+Subject: [PATCH] relax test for date < INT32_MIN (new zic)
+
+---
+ ext/date/tests/mktime-3-64bit.phpt | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/ext/date/tests/mktime-3-64bit.phpt b/ext/date/tests/mktime-3-64bit.phpt
+index a3649cd..cbb441f 100644
+--- a/ext/date/tests/mktime-3-64bit.phpt
++++ b/ext/date/tests/mktime-3-64bit.phpt
+@@ -24,7 +24,7 @@ foreach ($tzs as $tz) {
+ echo "\n";
+ }
+ ?>
+---EXPECT--
++--EXPECTF--
+ America/Toronto
+ Y: 0 - January 2000-01-01T01:01:01-0500
+ Y: 69 - January 2069-01-01T01:01:01-0500
+@@ -32,11 +32,11 @@ 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: 101 - January 0101-01-01T01:01:01-0500
+-Y: 105 - January 0105-01-01T01:01:01-0500
+-Y: 110 - January 0110-01-01T01:01:01-0500
+-Y: 1900 - January 1900-01-01T01:01:01-0500
+-Y: 1901 - January 1901-01-01T01:01:01-0500
++Y: 101 - January 0101-01-01T01:01:01-0%d
++Y: 105 - January 0105-01-01T01:01:01-0%d
++Y: 110 - January 0110-01-01T01:01:01-0%d
++Y: 1900 - January 1900-01-01T01:01:01-0%d
++Y: 1901 - January 1901-01-01T01:01:01-0%d
+ 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
+@@ -49,11 +49,11 @@ 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: 101 - January 0101-01-01T01:01:01+0100
+-Y: 105 - January 0105-01-01T01:01:01+0100
+-Y: 110 - January 0110-01-01T01:01:01+0100
+-Y: 1900 - January 1900-01-01T01:01:01+0100
+-Y: 1901 - January 1901-01-01T01:01:01+0100
++Y: 101 - January 0101-01-01T01:01:01+0%d
++Y: 105 - January 0105-01-01T01:01:01+0%d
++Y: 110 - January 0110-01-01T01:01:01+0%d
++Y: 1900 - January 1900-01-01T01:01:01+0%d
++Y: 1901 - January 1901-01-01T01:01:01+0%d
+ 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
+--
+2.1.4
+
+From 3bbfb96e1a1eef0a6cf6891532f9ac419c95dbd8 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Apr 2015 09:37:06 +0200
+Subject: [PATCH] ignore second value for huge timestamp test (new zic)
+
+---
+ ext/date/tests/getdate_variation7.phpt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt
+index 2088fa1..c757ac7 100644
+--- a/ext/date/tests/getdate_variation7.phpt
++++ b/ext/date/tests/getdate_variation7.phpt
+@@ -27,7 +27,7 @@ var_dump( getdate($timestamp) );
+ -- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
+ array\(11\) {
+ \["seconds"\]=>
+- int\((36|0)\)
++ int\((.+)\)
+ \["minutes"\]=>
+ int\((43|0)\)
+ \["hours"\]=>
+@@ -53,7 +53,7 @@ array\(11\) {
+ -- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
+ array\(11\) {
+ \["seconds"\]=>
+- int\((44|12|20)\)
++ int\((.+)\)
+ \["minutes"\]=>
+ int\((39|23)\)
+ \["hours"\]=>
+--
+2.1.4
+
+From 1302eb7f7275c3f0b2b3af964dde91c44b769bbc Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Apr 2015 10:00:15 +0200
+Subject: [PATCH] relax tests with huge year (new zic)
+
+---
+ ext/date/tests/DateTime_add-massive.phpt | 6 +++---
+ ext/date/tests/DateTime_diff-massive.phpt | 6 +++---
+ ext/date/tests/DateTime_sub-massive.phpt | 6 +++---
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/ext/date/tests/DateTime_add-massive.phpt b/ext/date/tests/DateTime_add-massive.phpt
+index ca5bef9..6093d05 100644
+--- a/ext/date/tests/DateTime_add-massive.phpt
++++ b/ext/date/tests/DateTime_add-massive.phpt
+@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
+ require 'DateTime_data-massive.inc';
+
+ ?>
+---EXPECT--
+-test_massive_positive: ADD: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
+-test_massive_negative: ADD: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
++--EXPECTF--
++test_massive_positive: ADD: -333333-01-01 16:18:02 %s + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 %s**
++test_massive_negative: ADD: 333333-01-01 16:18:02 %s + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 %s**
+diff --git a/ext/date/tests/DateTime_diff-massive.phpt b/ext/date/tests/DateTime_diff-massive.phpt
+index 2199f84..12a7d0f 100644
+--- a/ext/date/tests/DateTime_diff-massive.phpt
++++ b/ext/date/tests/DateTime_diff-massive.phpt
+@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
+ require 'DateTime_data-massive.inc';
+
+ ?>
+---EXPECT--
+-test_massive_positive: DIFF: 333333-01-01 16:18:02 EST - -333333-01-01 16:18:02 EST = **P+666666Y0M0DT0H0M0S**
+-test_massive_negative: DIFF: -333333-01-01 16:18:02 EST - 333333-01-01 16:18:02 EST = **P-666666Y0M0DT0H0M0S**
++--EXPECTF--
++test_massive_positive: DIFF: 333333-01-01 16:18:02 %s - -333333-01-01 16:18:02 %s = **P+666666Y0M0DT0H%s**
++test_massive_negative: DIFF: -333333-01-01 16:18:02 %s - 333333-01-01 16:18:02 %s = **P-666666Y0M0DT0H%s**
+diff --git a/ext/date/tests/DateTime_sub-massive.phpt b/ext/date/tests/DateTime_sub-massive.phpt
+index a0520ec..e143056 100644
+--- a/ext/date/tests/DateTime_sub-massive.phpt
++++ b/ext/date/tests/DateTime_sub-massive.phpt
+@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_SUB);
+ require 'DateTime_data-massive.inc';
+
+ ?>
+---EXPECT--
+-test_massive_positive: SUB: 333333-01-01 16:18:02 EST - P+666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
+-test_massive_negative: SUB: -333333-01-01 16:18:02 EST - P-666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
++--EXPECTF--
++test_massive_positive: SUB: 333333-01-01 16:18:02 %s - P+666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 %s**
++test_massive_negative: SUB: -333333-01-01 16:18:02 %s - P-666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 %s**
+--
+2.1.4
+From 7cbd8f8b8a662c1e74cb1c97dac6f606f8f477c9 Mon Sep 17 00:00:00 2001
+From: krakjoe <joe.watkins@live.co.uk>
+Date: Thu, 21 Aug 2014 10:03:48 +0100
+Subject: [PATCH] remove bogus locale use from test
+
+---
+ ext/standard/tests/strings/setlocale_variation2.phpt | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
+index 038ba58..10ae22f 100644
+--- a/ext/standard/tests/strings/setlocale_variation2.phpt
++++ b/ext/standard/tests/strings/setlocale_variation2.phpt
+@@ -18,8 +18,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
+ /* setlocale() to set all available locales in the system and check the success count */
+ echo "*** Testing setlocale() : usage variations ***\n";
+
+-function good_locale($locale) {
+- return $locale !== 'tt_RU@iqtelif.UTF-8';
++function good_locale($locale) {
++ /**
++ * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/show_bug.cgi?id=532487
++ **/
++ return $locale !== 'tt_RU@iqtelif.UTF-8' && substr($locale, 0, 5) !== "no_NO";
+ }
+
+ /* Prototype : array list_system_locales( void )
+From 3e6f17673338034724c8b637c214b53a51a9db14 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Wed, 1 Oct 2014 10:14:14 +0200
+Subject: [PATCH] only no_NO.ISO-8859-1 have to be ignored
+
+---
+ ext/standard/tests/strings/setlocale_variation2.phpt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
+index 10ae22f..5ebdfe8 100644
+--- a/ext/standard/tests/strings/setlocale_variation2.phpt
++++ b/ext/standard/tests/strings/setlocale_variation2.phpt
+@@ -20,9 +20,9 @@ echo "*** Testing setlocale() : usage variations ***\n";
+
+ function good_locale($locale) {
+ /**
+- * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/show_bug.cgi?id=532487
++ * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416
+ **/
+- return $locale !== 'tt_RU@iqtelif.UTF-8' && substr($locale, 0, 5) !== "no_NO";
++ return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1';
+ }
+
+ /* Prototype : array list_system_locales( void )
diff --git a/php55.spec b/php55.spec
index e4d0773..1656aaa 100644
--- a/php55.spec
+++ b/php55.spec
@@ -193,10 +193,10 @@ Patch91: php-5.3.7-oci8conf.patch
# Security fixes (200+)
# Fixes for tests (300+)
+# Factory is droped from system tzdata + upstream patch for new zic
+Patch300: php-5.5.24-datetests.patch
# Revert change for pcre 8.34
Patch301: php-5.5.10-pcre834.patch
-# see https://bugzilla.redhat.com/971416
-Patch302: php-5.5.14-noNO.patch
# WIP
@@ -947,13 +947,13 @@ rm -rf ext/json
# security patches
# Fixes for tests
+%patch300 -p1 -b .datetests
%if %{with_libpcre}
%if 0%{?fedora} < 21
# Only apply when system libpcre < 8.34
%patch301 -p1 -R -b .pcre84
%endif
%endif
-%patch302 -p0 -b .971416
# WIP patch