Hi, list.

I've fixed some datetime tests in the trunk in answer to "Rasmus call
for devs" :)
There are two patches here.
First patch is quite trivial - it fixes some relative/absolute path
misconfiguration in phpt tests.
Second patch fixes some timezone errors in bug51819 - some timezones
like GB were not parsed correctly. Tests are ok now but don't know if
my solution is correct.
Hope these patches would be useful.

P.S. Please, note I'm very new to C and will be happy if someone can
answer to some of my newbie questions and gently point my mistakes :)

2011/5/12 Rasmus Lerdorf <ras...@lerdorf.com>:
> On 05/11/2011 02:10 PM, Philip Olson wrote:
>
>> So, that's the concern there. But if the alpha is simply a trick to
>> convince people to test out a specific PHP 5.4 snapshot, and feel 5.4 is
>> real, then do it. ;)
>
> There are still quite a few test failures in trunk. Some of them are also in
> the 5_3 branch. In some cases the tests are simply bad. In a few the test
> case contains binary data that got mangled in the move to Subversion. It
> would be nice if just 1 in 10 people reading the list here would grab both
> trunk and 5_3 and run "make test" in each tree and then fix at least 1 test
> each. We would have no test failures by the end of the day other than a few
> tricky ones. If an alpha release will encourage this, great. If we could get
> people to just do it on their own without the alpha, even better.
>
> And yes, I know the tests take forever to run. Get yourself a fast machine
> with an SSD, and remember you can run partial tests using:
>
>  make test TESTS=ext/hash
>
> for example to just run the tests for the hash extension.
>
> Also, when a test fails, cd into the ext/hash/tests directory and you will
> see .out, .exp, .diff and .php files for the failed test. That is, the
> output, the expected output, the diff between them and the php script itself
> extracted from the .phpt file containing the failed test case.
>
> And if you can't figure out how to fix a test, post the details here. I'd
> love to point some of the obvious talents and energy of this list towards
> the code. If you don't have an svn account for committing your fixed test,
> go to http://www.php.net/svn-php.php and fill in the little form at the
> bottom there and put in the test that you fixed and a 1-liner about how you
> fixed it and I will set you up with an account right away. Info on how to
> check out the code from svn is here:
> https://wiki.php.net/vcs/svnfaq
>
> -Rasmus
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Regards,
Shein Alexey
Index: ext/date/tests/DateTime_diff_add_sub-fall-type3-type2.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-fall-type3-type2.phpt  (revision 
308238)
+++ ext/date/tests/DateTime_diff_add_sub-fall-type3-type2.phpt  (revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-spring-type3-type2.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-spring-type3-type2.phpt        
(revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-spring-type3-type2.phpt        
(revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-spring-type3-type3.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-spring-type3-type3.phpt        
(revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-spring-type3-type3.phpt        
(revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-massive.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-massive.phpt   (revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-massive.phpt   (revision )
@@ -10,7 +10,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-fall-type3-type3.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-fall-type3-type3.phpt  (revision 
308238)
+++ ext/date/tests/DateTime_diff_add_sub-fall-type3-type3.phpt  (revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-spring-type2-type2.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-spring-type2-type2.phpt        
(revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-spring-type2-type2.phpt        
(revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-fall-type2-type3.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-fall-type2-type3.phpt  (revision 
308238)
+++ ext/date/tests/DateTime_diff_add_sub-fall-type2-type3.phpt  (revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-spring-type2-type3.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-spring-type2-type3.phpt        
(revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-spring-type2-type3.phpt        
(revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-dates.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-dates.phpt     (revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-dates.phpt     (revision )
@@ -10,7 +10,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-february.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-february.phpt  (revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-february.phpt  (revision )
@@ -10,7 +10,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-fall-type2-type2.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-fall-type2-type2.phpt  (revision 
308238)
+++ ext/date/tests/DateTime_diff_add_sub-fall-type2-type2.phpt  (revision )
@@ -12,7 +12,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/tests/DateTime_diff_add_sub-absolute.phpt
===================================================================
--- ext/date/tests/DateTime_diff_add_sub-absolute.phpt  (revision 308238)
+++ ext/date/tests/DateTime_diff_add_sub-absolute.phpt  (revision )
@@ -10,7 +10,7 @@
  * in a userland package.  Please be so kind as to leave them.
  */
 
-require './examine_diff.inc';
+require __DIR__ . '/examine_diff.inc';
 date_default_timezone_set('America/New_York');
 
 
Index: ext/date/lib/parse_date.c
===================================================================
--- ext/date/lib/parse_date.c   (revision 310981)
+++ ext/date/lib/parse_date.c   (working copy)
@@ -806,12 +806,10 @@
                }
 #endif
                /* If we have a TimeZone identifier to start with, use it */
-               if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
-                       if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != 
NULL) {
-                               t->tz_info = res;
-                               t->zone_type = TIMELIB_ZONETYPE_ID;
-                               found++;
-                       }
+        if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
+            t->tz_info = res;
+            t->zone_type = TIMELIB_ZONETYPE_ID;
+            found++;
                }
                if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
                        timelib_time_tz_abbr_update(t, tz_abbr);
Index: ext/date/lib/parse_date.re
===================================================================
--- ext/date/lib/parse_date.re  (revision 310981)
+++ ext/date/lib/parse_date.re  (working copy)
@@ -804,13 +804,11 @@
                }
 #endif
                /* If we have a TimeZone identifier to start with, use it */
-               if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
-                       if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != 
NULL) {
-                               t->tz_info = res;
-                               t->zone_type = TIMELIB_ZONETYPE_ID;
-                               found++;
-                       }
-               }
+        if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
+            t->tz_info = res;
+            t->zone_type = TIMELIB_ZONETYPE_ID;
+            found++;
+        }
                if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
                        timelib_time_tz_abbr_update(t, tz_abbr);
                }
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to