11/*
2- * Catch v1.9.1
3- * Generated: 2017-04-09 21:21:06.285364
2+ * Catch v1.9.2
3+ * Generated: 2017-04-25 10:41:53.040184
44 * ----------------------------------------------------------
55 * This file has been merged from multiple headers. Please don't edit it directly
66 * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
136136#endif // __clang__
137137
138138// //////////////////////////////////////////////////////////////////////////////
139- // Cygwin
140- #ifdef __CYGWIN__
139+ // We know some environments not to support full POSIX signals
140+ #if defined( __CYGWIN__) || defined(__QNX__)
141141
142142# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
143143# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
144144# endif
145145
146+ #endif
147+
148+ // //////////////////////////////////////////////////////////////////////////////
149+ // Cygwin
150+ #ifdef __CYGWIN__
151+
146152// Required for some versions of Cygwin to declare gettimeofday
147153// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
148154# define _BSD_SOURCE
@@ -2397,14 +2403,19 @@ namespace Catch {
23972403// #included from: catch_timer.h
23982404#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
23992405
2400- #ifdef CATCH_PLATFORM_WINDOWS
2401- typedef unsigned long long uint64_t ;
2406+ #ifdef _MSC_VER
2407+
2408+ namespace Catch {
2409+ typedef unsigned long long UInt64;
2410+ }
24022411#else
24032412#include < stdint.h>
2413+ namespace Catch {
2414+ typedef uint64_t UInt64;
2415+ }
24042416#endif
24052417
24062418namespace Catch {
2407-
24082419 class Timer {
24092420 public:
24102421 Timer () : m_ticks( 0 ) {}
@@ -2414,7 +2425,7 @@ namespace Catch {
24142425 double getElapsedSeconds () const ;
24152426
24162427 private:
2417- uint64_t m_ticks;
2428+ UInt64 m_ticks;
24182429 };
24192430
24202431} // namespace Catch
@@ -2769,16 +2780,17 @@ namespace Detail {
27692780 return Approx ( 0 );
27702781 }
27712782
2772- Approx operator ()( double value ) {
2773- Approx approx ( value );
2783+ #if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS)
2784+
2785+ template <typename T, typename = typename std::enable_if<std::is_constructible<double , T>::value>::type>
2786+ Approx operator ()( T value ) {
2787+ Approx approx ( static_cast <double >(value) );
27742788 approx.epsilon ( m_epsilon );
27752789 approx.margin ( m_margin );
27762790 approx.scale ( m_scale );
27772791 return approx;
27782792 }
27792793
2780- #if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS)
2781-
27822794 template <typename T, typename = typename std::enable_if<std::is_constructible<double , T>::value>::type>
27832795 explicit Approx ( T value ): Approx(static_cast <double >(value))
27842796 {}
@@ -2828,7 +2840,35 @@ namespace Detail {
28282840 friend bool operator >= ( Approx const & lhs, T rhs ) {
28292841 return lhs.m_value > double (rhs) || lhs == rhs;
28302842 }
2843+
2844+ template <typename T, typename = typename std::enable_if<std::is_constructible<double , T>::value>::type>
2845+ Approx& epsilon ( T newEpsilon ) {
2846+ m_epsilon = double (newEpsilon);
2847+ return *this ;
2848+ }
2849+
2850+ template <typename T, typename = typename std::enable_if<std::is_constructible<double , T>::value>::type>
2851+ Approx& margin ( T newMargin ) {
2852+ m_margin = double (newMargin);
2853+ return *this ;
2854+ }
2855+
2856+ template <typename T, typename = typename std::enable_if<std::is_constructible<double , T>::value>::type>
2857+ Approx& scale ( T newScale ) {
2858+ m_scale = double (newScale);
2859+ return *this ;
2860+ }
2861+
28312862#else
2863+
2864+ Approx operator ()( double value ) {
2865+ Approx approx ( value );
2866+ approx.epsilon ( m_epsilon );
2867+ approx.margin ( m_margin );
2868+ approx.scale ( m_scale );
2869+ return approx;
2870+ }
2871+
28322872 friend bool operator == ( double lhs, Approx const & rhs ) {
28332873 // Thanks to Richard Harris for his help refining this formula
28342874 bool relativeOK = std::fabs ( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs (lhs), std::fabs (rhs.m_value ) ) );
@@ -2865,7 +2905,6 @@ namespace Detail {
28652905 friend bool operator >= ( Approx const & lhs, double rhs ) {
28662906 return lhs.m_value > rhs || lhs == rhs;
28672907 }
2868- #endif
28692908
28702909 Approx& epsilon ( double newEpsilon ) {
28712910 m_epsilon = newEpsilon;
@@ -2881,6 +2920,7 @@ namespace Detail {
28812920 m_scale = newScale;
28822921 return *this ;
28832922 }
2923+ #endif
28842924
28852925 std::string toString () const {
28862926 std::ostringstream oss;
@@ -3133,8 +3173,18 @@ namespace Catch {
31333173 }
31343174
31353175 private:
3136- T* nullableValue;
3137- char storage[sizeof (T)];
3176+ T *nullableValue;
3177+ union {
3178+ char storage[sizeof (T)];
3179+
3180+ // These are here to force alignment for the storage
3181+ long double dummy1;
3182+ void (*dummy2)();
3183+ long double dummy3;
3184+ #ifdef CATCH_CONFIG_CPP11_LONG_LONG
3185+ long long dummy4;
3186+ #endif
3187+ };
31383188 };
31393189
31403190} // end namespace Catch
@@ -8232,7 +8282,7 @@ namespace Catch {
82328282 }
82338283
82348284 inline Version libraryVersion () {
8235- static Version version ( 1 , 9 , 1 , " " , 0 );
8285+ static Version version ( 1 , 9 , 2 , " " , 0 );
82368286 return version;
82378287 }
82388288
@@ -10218,7 +10268,8 @@ namespace Catch {
1021810268 public:
1021910269 JunitReporter ( ReporterConfig const & _config )
1022010270 : CumulativeReporterBase( _config ),
10221- xml ( _config.stream() )
10271+ xml ( _config.stream() ),
10272+ m_okToFail( false )
1022210273 {
1022310274 m_reporterPrefs.shouldRedirectStdOut = true ;
1022410275 }
@@ -10244,8 +10295,11 @@ namespace Catch {
1024410295 CumulativeReporterBase::testGroupStarting ( groupInfo );
1024510296 }
1024610297
10298+ virtual void testCaseStarting ( TestCaseInfo const & testCaseInfo ) CATCH_OVERRIDE {
10299+ m_okToFail = testCaseInfo.okToFail ();
10300+ }
1024710301 virtual bool assertionEnded ( AssertionStats const & assertionStats ) CATCH_OVERRIDE {
10248- if ( assertionStats.assertionResult .getResultType () == ResultWas::ThrewException )
10302+ if ( assertionStats.assertionResult .getResultType () == ResultWas::ThrewException && !m_okToFail )
1024910303 unexpectedExceptions++;
1025010304 return CumulativeReporterBase::assertionEnded ( assertionStats );
1025110305 }
@@ -10410,6 +10464,7 @@ namespace Catch {
1041010464 std::ostringstream stdOutForSuite;
1041110465 std::ostringstream stdErrForSuite;
1041210466 unsigned int unexpectedExceptions;
10467+ bool m_okToFail;
1041310468 };
1041410469
1041510470 INTERNAL_CATCH_REGISTER_REPORTER ( " junit" , JunitReporter )
0 commit comments