| /* | /* | ||||
| * Catch v2.4.0 | |||||
| * Generated: 2018-09-04 11:55:01.682061 | |||||
| * Catch v2.4.1 | |||||
| * Generated: 2018-09-28 15:50:15.645795 | |||||
| * ---------------------------------------------------------- | * ---------------------------------------------------------- | ||||
| * This file has been merged from multiple headers. Please don't edit it directly | * This file has been merged from multiple headers. Please don't edit it directly | ||||
| * Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved. | * Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved. | ||||
| #define CATCH_VERSION_MAJOR 2 | #define CATCH_VERSION_MAJOR 2 | ||||
| #define CATCH_VERSION_MINOR 4 | #define CATCH_VERSION_MINOR 4 | ||||
| #define CATCH_VERSION_PATCH 0 | |||||
| #define CATCH_VERSION_PATCH 1 | |||||
| #ifdef __clang__ | #ifdef __clang__ | ||||
| # pragma clang system_header | # pragma clang system_header | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| # if __cplusplus >= 201402L | |||||
| # if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) | |||||
| # define CATCH_CPP14_OR_GREATER | # define CATCH_CPP14_OR_GREATER | ||||
| # endif | # endif | ||||
| # if __cplusplus >= 201703L | |||||
| # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) | |||||
| # define CATCH_CPP17_OR_GREATER | # define CATCH_CPP17_OR_GREATER | ||||
| # endif | # endif | ||||
| // Required for some versions of Cygwin to declare gettimeofday | // Required for some versions of Cygwin to declare gettimeofday | ||||
| // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin | // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin | ||||
| # define _BSD_SOURCE | # define _BSD_SOURCE | ||||
| // some versions of cygwin (most) do not support std::to_string. Use the libstd check. | |||||
| // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 | |||||
| # if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ | |||||
| && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) | |||||
| # define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING | |||||
| # endif | |||||
| #endif // __CYGWIN__ | #endif // __CYGWIN__ | ||||
| //////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// | ||||
| #define CATCH_INTERNAL_CONFIG_COUNTER | #define CATCH_INTERNAL_CONFIG_COUNTER | ||||
| #endif | #endif | ||||
| //////////////////////////////////////////////////////////////////////////////// | |||||
| // Check if string_view is available and usable | |||||
| // The check is split apart to work around v140 (VS2015) preprocessor issue... | |||||
| #if defined(__has_include) | |||||
| #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER) | |||||
| # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW | |||||
| #endif | |||||
| #endif | |||||
| //////////////////////////////////////////////////////////////////////////////// | |||||
| // Check if variant is available and usable | |||||
| #if defined(__has_include) | |||||
| # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER) | |||||
| # if defined(__clang__) && (__clang_major__ < 8) | |||||
| // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 | |||||
| // fix should be in clang 8, workaround in libstdc++ 8.2 | |||||
| # include <ciso646> | |||||
| # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) | |||||
| # define CATCH_CONFIG_NO_CPP17_VARIANT | |||||
| # else | |||||
| # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT | |||||
| # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) | |||||
| # endif // defined(__clang__) && (__clang_major__ < 8) | |||||
| # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER) | |||||
| #endif // __has_include | |||||
| #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) | #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) | ||||
| # define CATCH_CONFIG_COUNTER | # define CATCH_CONFIG_COUNTER | ||||
| #endif | #endif | ||||
| # define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS | # define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS | ||||
| #endif | #endif | ||||
| #if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) | |||||
| # define CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| #endif | |||||
| #if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) | |||||
| # define CATCH_CONFIG_CPP17_VARIANT | |||||
| #endif | |||||
| #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) | #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) | ||||
| # define CATCH_INTERNAL_CONFIG_NEW_CAPTURE | # define CATCH_INTERNAL_CONFIG_NEW_CAPTURE | ||||
| #endif | #endif | ||||
| // end catch_stream.h | // end catch_stream.h | ||||
| #ifdef CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| #include <string_view> | |||||
| #endif | |||||
| #ifdef __OBJC__ | #ifdef __OBJC__ | ||||
| // start catch_objc_arc.hpp | // start catch_objc_arc.hpp | ||||
| struct StringMaker<std::string> { | struct StringMaker<std::string> { | ||||
| static std::string convert(const std::string& str); | static std::string convert(const std::string& str); | ||||
| }; | }; | ||||
| #ifdef CATCH_CONFIG_WCHAR | |||||
| #ifdef CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| template<> | template<> | ||||
| struct StringMaker<std::wstring> { | |||||
| static std::string convert(const std::wstring& wstr); | |||||
| struct StringMaker<std::string_view> { | |||||
| static std::string convert(std::string_view str); | |||||
| }; | }; | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| #ifdef CATCH_CONFIG_WCHAR | #ifdef CATCH_CONFIG_WCHAR | ||||
| template<> | |||||
| struct StringMaker<std::wstring> { | |||||
| static std::string convert(const std::wstring& wstr); | |||||
| }; | |||||
| # ifdef CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| template<> | |||||
| struct StringMaker<std::wstring_view> { | |||||
| static std::string convert(std::wstring_view str); | |||||
| }; | |||||
| # endif | |||||
| template<> | template<> | ||||
| struct StringMaker<wchar_t const *> { | struct StringMaker<wchar_t const *> { | ||||
| static std::string convert(wchar_t const * str); | static std::string convert(wchar_t const * str); | ||||
| #if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS) | #if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS) | ||||
| # define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER | # define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER | ||||
| # define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER | # define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER | ||||
| # define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER | |||||
| # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER | # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER | #endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER | ||||
| #if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT) | |||||
| #include <variant> | |||||
| namespace Catch { | |||||
| template<> | |||||
| struct StringMaker<std::monostate> { | |||||
| static std::string convert(const std::monostate&) { | |||||
| return "{ }"; | |||||
| } | |||||
| }; | |||||
| template<typename... Elements> | |||||
| struct StringMaker<std::variant<Elements...>> { | |||||
| static std::string convert(const std::variant<Elements...>& variant) { | |||||
| if (variant.valueless_by_exception()) { | |||||
| return "{valueless variant}"; | |||||
| } else { | |||||
| return std::visit( | |||||
| [](const auto& value) { | |||||
| return ::Catch::Detail::stringify(value); | |||||
| }, | |||||
| variant | |||||
| ); | |||||
| } | |||||
| } | |||||
| }; | |||||
| } | |||||
| #endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER | |||||
| namespace Catch { | namespace Catch { | ||||
| struct not_this_one {}; // Tag type for detecting which begin/ end are being selected | struct not_this_one {}; // Tag type for detecting which begin/ end are being selected | ||||
| auto lfirst = m_target.begin(), llast = m_target.end(); | auto lfirst = m_target.begin(), llast = m_target.end(); | ||||
| auto rfirst = vec.begin(), rlast = vec.end(); | auto rfirst = vec.begin(), rlast = vec.end(); | ||||
| // Cut common prefix to optimize checking of permuted parts | // Cut common prefix to optimize checking of permuted parts | ||||
| while (lfirst != llast && *lfirst != *rfirst) { | |||||
| while (lfirst != llast && *lfirst == *rfirst) { | |||||
| ++lfirst; ++rfirst; | ++lfirst; ++rfirst; | ||||
| } | } | ||||
| if (lfirst == llast) { | if (lfirst == llast) { | ||||
| } | } | ||||
| bool RunContext::aborting() const { | bool RunContext::aborting() const { | ||||
| return m_totals.assertions.failed == static_cast<std::size_t>(m_config->abortAfter()); | |||||
| return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter()); | |||||
| } | } | ||||
| void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { | void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { | ||||
| return s; | return s; | ||||
| } | } | ||||
| #ifdef CATCH_CONFIG_WCHAR | |||||
| std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) { | |||||
| std::string s; | |||||
| s.reserve(wstr.size()); | |||||
| for (auto c : wstr) { | |||||
| s += (c <= 0xff) ? static_cast<char>(c) : '?'; | |||||
| } | |||||
| return ::Catch::Detail::stringify(s); | |||||
| #ifdef CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| std::string StringMaker<std::string_view>::convert(std::string_view str) { | |||||
| return ::Catch::Detail::stringify(std::string{ str }); | |||||
| } | } | ||||
| #endif | #endif | ||||
| return{ "{null string}" }; | return{ "{null string}" }; | ||||
| } | } | ||||
| } | } | ||||
| #ifdef CATCH_CONFIG_WCHAR | #ifdef CATCH_CONFIG_WCHAR | ||||
| std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) { | |||||
| std::string s; | |||||
| s.reserve(wstr.size()); | |||||
| for (auto c : wstr) { | |||||
| s += (c <= 0xff) ? static_cast<char>(c) : '?'; | |||||
| } | |||||
| return ::Catch::Detail::stringify(s); | |||||
| } | |||||
| # ifdef CATCH_CONFIG_CPP17_STRING_VIEW | |||||
| std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) { | |||||
| return StringMaker<std::wstring>::convert(std::wstring(str)); | |||||
| } | |||||
| # endif | |||||
| std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) { | std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) { | ||||
| if (str) { | if (str) { | ||||
| return ::Catch::Detail::stringify(std::wstring{ str }); | return ::Catch::Detail::stringify(std::wstring{ str }); | ||||
| } | } | ||||
| Version const& libraryVersion() { | Version const& libraryVersion() { | ||||
| static Version version( 2, 4, 0, "", 0 ); | |||||
| static Version version( 2, 4, 1, "", 0 ); | |||||
| return version; | return version; | ||||
| } | } | ||||