]> granicus.if.org Git - php/commitdiff
Fix differences in some sub() results that were causing tests to fail.
authorDaniel Convissor <danielc@php.net>
Tue, 23 Aug 2011 16:40:19 +0000 (16:40 +0000)
committerDaniel Convissor <danielc@php.net>
Tue, 23 Aug 2011 16:40:19 +0000 (16:40 +0000)
ext/date/tests/DateTime_data-dates.inc
ext/date/tests/DateTime_data-february.inc
ext/date/tests/DateTime_sub-dates.phpt
ext/date/tests/DateTime_sub-february.phpt

index be608dfcba3f0b8aab5dfa4140b79e2c39f4da05..c6f04e16ccbbb57927e164a03da3f499a9d65740 100644 (file)
@@ -20,6 +20,7 @@ examine_diff('2007-02-07', '2000-02-07', 'P+7Y0M0DT0H0M0S', 2557);
 echo "test_years_positive__7_by_1_day: ";
 examine_diff('2007-02-08', '2000-02-07', 'P+7Y0M1DT0H0M0S', 2558);
 
+// NOTE: sub() produces different answer.
 echo "test_years_positive__6_shy_1_day: ";
 examine_diff('2007-02-06', '2000-02-07', 'P+6Y11M30DT0H0M0S', 2556);
 
@@ -48,6 +49,7 @@ examine_diff('2000-02-07', '2007-02-07', 'P-7Y0M0DT0H0M0S', 2557);
 echo "test_years_negative__7_by_1_day: ";
 examine_diff('2000-02-07', '2007-02-08', 'P-7Y0M1DT0H0M0S', 2558);
 
+// NOTE: sub() produces different answer.
 echo "test_years_negative__6_shy_1_day: ";
 examine_diff('2000-02-07', '2007-02-06', 'P-6Y11M28DT0H0M0S', 2556);
 
index 8c31ef69ac74bea8c089635efdb867cf0995623a..cc9d85df07d1d8c2f28aed0da40d0850cba37f71 100644 (file)
@@ -71,15 +71,19 @@ examine_diff('2010-03-01', '2010-01-01', 'P+0Y2M0DT0H0M0S', 59);
 echo "test_bug_49081__20: ";
 examine_diff('2010-03-01', '2010-01-31', 'P+0Y0M29DT0H0M0S', 29);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081__21: ";
 examine_diff('2010-03-27', '2010-01-31', 'P+0Y1M24DT0H0M0S', 55);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081__22: ";
 examine_diff('2010-03-28', '2010-01-31', 'P+0Y1M25DT0H0M0S', 56);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081__23: ";
 examine_diff('2010-03-29', '2010-01-31', 'P+0Y1M26DT0H0M0S', 57);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081__24: ";
 examine_diff('2010-03-30', '2010-01-31', 'P+0Y1M27DT0H0M0S', 58);
 
@@ -168,18 +172,23 @@ examine_diff('2010-01-27', '2010-02-28', 'P-0Y1M1DT0H0M0S', 32);
 echo "test_bug_49081_negative__19: ";
 examine_diff('2010-01-01', '2010-03-01', 'P-0Y2M0DT0H0M0S', 59);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081_negative__20: ";
 examine_diff('2010-01-31', '2010-03-01', 'P-0Y1M1DT0H0M0S', 29);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081_negative__21: ";
 examine_diff('2010-01-31', '2010-03-27', 'P-0Y1M27DT0H0M0S', 55);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081_negative__22: ";
 examine_diff('2010-01-31', '2010-03-28', 'P-0Y1M28DT0H0M0S', 56);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081_negative__23: ";
 examine_diff('2010-01-31', '2010-03-29', 'P-0Y1M29DT0H0M0S', 57);
 
+// NOTE: sub() produces different answer.
 echo "test_bug_49081_negative__24: ";
 examine_diff('2010-01-31', '2010-03-30', 'P-0Y1M30DT0H0M0S', 58);
 
index 36ca25c167ac7b131ce1564b5b728fd98ffcf59a..26f49ba838267dda35fbf21b9027471364c77ab3 100644 (file)
@@ -14,7 +14,7 @@ require 'DateTime_data-dates.inc';
 test__7: SUB: 2009-01-14 00:00:00 EST - P+0Y0M7DT0H0M0S = **2009-01-07 00:00:00 EST**
 test_years_positive__7_by_0_day: SUB: 2007-02-07 00:00:00 EST - P+7Y0M0DT0H0M0S = **2000-02-07 00:00:00 EST**
 test_years_positive__7_by_1_day: SUB: 2007-02-08 00:00:00 EST - P+7Y0M1DT0H0M0S = **2000-02-07 00:00:00 EST**
-test_years_positive__6_shy_1_day: SUB: 2007-02-06 00:00:00 EST - P+6Y11M30DT0H0M0S = **2000-02-07 00:00:00 EST**
+test_years_positive__6_shy_1_day: SUB: 2007-02-06 00:00:00 EST - P+6Y11M30DT0H0M0S = **2000-02-05 00:00:00 EST**
 test_years_positive__7_by_1_month: SUB: 2007-03-07 00:00:00 EST - P+7Y1M0DT0H0M0S = **2000-02-07 00:00:00 EST**
 test_years_positive__6_shy_1_month: SUB: 2007-01-07 00:00:00 EST - P+6Y11M0DT0H0M0S = **2000-02-07 00:00:00 EST**
 test_years_positive__7_by_1_month_split_newyear: SUB: 2007-01-07 00:00:00 EST - P+7Y1M0DT0H0M0S = **1999-12-07 00:00:00 EST**
@@ -22,7 +22,7 @@ test_years_positive__6_shy_1_month_split_newyear: SUB: 2006-12-07 00:00:00 EST -
 test_negative__7: SUB: 2009-01-07 00:00:00 EST - P-0Y0M7DT0H0M0S = **2009-01-14 00:00:00 EST**
 test_years_negative__7_by_0_day: SUB: 2000-02-07 00:00:00 EST - P-7Y0M0DT0H0M0S = **2007-02-07 00:00:00 EST**
 test_years_negative__7_by_1_day: SUB: 2000-02-07 00:00:00 EST - P-7Y0M1DT0H0M0S = **2007-02-08 00:00:00 EST**
-test_years_negative__6_shy_1_day: SUB: 2000-02-07 00:00:00 EST - P-6Y11M28DT0H0M0S = **2007-02-06 00:00:00 EST**
+test_years_negative__6_shy_1_day: SUB: 2000-02-07 00:00:00 EST - P-6Y11M28DT0H0M0S = **2007-02-04 00:00:00 EST**
 test_years_negative__7_by_1_month: SUB: 2000-02-07 00:00:00 EST - P-7Y1M0DT0H0M0S = **2007-03-07 00:00:00 EST**
 test_years_negative__6_shy_1_month: SUB: 2000-02-07 00:00:00 EST - P-6Y11M0DT0H0M0S = **2007-01-07 00:00:00 EST**
 test_years_negative__7_by_1_month_split_newyear: SUB: 1999-12-07 00:00:00 EST - P-7Y1M0DT0H0M0S = **2007-01-07 00:00:00 EST**
index 89cba4bded5bb1865259dc210c534d5dc43cf96d..23c8da44791238b29005c980080a14e8d1e41df2 100644 (file)
@@ -31,10 +31,10 @@ test_bug_49081__17: SUB: 2010-02-28 00:00:00 EST - P+0Y1M0DT0H0M0S = **2010-01-2
 test_bug_49081__18: SUB: 2010-02-28 00:00:00 EST - P+0Y1M1DT0H0M0S = **2010-01-27 00:00:00 EST**
 test_bug_49081__19: SUB: 2010-03-01 00:00:00 EST - P+0Y2M0DT0H0M0S = **2010-01-01 00:00:00 EST**
 test_bug_49081__20: SUB: 2010-03-01 00:00:00 EST - P+0Y0M29DT0H0M0S = **2010-01-31 00:00:00 EST**
-test_bug_49081__21: SUB: 2010-03-27 00:00:00 EDT - P+0Y1M24DT0H0M0S = **2010-01-31 00:00:00 EST**
-test_bug_49081__22: SUB: 2010-03-28 00:00:00 EDT - P+0Y1M25DT0H0M0S = **2010-01-31 00:00:00 EST**
-test_bug_49081__23: SUB: 2010-03-29 00:00:00 EDT - P+0Y1M26DT0H0M0S = **2010-01-31 00:00:00 EST**
-test_bug_49081__24: SUB: 2010-03-30 00:00:00 EDT - P+0Y1M27DT0H0M0S = **2010-01-31 00:00:00 EST**
+test_bug_49081__21: SUB: 2010-03-27 00:00:00 EDT - P+0Y1M24DT0H0M0S = **2010-02-03 00:00:00 EST**
+test_bug_49081__22: SUB: 2010-03-28 00:00:00 EDT - P+0Y1M25DT0H0M0S = **2010-02-03 00:00:00 EST**
+test_bug_49081__23: SUB: 2010-03-29 00:00:00 EDT - P+0Y1M26DT0H0M0S = **2010-02-03 00:00:00 EST**
+test_bug_49081__24: SUB: 2010-03-30 00:00:00 EDT - P+0Y1M27DT0H0M0S = **2010-02-03 00:00:00 EST**
 test_bug_49081__25: SUB: 2010-03-31 00:00:00 EDT - P+0Y2M0DT0H0M0S = **2010-01-31 00:00:00 EST**
 test_bug_49081__26: SUB: 2010-03-31 00:00:00 EDT - P+0Y2M1DT0H0M0S = **2010-01-30 00:00:00 EST**
 test_bug_49081__27: SUB: 2009-01-31 00:00:00 EST - P+0Y0M30DT0H0M0S = **2009-01-01 00:00:00 EST**
@@ -62,11 +62,11 @@ test_bug_49081_negative__16: SUB: 2010-01-29 00:00:00 EST - P-0Y0M30DT0H0M0S = *
 test_bug_49081_negative__17: SUB: 2010-01-28 00:00:00 EST - P-0Y1M0DT0H0M0S = **2010-02-28 00:00:00 EST**
 test_bug_49081_negative__18: SUB: 2010-01-27 00:00:00 EST - P-0Y1M1DT0H0M0S = **2010-02-28 00:00:00 EST**
 test_bug_49081_negative__19: SUB: 2010-01-01 00:00:00 EST - P-0Y2M0DT0H0M0S = **2010-03-01 00:00:00 EST**
-test_bug_49081_negative__20: SUB: 2010-01-31 00:00:00 EST - P-0Y1M1DT0H0M0S = **2010-03-01 00:00:00 EST**
-test_bug_49081_negative__21: SUB: 2010-01-31 00:00:00 EST - P-0Y1M27DT0H0M0S = **2010-03-27 00:00:00 EDT**
-test_bug_49081_negative__22: SUB: 2010-01-31 00:00:00 EST - P-0Y1M28DT0H0M0S = **2010-03-28 00:00:00 EDT**
-test_bug_49081_negative__23: SUB: 2010-01-31 00:00:00 EST - P-0Y1M29DT0H0M0S = **2010-03-29 00:00:00 EDT**
-test_bug_49081_negative__24: SUB: 2010-01-31 00:00:00 EST - P-0Y1M30DT0H0M0S = **2010-03-30 00:00:00 EDT**
+test_bug_49081_negative__20: SUB: 2010-01-31 00:00:00 EST - P-0Y1M1DT0H0M0S = **2010-03-04 00:00:00 EST**
+test_bug_49081_negative__21: SUB: 2010-01-31 00:00:00 EST - P-0Y1M27DT0H0M0S = **2010-03-30 00:00:00 EDT**
+test_bug_49081_negative__22: SUB: 2010-01-31 00:00:00 EST - P-0Y1M28DT0H0M0S = **2010-03-31 00:00:00 EDT**
+test_bug_49081_negative__23: SUB: 2010-01-31 00:00:00 EST - P-0Y1M29DT0H0M0S = **2010-04-01 00:00:00 EDT**
+test_bug_49081_negative__24: SUB: 2010-01-31 00:00:00 EST - P-0Y1M30DT0H0M0S = **2010-04-02 00:00:00 EDT**
 test_bug_49081_negative__25: SUB: 2010-01-31 00:00:00 EST - P-0Y2M0DT0H0M0S = **2010-03-31 00:00:00 EDT**
 test_bug_49081_negative__26: SUB: 2010-01-30 00:00:00 EST - P-0Y2M1DT0H0M0S = **2010-03-31 00:00:00 EDT**
 test_bug_49081_negative__27: SUB: 2009-01-01 00:00:00 EST - P-0Y0M30DT0H0M0S = **2009-01-31 00:00:00 EST**