diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 21:07:48 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 21:07:48 +0200 |
commit | d850e78baf62d1f472a3a296f407c127c64cec88 (patch) | |
tree | 39725643b44c91ea25809766cf95cd0b1173e880 /src/tests/xb_test_date.cpp | |
parent | 15f88452d39eee5a89551a89ef2b93df5168ba2f (diff) | |
parent | c894a7cdd8686ea695602a23a511a3f1b0d047be (diff) |
Update upstream source from tag 'upstream/4.1.4'
Update to upstream version '4.1.4'
with Debian dir 403f575aa88344456029245280a05149f0173f2e
Diffstat (limited to 'src/tests/xb_test_date.cpp')
-rwxr-xr-x | src/tests/xb_test_date.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/tests/xb_test_date.cpp b/src/tests/xb_test_date.cpp index 7aee584..0efe102 100755 --- a/src/tests/xb_test_date.cpp +++ b/src/tests/xb_test_date.cpp @@ -69,6 +69,8 @@ int main( int argCnt, char **av ) iRc += TestMethod( po, "FormatDate( '', sOutDate ) (sys default format)", d3.FormatDate( sFmt, sOutDate ), 0 ); iRc += TestMethod( po, "FormatDate( '', sOutDate ) (sys default format)", sOutDate, "07/09/12", 8 ); + + iRc += TestMethod( po, "CenturyOf()" , d3.CenturyOf(), 20 ); iRc += TestMethod( po, "YearOf()", d3.YearOf(), 2012 ); iRc += TestMethod( po, "MonthOf()", d3.MonthOf(), 7 ); @@ -84,12 +86,11 @@ int main( int argCnt, char **av ) d1.Set( "20010102" ); iRc += TestMethod( po, "d1.Set('20010102')", d1.Str(), "20010102", 8 ); - iRc += TestMethod( po, "d1.CalcRollingCenturyForYear(10)", d1.CalcRollingCenturyForYear( 10 ), 20 ); + iRc += TestMethod( po, "d1.CalcRollingCenturyForYear(10)", d1.CalcRollingCenturyForYear( 10 ), 20 ); iRc += TestMethod( po, "d1.JulianDays()", d1.JulianDays(), 2451912 ); - - iRc += TestMethod( po, "d1.Set( '20140709' )", d1.Set( "20140709" ) , 0 ); + d1.CharDayOf( s ); iRc += TestMethod( po, "d1.CharDayOf(s)", s, "Wednesday", 9 ); @@ -135,8 +136,8 @@ int main( int argCnt, char **av ) iRc+= TestMethod( po, "d1+2", d1+2, "20130407", 8 ); iRc+= TestMethod( po, "d1-5", d1-5, "20130402", 8 ); -// d1.Dump( "d1" ); -// d2.Dump( "d2" ); + //d1.Dump( "d1" ); + //d2.Dump( "d2" ); iRc+= TestMethod( po, "d1==d2", d1==d2, 0 ); d2 = d1; @@ -159,6 +160,29 @@ int main( int argCnt, char **av ) iRc+= TestMethod( po, "d1<=d2", d1<=d2, 0 ); iRc+= TestMethod( po, "d1-d2", d1-d2, 1 ); + + // null date testing follows + iRc+= TestMethod( po, "IsNull", d1.IsNull(), xbFalse ); + xbDate dN; + iRc+= TestMethod( po, "IsNull", dN.IsNull(), xbTrue ); + + xbDate dtNull1; + xbDate dtNull2; + + iRc+= TestMethod( po, "dtNull1==dtNull2", dtNull1 == dtNull2, 1 ); + iRc+= TestMethod( po, "dtNull1!=dtNull2", dtNull1 != dtNull2, 0 ); + + iRc+= TestMethod( po, "dtNull1 < d2", dtNull1 < d2, 1 ); + iRc+= TestMethod( po, "dtNull1 > d2", dtNull1 > d2, 0 ); + iRc+= TestMethod( po, "dtNull1 <= d2", dtNull1 <= d2, 1 ); + iRc+= TestMethod( po, "dtNull1 >= d2", dtNull1 >= d2, 0 ); + + iRc+= TestMethod( po, "d2 < dtNull1", d2 < dtNull1, 0 ); + iRc+= TestMethod( po, "d2 > dtNull1", d2 > dtNull1, 1 ); + iRc+= TestMethod( po, "d2 <= dtNull1", d2 <= dtNull1, 0 ); + iRc+= TestMethod( po, "d2 >= dtNull1", d2 >= dtNull1, 1 ); + + /* xbDate d4( "20171015" ); std::cout << "day of [" << d4.Str() << "][" << d4.DayOf( XB_FMT_WEEK ) << "]\n"; |