File Coverage

/usr/local/lib/perl5/site_perl/5.26.1/XS/libcatch.x/i/catch.hpp
Criterion Covered Total %
statement 22 46 47.8
branch 13 72 18.0
condition n/a
subroutine n/a
pod n/a
total 35 118 29.6


line stmt bran cond sub pod time code
1             /*
2             * Catch v2.12.1
3             * Generated: 2020-04-21 19:29:20.964532
4             * ----------------------------------------------------------
5             * This file has been merged from multiple headers. Please don't edit it directly
6             * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
7             *
8             * Distributed under the Boost Software License, Version 1.0. (See accompanying
9             * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10             */
11             #ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
12             #define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
13             // start catch.hpp
14              
15              
16             #define CATCH_VERSION_MAJOR 2
17             #define CATCH_VERSION_MINOR 12
18             #define CATCH_VERSION_PATCH 1
19              
20             #ifdef __clang__
21             # pragma clang system_header
22             #elif defined __GNUC__
23             # pragma GCC system_header
24             #endif
25              
26             // start catch_suppress_warnings.h
27              
28             #ifdef __clang__
29             # ifdef __ICC // icpc defines the __clang__ macro
30             # pragma warning(push)
31             # pragma warning(disable: 161 1682)
32             # else // __ICC
33             # pragma clang diagnostic push
34             # pragma clang diagnostic ignored "-Wpadded"
35             # pragma clang diagnostic ignored "-Wswitch-enum"
36             # pragma clang diagnostic ignored "-Wcovered-switch-default"
37             # endif
38             #elif defined __GNUC__
39             // Because REQUIREs trigger GCC's -Wparentheses, and because still
40             // supported version of g++ have only buggy support for _Pragmas,
41             // Wparentheses have to be suppressed globally.
42             # pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details
43              
44             # pragma GCC diagnostic push
45             # pragma GCC diagnostic ignored "-Wunused-variable"
46             # pragma GCC diagnostic ignored "-Wpadded"
47             #endif
48             // end catch_suppress_warnings.h
49             #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
50             # define CATCH_IMPL
51             # define CATCH_CONFIG_ALL_PARTS
52             #endif
53              
54             // In the impl file, we want to have access to all parts of the headers
55             // Can also be used to sanely support PCHs
56             #if defined(CATCH_CONFIG_ALL_PARTS)
57             # define CATCH_CONFIG_EXTERNAL_INTERFACES
58             # if defined(CATCH_CONFIG_DISABLE_MATCHERS)
59             # undef CATCH_CONFIG_DISABLE_MATCHERS
60             # endif
61             # if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
62             # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
63             # endif
64             #endif
65              
66             #if !defined(CATCH_CONFIG_IMPL_ONLY)
67             // start catch_platform.h
68              
69             #ifdef __APPLE__
70             # include
71             # if TARGET_OS_OSX == 1
72             # define CATCH_PLATFORM_MAC
73             # elif TARGET_OS_IPHONE == 1
74             # define CATCH_PLATFORM_IPHONE
75             # endif
76              
77             #elif defined(linux) || defined(__linux) || defined(__linux__)
78             # define CATCH_PLATFORM_LINUX
79              
80             #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
81             # define CATCH_PLATFORM_WINDOWS
82             #endif
83              
84             // end catch_platform.h
85              
86             #ifdef CATCH_IMPL
87             # ifndef CLARA_CONFIG_MAIN
88             # define CLARA_CONFIG_MAIN_NOT_DEFINED
89             # define CLARA_CONFIG_MAIN
90             # endif
91             #endif
92              
93             // start catch_user_interfaces.h
94              
95             namespace Catch {
96             unsigned int rngSeed();
97             }
98              
99             // end catch_user_interfaces.h
100             // start catch_tag_alias_autoregistrar.h
101              
102             // start catch_common.h
103              
104             // start catch_compiler_capabilities.h
105              
106             // Detect a number of compiler features - by compiler
107             // The following features are defined:
108             //
109             // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
110             // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
111             // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
112             // CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
113             // ****************
114             // Note to maintainers: if new toggles are added please document them
115             // in configuration.md, too
116             // ****************
117              
118             // In general each macro has a _NO_ form
119             // (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
120             // Many features, at point of detection, define an _INTERNAL_ macro, so they
121             // can be combined, en-mass, with the _NO_ forms later.
122              
123             #ifdef __cplusplus
124              
125             # if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
126             # define CATCH_CPP14_OR_GREATER
127             # endif
128              
129             # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
130             # define CATCH_CPP17_OR_GREATER
131             # endif
132              
133             #endif
134              
135             #if defined(__cpp_lib_uncaught_exceptions)
136             # define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
137             #endif
138              
139             // We have to avoid both ICC and Clang, because they try to mask themselves
140             // as gcc, and we want only GCC in this block
141             #if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
142             # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
143             # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
144              
145             # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
146              
147             #endif
148              
149             #if defined(__clang__)
150              
151             # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
152             # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
153              
154             // As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
155             // which results in calls to destructors being emitted for each temporary,
156             // without a matching initialization. In practice, this can result in something
157             // like `std::string::~string` being called on an uninitialized value.
158             //
159             // For example, this code will likely segfault under IBM XL:
160             // ```
161             // REQUIRE(std::string("12") + "34" == "1234")
162             // ```
163             //
164             // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
165             # if !defined(__ibmxl__)
166             # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg) */
167             # endif
168              
169             # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
170             _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
171             _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
172              
173             # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
174             _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
175              
176             # define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
177             _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
178              
179             # define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
180             _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
181              
182             # define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
183             _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
184              
185             #endif // __clang__
186              
187             ////////////////////////////////////////////////////////////////////////////////
188             // Assume that non-Windows platforms support posix signals by default
189             #if !defined(CATCH_PLATFORM_WINDOWS)
190             #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
191             #endif
192              
193             ////////////////////////////////////////////////////////////////////////////////
194             // We know some environments not to support full POSIX signals
195             #if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
196             #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
197             #endif
198              
199             #ifdef __OS400__
200             # define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
201             # define CATCH_CONFIG_COLOUR_NONE
202             #endif
203              
204             ////////////////////////////////////////////////////////////////////////////////
205             // Android somehow still does not support std::to_string
206             #if defined(__ANDROID__)
207             # define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
208             # define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
209             #endif
210              
211             ////////////////////////////////////////////////////////////////////////////////
212             // Not all Windows environments support SEH properly
213             #if defined(__MINGW32__)
214             # define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
215             #endif
216              
217             ////////////////////////////////////////////////////////////////////////////////
218             // PS4
219             #if defined(__ORBIS__)
220             # define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
221             #endif
222              
223             ////////////////////////////////////////////////////////////////////////////////
224             // Cygwin
225             #ifdef __CYGWIN__
226              
227             // Required for some versions of Cygwin to declare gettimeofday
228             // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
229             # define _BSD_SOURCE
230             // some versions of cygwin (most) do not support std::to_string. Use the libstd check.
231             // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
232             # if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
233             && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
234              
235             # define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
236              
237             # endif
238             #endif // __CYGWIN__
239              
240             ////////////////////////////////////////////////////////////////////////////////
241             // Visual C++
242             #if defined(_MSC_VER)
243              
244             # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
245             # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
246              
247             # if _MSC_VER >= 1900 // Visual Studio 2015 or newer
248             # define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
249             # endif
250              
251             // Universal Windows platform does not support SEH
252             // Or console colours (or console at all...)
253             # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
254             # define CATCH_CONFIG_COLOUR_NONE
255             # else
256             # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
257             # endif
258              
259             // MSVC traditional preprocessor needs some workaround for __VA_ARGS__
260             // _MSVC_TRADITIONAL == 0 means new conformant preprocessor
261             // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
262             # if !defined(__clang__) // Handle Clang masquerading for msvc
263             # if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
264             # define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
265             # endif // MSVC_TRADITIONAL
266             # endif // __clang__
267              
268             #endif // _MSC_VER
269              
270             #if defined(_REENTRANT) || defined(_MSC_VER)
271             // Enable async processing, as -pthread is specified or no additional linking is required
272             # define CATCH_INTERNAL_CONFIG_USE_ASYNC
273             #endif // _MSC_VER
274              
275             ////////////////////////////////////////////////////////////////////////////////
276             // Check if we are compiled with -fno-exceptions or equivalent
277             #if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
278             # define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
279             #endif
280              
281             ////////////////////////////////////////////////////////////////////////////////
282             // DJGPP
283             #ifdef __DJGPP__
284             # define CATCH_INTERNAL_CONFIG_NO_WCHAR
285             #endif // __DJGPP__
286              
287             ////////////////////////////////////////////////////////////////////////////////
288             // Embarcadero C++Build
289             #if defined(__BORLANDC__)
290             #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
291             #endif
292              
293             ////////////////////////////////////////////////////////////////////////////////
294              
295             // Use of __COUNTER__ is suppressed during code analysis in
296             // CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
297             // handled by it.
298             // Otherwise all supported compilers support COUNTER macro,
299             // but user still might want to turn it off
300             #if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
301             #define CATCH_INTERNAL_CONFIG_COUNTER
302             #endif
303              
304             ////////////////////////////////////////////////////////////////////////////////
305              
306             // RTX is a special version of Windows that is real time.
307             // This means that it is detected as Windows, but does not provide
308             // the same set of capabilities as real Windows does.
309             #if defined(UNDER_RTSS) || defined(RTX64_BUILD)
310             #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
311             #define CATCH_INTERNAL_CONFIG_NO_ASYNC
312             #define CATCH_CONFIG_COLOUR_NONE
313             #endif
314              
315             #if !defined(_GLIBCXX_USE_C99_MATH_TR1)
316             #define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
317             #endif
318              
319             // Various stdlib support checks that require __has_include
320             #if defined(__has_include)
321             // Check if string_view is available and usable
322             #if __has_include() && defined(CATCH_CPP17_OR_GREATER)
323             # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
324             #endif
325              
326             // Check if optional is available and usable
327             # if __has_include() && defined(CATCH_CPP17_OR_GREATER)
328             # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
329             # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER)
330              
331             // Check if byte is available and usable
332             # if __has_include() && defined(CATCH_CPP17_OR_GREATER)
333             # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
334             # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER)
335              
336             // Check if variant is available and usable
337             # if __has_include() && defined(CATCH_CPP17_OR_GREATER)
338             # if defined(__clang__) && (__clang_major__ < 8)
339             // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
340             // fix should be in clang 8, workaround in libstdc++ 8.2
341             # include
342             # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
343             # define CATCH_CONFIG_NO_CPP17_VARIANT
344             # else
345             # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
346             # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
347             # else
348             # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
349             # endif // defined(__clang__) && (__clang_major__ < 8)
350             # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER)
351             #endif // defined(__has_include)
352              
353             #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
354             # define CATCH_CONFIG_COUNTER
355             #endif
356             #if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
357             # define CATCH_CONFIG_WINDOWS_SEH
358             #endif
359             // This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
360             #if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
361             # define CATCH_CONFIG_POSIX_SIGNALS
362             #endif
363             // This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
364             #if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
365             # define CATCH_CONFIG_WCHAR
366             #endif
367              
368             #if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
369             # define CATCH_CONFIG_CPP11_TO_STRING
370             #endif
371              
372             #if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
373             # define CATCH_CONFIG_CPP17_OPTIONAL
374             #endif
375              
376             #if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
377             # define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
378             #endif
379              
380             #if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
381             # define CATCH_CONFIG_CPP17_STRING_VIEW
382             #endif
383              
384             #if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
385             # define CATCH_CONFIG_CPP17_VARIANT
386             #endif
387              
388             #if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
389             # define CATCH_CONFIG_CPP17_BYTE
390             #endif
391              
392             #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
393             # define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
394             #endif
395              
396             #if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
397             # define CATCH_CONFIG_NEW_CAPTURE
398             #endif
399              
400             #if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
401             # define CATCH_CONFIG_DISABLE_EXCEPTIONS
402             #endif
403              
404             #if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
405             # define CATCH_CONFIG_POLYFILL_ISNAN
406             #endif
407              
408             #if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
409             # define CATCH_CONFIG_USE_ASYNC
410             #endif
411              
412             #if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE)
413             # define CATCH_CONFIG_ANDROID_LOGWRITE
414             #endif
415              
416             #if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
417             # define CATCH_CONFIG_GLOBAL_NEXTAFTER
418             #endif
419              
420             // Even if we do not think the compiler has that warning, we still have
421             // to provide a macro that can be used by the code.
422             #if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
423             # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
424             #endif
425             #if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
426             # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
427             #endif
428             #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
429             # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
430             #endif
431             #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
432             # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
433             #endif
434             #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS)
435             # define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS
436             #endif
437             #if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
438             # define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
439             #endif
440              
441             // The goal of this macro is to avoid evaluation of the arguments, but
442             // still have the compiler warn on problems inside...
443             #if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
444             # define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
445             #endif
446              
447             #if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
448             # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
449             #elif defined(__clang__) && (__clang_major__ < 5)
450             # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
451             #endif
452              
453             #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
454             # define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
455             #endif
456              
457             #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
458             #define CATCH_TRY if ((true))
459             #define CATCH_CATCH_ALL if ((false))
460             #define CATCH_CATCH_ANON(type) if ((false))
461             #else
462             #define CATCH_TRY try
463             #define CATCH_CATCH_ALL catch (...)
464             #define CATCH_CATCH_ANON(type) catch (type)
465             #endif
466              
467             #if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
468             #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
469             #endif
470              
471             // end catch_compiler_capabilities.h
472             #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
473             #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
474             #ifdef CATCH_CONFIG_COUNTER
475             # define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
476             #else
477             # define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
478             #endif
479              
480             #include
481             #include
482             #include
483              
484             // We need a dummy global operator<< so we can bring it into Catch namespace later
485             struct Catch_global_namespace_dummy {};
486             std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
487              
488             namespace Catch {
489              
490             struct CaseSensitive { enum Choice {
491             Yes,
492             No
493             }; };
494              
495             class NonCopyable {
496             NonCopyable( NonCopyable const& ) = delete;
497             NonCopyable( NonCopyable && ) = delete;
498             NonCopyable& operator = ( NonCopyable const& ) = delete;
499             NonCopyable& operator = ( NonCopyable && ) = delete;
500              
501             protected:
502             NonCopyable();
503             virtual ~NonCopyable();
504             };
505              
506             struct SourceLineInfo {
507              
508             SourceLineInfo() = delete;
509 0           SourceLineInfo( char const* _file, std::size_t _line ) noexcept
510             : file( _file ),
511 0           line( _line )
512 0           {}
513              
514             SourceLineInfo( SourceLineInfo const& other ) = default;
515             SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
516             SourceLineInfo( SourceLineInfo&& ) noexcept = default;
517             SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
518              
519             bool empty() const noexcept { return file[0] == '\0'; }
520             bool operator == ( SourceLineInfo const& other ) const noexcept;
521             bool operator < ( SourceLineInfo const& other ) const noexcept;
522              
523             char const* file;
524             std::size_t line;
525             };
526              
527             std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
528              
529             // Bring in operator<< from global namespace into Catch namespace
530             // This is necessary because the overload of operator<< above makes
531             // lookup stop at namespace Catch
532             using ::operator<<;
533              
534             // Use this in variadic streaming macros to allow
535             // >> +StreamEndStop
536             // as well as
537             // >> stuff +StreamEndStop
538             struct StreamEndStop {
539             std::string operator+() const;
540             };
541             template
542             T const& operator + ( T const& value, StreamEndStop ) {
543             return value;
544             }
545             }
546              
547             #define CATCH_INTERNAL_LINEINFO \
548             ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) )
549              
550             // end catch_common.h
551             namespace Catch {
552              
553             struct RegistrarForTagAliases {
554             RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
555             };
556              
557             } // end namespace Catch
558              
559             #define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
560             CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
561             CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
562             namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
563             CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
564              
565             // end catch_tag_alias_autoregistrar.h
566             // start catch_test_registry.h
567              
568             // start catch_interfaces_testcase.h
569              
570             #include
571              
572             namespace Catch {
573              
574             class TestSpec;
575              
576             struct ITestInvoker {
577             virtual void invoke () const = 0;
578             virtual ~ITestInvoker();
579             };
580              
581             class TestCase;
582             struct IConfig;
583              
584             struct ITestCaseRegistry {
585             virtual ~ITestCaseRegistry();
586             virtual std::vector const& getAllTests() const = 0;
587             virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0;
588             };
589              
590             bool isThrowSafe( TestCase const& testCase, IConfig const& config );
591             bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
592             std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config );
593             std::vector const& getAllTestCasesSorted( IConfig const& config );
594              
595             }
596              
597             // end catch_interfaces_testcase.h
598             // start catch_stringref.h
599              
600             #include
601             #include
602             #include
603             #include
604              
605             namespace Catch {
606              
607             /// A non-owning string class (similar to the forthcoming std::string_view)
608             /// Note that, because a StringRef may be a substring of another string,
609             /// it may not be null terminated.
610             class StringRef {
611             public:
612             using size_type = std::size_t;
613             using const_iterator = const char*;
614              
615             private:
616             static constexpr char const* const s_empty = "";
617              
618             char const* m_start = s_empty;
619             size_type m_size = 0;
620              
621             public: // construction
622 0           constexpr StringRef() noexcept = default;
623              
624             StringRef( char const* rawChars ) noexcept;
625              
626 0           constexpr StringRef( char const* rawChars, size_type size ) noexcept
627             : m_start( rawChars ),
628 0           m_size( size )
629 0           {}
630              
631             StringRef( std::string const& stdString ) noexcept
632             : m_start( stdString.c_str() ),
633             m_size( stdString.size() )
634             {}
635              
636             explicit operator std::string() const {
637             return std::string(m_start, m_size);
638             }
639              
640             public: // operators
641             auto operator == ( StringRef const& other ) const noexcept -> bool;
642             auto operator != (StringRef const& other) const noexcept -> bool {
643             return !(*this == other);
644             }
645              
646             auto operator[] ( size_type index ) const noexcept -> char {
647             assert(index < m_size);
648             return m_start[index];
649             }
650              
651             public: // named queries
652             constexpr auto empty() const noexcept -> bool {
653             return m_size == 0;
654             }
655             constexpr auto size() const noexcept -> size_type {
656             return m_size;
657             }
658              
659             // Returns the current start pointer. If the StringRef is not
660             // null-terminated, throws std::domain_exception
661             auto c_str() const -> char const*;
662              
663             public: // substrings and searches
664             // Returns a substring of [start, start + length).
665             // If start + length > size(), then the substring is [start, size()).
666             // If start > size(), then the substring is empty.
667             auto substr( size_type start, size_type length ) const noexcept -> StringRef;
668              
669             // Returns the current start pointer. May not be null-terminated.
670             auto data() const noexcept -> char const*;
671              
672             constexpr auto isNullTerminated() const noexcept -> bool {
673             return m_start[m_size] == '\0';
674             }
675              
676             public: // iterators
677             constexpr const_iterator begin() const { return m_start; }
678             constexpr const_iterator end() const { return m_start + m_size; }
679             };
680              
681             auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
682             auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
683              
684             constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
685             return StringRef( rawChars, size );
686             }
687             } // namespace Catch
688              
689 0           constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
690 0           return Catch::StringRef( rawChars, size );
691             }
692              
693             // end catch_stringref.h
694             // start catch_preprocessor.hpp
695              
696              
697             #define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
698             #define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
699             #define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
700             #define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
701             #define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
702             #define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
703              
704             #ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
705             #define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
706             // MSVC needs more evaluations
707             #define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
708             #define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
709             #else
710             #define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
711             #endif
712              
713             #define CATCH_REC_END(...)
714             #define CATCH_REC_OUT
715              
716             #define CATCH_EMPTY()
717             #define CATCH_DEFER(id) id CATCH_EMPTY()
718              
719             #define CATCH_REC_GET_END2() 0, CATCH_REC_END
720             #define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
721             #define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
722             #define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
723             #define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
724             #define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
725              
726             #define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
727             #define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
728             #define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
729              
730             #define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
731             #define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ )
732             #define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
733              
734             // Applies the function macro `f` to each of the remaining parameters, inserts commas between the results,
735             // and passes userdata as the first parameter to each invocation,
736             // e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c)
737             #define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
738              
739             #define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
740              
741             #define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param)
742             #define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__
743             #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__
744             #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
745             #define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
746             #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
747             #define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
748             #define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
749             #else
750             // MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
751             #define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
752             #define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
753             #define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
754             #endif
755              
756             #define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
757             #define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
758              
759             #define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__)
760              
761             #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
762             #define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper())
763             #define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
764             #else
765             #define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper()))
766             #define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
767             #endif
768              
769             #define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
770             CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
771              
772             #define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
773             #define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
774             #define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
775             #define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
776             #define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
777             #define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
778             #define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6)
779             #define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
780             #define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
781             #define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
782             #define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)
783              
784             #define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
785              
786             #define INTERNAL_CATCH_TYPE_GEN\
787             template struct TypeList {};\
788             template\
789             constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\
790             template class...> struct TemplateTypeList{};\
791             template class...Cs>\
792             constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\
793             template\
794             struct append;\
795             template\
796             struct rewrap;\
797             template class, typename...>\
798             struct create;\
799             template class, typename>\
800             struct convert;\
801             \
802             template \
803             struct append { using type = T; };\
804             template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\
805             struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\
806             template< template class L1, typename...E1, typename...Rest>\
807             struct append, TypeList, Rest...> { using type = L1; };\
808             \
809             template< template class Container, template class List, typename...elems>\
810             struct rewrap, List> { using type = TypeList>; };\
811             template< template class Container, template class List, class...Elems, typename...Elements>\
812             struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\
813             \
814             template