summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-02-29 14:08:17 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-29 14:18:44 +0100
commitf3e65a72f8c37ee3795ed83b93f7483d45d5b403 (patch)
tree4f2dd569884004eb7d6b5ab70bc6178611a55337
parenta2d96b51f3272ecbdc0f4f9d4b2ee65409892554 (diff)
sax: ConverterTest: add leap year tests
(cherry picked from commit 0d9757e43217929fa172c1feecd161873cd7019b) Signed-off-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sax/qa/cppunit/test_converter.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 64bbf2918d69..4a3d36405edb 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -212,6 +212,10 @@ void ConverterTest::testDateTime()
doTest( util::DateTime(99, 59, 59, 23, 31, 12, 9999),
"9999-12-31T23:59:59.9999999999999999999999999999999999999Z",
"9999-12-31T23:59:59.99" );
+ doTest( util::DateTime(0, 0, 0, 0, 29, 2, 2000), // leap year
+ "2000-02-29T00:00:00-00:00", "2000-02-29T00:00:00" );
+ doTest( util::DateTime(0, 0, 0, 0, 29, 2, 1600), // leap year
+ "1600-02-29T00:00:00-00:00", "1600-02-29T00:00:00" );
doTest( util::DateTime(0, 0, 0, 24, 1, 1, 333)
/*(0, 0, 0, 0, 2, 1, 333)*/,
"0333-01-01T24:00:00"/*, "0333-01-02T00:00:00"*/ );
@@ -240,6 +244,8 @@ void ConverterTest::testDateTime()
doTestDateTimeF( "0001-01-02T00:00:00+14:01" ); // invalid: TZ > +14:00
doTestDateTimeF( "0001-01-02T00:00:00-15:00" ); // invalid: TZ < -14:00
doTestDateTimeF( "0001-01-02T00:00:00-14:01" ); // invalid: TZ < -14:00
+ doTestDateTimeF( "2100-02-29T00:00:00-00:00" ); // invalid: no leap year
+ doTestDateTimeF( "1900-02-29T00:00:00-00:00" ); // invalid: no leap year
OSL_TRACE("\nSAX CONVERTER TEST END");
}