From 179dced0e096a577bc2550e521dc020808ac2d0d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 30 Nov 2017 21:52:46 +0100 Subject: [PATCH] Include testdate.h before catch.hpp in unit tests This ensures that dates are printed out correctly if comparing them fails. It might be better to avoid always including this header, but this is the simplest solution. --- tests/datetime/datetimetest.cpp | 2 -- tests/testdate.h | 2 ++ tests/testprec.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 3437040b1f..8069c4d845 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -24,8 +24,6 @@ #include "wx/wxcrt.h" // for wxStrstr() -#include "testdate.h" - // to test Today() meaningfully we must be able to change the system date which // is not usually the case, but if we're under Win32 we can try it -- define // the macro below to do it diff --git a/tests/testdate.h b/tests/testdate.h index 674a3e41b6..dba0b0f74a 100644 --- a/tests/testdate.h +++ b/tests/testdate.h @@ -11,6 +11,8 @@ #include "wx/datetime.h" +#include + // need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateTime objects inline std::ostream& operator<<(std::ostream& ostr, const wxDateTime& dt) { diff --git a/tests/testprec.h b/tests/testprec.h index f5661446ed..03f5f624ce 100644 --- a/tests/testprec.h +++ b/tests/testprec.h @@ -4,6 +4,10 @@ #include "wx/wxprec.h" #include "wx/stopwatch.h" #include "wx/evtloop.h" + +// This needs to be included before catch.hpp to be taken into account. +#include "testdate.h" + #include "wx/catch_cppunit.h" // Custom test macro that is only defined when wxUIActionSimulator is available