]> git.saurik.com Git - wxWidgets.git/blob - tests/testdate.h
add wrappers to avoid compiling code which will never be used
[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 // RCS-ID: $Id$
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_TESTS_TESTDATE_H_
11 #define _WX_TESTS_TESTDATE_H_
12
13 #include "wx/datetime.h"
14
15 // need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateTime objects
16 inline std::ostream& operator<<(std::ostream& ostr, const wxDateTime& dt)
17 {
18 ostr << dt.FormatISOCombined(' ');
19
20 return ostr;
21 }
22
23 // need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateSpan objects
24 inline std::ostream& operator<<(std::ostream& ostr, const wxDateSpan& span)
25 {
26 ostr << span.GetYears() << "Y, "
27 << span.GetMonths() << "M, "
28 << span.GetWeeks() << "W, "
29 << span.GetDays() << "D";
30
31 return ostr;
32 }
33
34 WX_CPPUNIT_ALLOW_EQUALS_TO_INT(wxDateTime::wxDateTime_t)
35
36 #endif // _WX_TESTS_TESTDATE_H_