]>
git.saurik.com Git - wxWidgets.git/blob - tests/testdate.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/testdate.h
3 // Purpose: Unit test helpers for dealing with wxDateTime.
4 // Author: Vadim Zeitlin
5 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
6 // Licence: wxWindows licence
7 ///////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_TESTS_TESTDATE_H_
10 #define _WX_TESTS_TESTDATE_H_
12 #include "wx/datetime.h"
14 // need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateTime objects
15 inline std::ostream
& operator<<(std::ostream
& ostr
, const wxDateTime
& dt
)
17 ostr
<< dt
.FormatISOCombined(' ');
22 // need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateSpan objects
23 inline std::ostream
& operator<<(std::ostream
& ostr
, const wxDateSpan
& span
)
25 ostr
<< span
.GetYears() << "Y, "
26 << span
.GetMonths() << "M, "
27 << span
.GetWeeks() << "W, "
28 << span
.GetDays() << "D";
33 WX_CPPUNIT_ALLOW_EQUALS_TO_INT(wxDateTime::wxDateTime_t
)
35 #endif // _WX_TESTS_TESTDATE_H_