summaryrefslogtreecommitdiffstats
path: root/php-5.4.42-datetests-1.patch
blob: 28a61098b0f44698bb0beabbfc7922fd1181f49f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
From c39e777722f9b566ecff521602fb49ea20bb2961 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 ba41b340c227ccfa61ba7b52d5d8cd07be512340 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 194e64982e4408ba54cec143612e1a1aaa0fb937 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 c1e84a3bdee216d8951fce8678daede24798ea94 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 97fcbf041af509bcb5c129b15ba5b6ce98f81cb6 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