1
1
/*
2
- * Catch v1.5.9
3
- * Generated: 2016-11-29 12:14:38.049276
2
+ * Catch v1.6.0
3
+ * Generated: 2017-01-11 16:38:09.405017
4
4
* ----------------------------------------------------------
5
5
* This file has been merged from multiple headers. Please don't edit it directly
6
6
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
60
60
// #included from: catch_common.h
61
61
#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
62
62
63
- #define INTERNAL_CATCH_UNIQUE_NAME_LINE2 ( name, line ) name##line
64
- #define INTERNAL_CATCH_UNIQUE_NAME_LINE ( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
65
- #ifdef CATCH_CONFIG_COUNTER
66
- # define INTERNAL_CATCH_UNIQUE_NAME ( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
67
- #else
68
- # define INTERNAL_CATCH_UNIQUE_NAME ( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
69
- #endif
70
-
71
- #define INTERNAL_CATCH_STRINGIFY2 ( expr ) #expr
72
- #define INTERNAL_CATCH_STRINGIFY ( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
73
-
74
- #include < sstream>
75
- #include < stdexcept>
76
- #include < algorithm>
77
-
78
63
// #included from: catch_compiler_capabilities.h
79
64
#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
80
65
181
166
#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
182
167
#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
183
168
#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
169
+ #define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
184
170
#endif
185
171
186
172
#endif // _MSC_VER
246
232
# if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
247
233
# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
248
234
# endif
235
+ # if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE)
236
+ # define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
237
+ # endif
249
238
250
239
#endif // __cplusplus >= 201103L
251
240
268
257
#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS)
269
258
# define CATCH_CONFIG_VARIADIC_MACROS
270
259
#endif
271
- #if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_LONG_LONG ) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11)
260
+ #if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG ) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11)
272
261
# define CATCH_CONFIG_CPP11_LONG_LONG
273
262
#endif
274
- #if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_OVERRIDE ) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11)
263
+ #if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE ) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11)
275
264
# define CATCH_CONFIG_CPP11_OVERRIDE
276
265
#endif
277
- #if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_UNIQUE_PTR ) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
266
+ #if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR ) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
278
267
# define CATCH_CONFIG_CPP11_UNIQUE_PTR
279
268
#endif
280
269
#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
281
270
# define CATCH_CONFIG_COUNTER
282
271
#endif
272
+ #if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11)
273
+ # define CATCH_CONFIG_CPP11_SHUFFLE
274
+ #endif
283
275
284
276
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
285
277
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
315
307
# define CATCH_AUTO_PTR ( T ) std::auto_ptr<T>
316
308
#endif
317
309
310
+ #define INTERNAL_CATCH_UNIQUE_NAME_LINE2 ( name, line ) name##line
311
+ #define INTERNAL_CATCH_UNIQUE_NAME_LINE ( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
312
+ #ifdef CATCH_CONFIG_COUNTER
313
+ # define INTERNAL_CATCH_UNIQUE_NAME ( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
314
+ #else
315
+ # define INTERNAL_CATCH_UNIQUE_NAME ( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
316
+ #endif
317
+
318
+ #define INTERNAL_CATCH_STRINGIFY2 ( expr ) #expr
319
+ #define INTERNAL_CATCH_STRINGIFY ( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
320
+
321
+ #include < sstream>
322
+ #include < stdexcept>
323
+ #include < algorithm>
324
+
318
325
namespace Catch {
319
326
320
327
struct IConfig ;
@@ -2668,6 +2675,26 @@ namespace Detail {
2668
2675
return !operator ==( rhs, lhs );
2669
2676
}
2670
2677
2678
+ friend bool operator <= ( double lhs, Approx const & rhs )
2679
+ {
2680
+ return lhs < rhs.m_value || lhs == rhs;
2681
+ }
2682
+
2683
+ friend bool operator <= ( Approx const & lhs, double rhs )
2684
+ {
2685
+ return lhs.m_value < rhs || lhs == rhs;
2686
+ }
2687
+
2688
+ friend bool operator >= ( double lhs, Approx const & rhs )
2689
+ {
2690
+ return lhs > rhs.m_value || lhs == rhs;
2691
+ }
2692
+
2693
+ friend bool operator >= ( Approx const & lhs, double rhs )
2694
+ {
2695
+ return lhs.m_value > rhs || lhs == rhs;
2696
+ }
2697
+
2671
2698
Approx& epsilon ( double newEpsilon ) {
2672
2699
m_epsilon = newEpsilon;
2673
2700
return *this ;
@@ -3257,11 +3284,12 @@ namespace Catch {
3257
3284
namespace Catch {
3258
3285
3259
3286
class TestSpecParser {
3260
- enum Mode{ None, Name, QuotedName, Tag };
3287
+ enum Mode{ None, Name, QuotedName, Tag, EscapedName };
3261
3288
Mode m_mode;
3262
3289
bool m_exclusion;
3263
3290
std::size_t m_start, m_pos;
3264
3291
std::string m_arg;
3292
+ std::vector<std::size_t > m_escapeChars;
3265
3293
TestSpec::Filter m_currentFilter;
3266
3294
TestSpec m_testSpec;
3267
3295
ITagAliasRegistry const * m_tagAliases;
@@ -3274,6 +3302,7 @@ namespace Catch {
3274
3302
m_exclusion = false ;
3275
3303
m_start = std::string::npos;
3276
3304
m_arg = m_tagAliases->expandAliases ( arg );
3305
+ m_escapeChars.clear ();
3277
3306
for ( m_pos = 0 ; m_pos < m_arg.size (); ++m_pos )
3278
3307
visitChar ( m_arg[m_pos] );
3279
3308
if ( m_mode == Name )
@@ -3292,6 +3321,7 @@ namespace Catch {
3292
3321
case ' ~' : m_exclusion = true ; return ;
3293
3322
case ' [' : return startNewMode ( Tag, ++m_pos );
3294
3323
case ' "' : return startNewMode ( QuotedName, ++m_pos );
3324
+ case ' \\ ' : return escape ();
3295
3325
default : startNewMode ( Name, m_pos ); break ;
3296
3326
}
3297
3327
}
@@ -3307,7 +3337,11 @@ namespace Catch {
3307
3337
addPattern<TestSpec::NamePattern>();
3308
3338
startNewMode ( Tag, ++m_pos );
3309
3339
}
3340
+ else if ( c == ' \\ ' )
3341
+ escape ();
3310
3342
}
3343
+ else if ( m_mode == EscapedName )
3344
+ m_mode = Name;
3311
3345
else if ( m_mode == QuotedName && c == ' "' )
3312
3346
addPattern<TestSpec::NamePattern>();
3313
3347
else if ( m_mode == Tag && c == ' ]' )
@@ -3317,10 +3351,17 @@ namespace Catch {
3317
3351
m_mode = mode;
3318
3352
m_start = start;
3319
3353
}
3354
+ void escape () {
3355
+ m_mode = EscapedName;
3356
+ m_escapeChars.push_back ( m_pos );
3357
+ }
3320
3358
std::string subString () const { return m_arg.substr ( m_start, m_pos - m_start ); }
3321
3359
template <typename T>
3322
3360
void addPattern () {
3323
3361
std::string token = subString ();
3362
+ for ( size_t i = 0 ; i < m_escapeChars.size (); ++i )
3363
+ token = token.substr ( 0 , m_escapeChars[i] ) + token.substr ( m_escapeChars[i]+1 );
3364
+ m_escapeChars.clear ();
3324
3365
if ( startsWith ( token, " exclude:" ) ) {
3325
3366
m_exclusion = true ;
3326
3367
token = token.substr ( 8 );
@@ -6458,26 +6499,22 @@ namespace Catch {
6458
6499
#include < iostream>
6459
6500
#include < algorithm>
6460
6501
6461
- #ifdef CATCH_CPP14_OR_GREATER
6462
- #include < random>
6463
- #endif
6464
-
6465
6502
namespace Catch {
6466
6503
6467
6504
struct RandomNumberGenerator {
6468
6505
typedef std::ptrdiff_t result_type;
6469
6506
6470
6507
result_type operator ()( result_type n ) const { return std::rand () % n; }
6471
6508
6472
- #ifdef CATCH_CPP14_OR_GREATER
6509
+ #ifdef CATCH_CONFIG_CPP11_SHUFFLE
6473
6510
static constexpr result_type min () { return 0 ; }
6474
6511
static constexpr result_type max () { return 1000000 ; }
6475
6512
result_type operator ()() const { return std::rand () % max (); }
6476
6513
#endif
6477
6514
template <typename V>
6478
6515
static void shuffle ( V& vector ) {
6479
6516
RandomNumberGenerator rng;
6480
- #ifdef CATCH_CPP14_OR_GREATER
6517
+ #ifdef CATCH_CONFIG_CPP11_SHUFFLE
6481
6518
std::shuffle ( vector.begin (), vector.end (), rng );
6482
6519
#else
6483
6520
std::random_shuffle ( vector.begin (), vector.end (), rng );
@@ -7147,7 +7184,7 @@ namespace {
7147
7184
case Colour::White: return setColour ( " [0m" );
7148
7185
case Colour::Red: return setColour ( " [0;31m" );
7149
7186
case Colour::Green: return setColour ( " [0;32m" );
7150
- case Colour::Blue: return setColour ( " [0: 34m" );
7187
+ case Colour::Blue: return setColour ( " [0; 34m" );
7151
7188
case Colour::Cyan: return setColour ( " [0;36m" );
7152
7189
case Colour::Yellow: return setColour ( " [0;33m" );
7153
7190
case Colour::Grey: return setColour ( " [1;30m" );
@@ -7582,7 +7619,7 @@ namespace Catch {
7582
7619
return os;
7583
7620
}
7584
7621
7585
- Version libraryVersion ( 1 , 5 , 9 , " " , 0 );
7622
+ Version libraryVersion ( 1 , 6 , 0 , " " , 0 );
7586
7623
7587
7624
}
7588
7625
@@ -8349,7 +8386,7 @@ namespace Catch {
8349
8386
}
8350
8387
std::string ResultBuilder::reconstructExpression () const {
8351
8388
if ( m_exprComponents.op == " " )
8352
- return m_exprComponents.lhs .empty () ? m_assertionInfo.capturedExpression : m_exprComponents.op + m_exprComponents. lhs ;
8389
+ return m_exprComponents.lhs .empty () ? m_assertionInfo.capturedExpression : m_exprComponents.lhs ;
8353
8390
else if ( m_exprComponents.op == " matches" )
8354
8391
return m_exprComponents.lhs + " " + m_exprComponents.rhs ;
8355
8392
else if ( m_exprComponents.op != " !" ) {
@@ -8967,7 +9004,7 @@ namespace Catch {
8967
9004
default :
8968
9005
// Escape control chars - based on contribution by @espenalb in PR #465 and
8969
9006
// by @mrpi PR #588
8970
- if ( ( c < ' \x09 ' ) || ( c > ' \x0D ' && c < ' \x20 ' ) || c==' \x7F ' )
9007
+ if ( ( c >= 0 && c < ' \x09 ' ) || ( c > ' \x0D ' && c < ' \x20 ' ) || c==' \x7F ' )
8971
9008
os << " &#x" << std::uppercase << std::hex << std::setfill (' 0' ) << std::setw (2 ) << static_cast <int >( c ) << ' ;' ;
8972
9009
else
8973
9010
os << c;
@@ -10400,7 +10437,7 @@ int main (int argc, char * const argv[]) {
10400
10437
#define CATCH_CHECKED_ELSE ( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, " CATCH_CHECKED_ELSE" )
10401
10438
#define CATCH_CHECK_NOFAIL ( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, " CATCH_CHECK_NOFAIL" )
10402
10439
10403
- #define CATCH_CHECK_THROWS ( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, " CATCH_CHECK_THROWS" )
10440
+ #define CATCH_CHECK_THROWS ( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, " " , " CATCH_CHECK_THROWS" )
10404
10441
#define CATCH_CHECK_THROWS_AS ( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, " CATCH_CHECK_THROWS_AS" )
10405
10442
#define CATCH_CHECK_THROWS_WITH ( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, matcher, " CATCH_CHECK_THROWS_WITH" )
10406
10443
#define CATCH_CHECK_NOTHROW ( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, " CATCH_CHECK_NOTHROW" )
0 commit comments