]> git.saurik.com Git - wxWidgets.git/blob - tests/testdate.h
Partial fix for #15196: wxRichTextCell caret issues (dghart)
[wxWidgets.git] / 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 ///////////////////////////////////////////////////////////////////////////////
8
9 #ifndef _WX_TESTS_TESTDATE_H_
10 #define _WX_TESTS_TESTDATE_H_
11
12 #include "wx/datetime.h"
13
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)
16 {
17 ostr << dt.FormatISOCombined(' ');
18
19 return ostr;
20 }
21
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)
24 {
25 ostr << span.GetYears() << "Y, "
26 << span.GetMonths() << "M, "
27 << span.GetWeeks() << "W, "
28 << span.GetDays() << "D";
29
30 return ostr;
31 }
32
33 WX_CPPUNIT_ALLOW_EQUALS_TO_INT(wxDateTime::wxDateTime_t)
34
35 #endif // _WX_TESTS_TESTDATE_H_