summaryrefslogtreecommitdiff
path: root/sax/qa
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:09:18 +0100
commit0d9757e43217929fa172c1feecd161873cd7019b (patch)
tree087e5dd54690781cbc06d734ad767f92426608f1 /sax/qa
parent3c993bd0c3120445f27cb37e6ecfd8b45c6605e0 (diff)
sax: ConverterTest: add leap year tests
Diffstat (limited to 'sax/qa')
-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");
}