From 246a2a54662eb52468f9a411b315a4300aaa17c0 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 2 May 2017 17:53:13 +0200 Subject: Test that empty date is not a valid date Change-Id: If5f2db3d4bae9158b482b01ce7dbb7335b4cb16b --- tools/qa/cppunit/test_date.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qa/cppunit/test_date.cxx b/tools/qa/cppunit/test_date.cxx index c2c31e10b51c..2ea3673082a2 100644 --- a/tools/qa/cppunit/test_date.cxx +++ b/tools/qa/cppunit/test_date.cxx @@ -61,6 +61,10 @@ void DateTest::testDate() aDate.Normalize(); CPPUNIT_ASSERT_EQUAL( aMax.GetDate(), aDate.GetDate()); + // Empty date is not a valid date. + aDate = Date( Date::EMPTY ); + CPPUNIT_ASSERT( !aDate.IsValidDate()); + // 0001-00-x normalized to -0001-12-x aDate.SetYear(1); aDate.SetMonth(0); -- cgit