X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2747a51b243ef5d44cec5b4e3757d56af56352a2..f4ac09e8e9007b5b77b25599afed5cfe08d1d77a:/tests/datetime/datetimetest.cpp diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 67f9269c2a..112e3291a6 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -3,7 +3,6 @@ // Purpose: wxDateTime unit test // Author: Vadim Zeitlin // Created: 2004-06-23 (extracted from samples/console/console.cpp) -// RCS-ID: $Id$ // Copyright: (c) 2004 Vadim Zeitlin /////////////////////////////////////////////////////////////////////////////// @@ -1336,6 +1335,19 @@ void DateTimeTestCase::TestDSTBug() CPPUNIT_ASSERT_EQUAL(0, (int)dt2.GetSecond()); CPPUNIT_ASSERT_EQUAL(0, (int)dt2.GetMillisecond()); #endif // CHANGE_SYSTEM_DATE + + // Verify that setting the date to the beginning of the DST period moves it + // forward (as this date on its own would be invalid). The problem here is + // that our GetBeginDST() is far from being trustworthy, so just try a + // couple of dates for the common time zones and check that all of them are + // either unchanged or moved forward. + wxDateTime dtDST(10, wxDateTime::Mar, 2013, 2, 0, 0); + if ( dtDST.GetHour() != 2 ) + CPPUNIT_ASSERT_EQUAL( 3, dtDST.GetHour() ); + + dtDST = wxDateTime(31, wxDateTime::Mar, 2013, 2, 0, 0); + if ( dtDST.GetHour() != 2 ) + CPPUNIT_ASSERT_EQUAL( 3, dtDST.GetHour() ); } void DateTimeTestCase::TestDateOnly()