/*
- * Catch v2.11.0
- * Generated: 2019-11-15 15:01:56.628356
+ * Catch v2.11.1
+ * Generated: 2019-12-28 21:22:11.930976
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved.
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 11
-#define CATCH_VERSION_PATCH 0
+#define CATCH_VERSION_PATCH 1
#ifdef __clang__
# pragma clang system_header
// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
-# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
-# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-# endif
+# if !defined(__clang__) // Handle Clang masquerading for msvc
+# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
+# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+# endif // MSVC_TRADITIONAL
+# endif // __clang__
+
#endif // _MSC_VER
#if defined(_REENTRANT) || defined(_MSC_VER)
class SingleValueGenerator final : public IGenerator<T> {
T m_value;
public:
- SingleValueGenerator(T const& value) : m_value( value ) {}
SingleValueGenerator(T&& value) : m_value(std::move(value)) {}
T const& get() const override {
m_generators.emplace_back(std::move(generator));
}
void populate(T&& val) {
- m_generators.emplace_back(value(std::move(val)));
+ m_generators.emplace_back(value(std::forward<T>(val)));
}
template<typename U>
void populate(U&& val) {
- populate(T(std::move(val)));
+ populate(T(std::forward<U>(val)));
}
template<typename U, typename... Gs>
- void populate(U&& valueOrGenerator, Gs... moreGenerators) {
+ void populate(U&& valueOrGenerator, Gs &&... moreGenerators) {
populate(std::forward<U>(valueOrGenerator));
populate(std::forward<Gs>(moreGenerators)...);
}
public:
template <typename... Gs>
- Generators(Gs... moreGenerators) {
+ Generators(Gs &&... moreGenerators) {
m_generators.reserve(sizeof...(Gs));
populate(std::forward<Gs>(moreGenerators)...);
}
struct as {};
template<typename T, typename... Gs>
- auto makeGenerators( GeneratorWrapper<T>&& generator, Gs... moreGenerators ) -> Generators<T> {
+ auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> {
return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...);
}
template<typename T>
return Generators<T>(std::move(generator));
}
template<typename T, typename... Gs>
- auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> {
+ auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<T> {
return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... );
}
template<typename T, typename U, typename... Gs>
- auto makeGenerators( as<T>, U&& val, Gs... moreGenerators ) -> Generators<T> {
+ auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> {
return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
}
} // namespace Catch
#define GENERATE( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
+ Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
#define GENERATE_COPY( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
+ Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
#define GENERATE_REF( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
+ Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
// end catch_generators.hpp
// start catch_generators_generic.hpp
#include <type_traits>
namespace Catch {
- namespace Detail {
- template <typename T, bool Destruct>
- struct ObjectStorage
- {
- using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
+ namespace Benchmark {
+ namespace Detail {
+ template <typename T, bool Destruct>
+ struct ObjectStorage
+ {
+ using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
- ObjectStorage() : data() {}
+ ObjectStorage() : data() {}
- ObjectStorage(const ObjectStorage& other)
- {
- new(&data) T(other.stored_object());
- }
+ ObjectStorage(const ObjectStorage& other)
+ {
+ new(&data) T(other.stored_object());
+ }
- ObjectStorage(ObjectStorage&& other)
- {
- new(&data) T(std::move(other.stored_object()));
- }
+ ObjectStorage(ObjectStorage&& other)
+ {
+ new(&data) T(std::move(other.stored_object()));
+ }
- ~ObjectStorage() { destruct_on_exit<T>(); }
+ ~ObjectStorage() { destruct_on_exit<T>(); }
- template <typename... Args>
- void construct(Args&&... args)
- {
- new (&data) T(std::forward<Args>(args)...);
- }
+ template <typename... Args>
+ void construct(Args&&... args)
+ {
+ new (&data) T(std::forward<Args>(args)...);
+ }
- template <bool AllowManualDestruction = !Destruct>
- typename std::enable_if<AllowManualDestruction>::type destruct()
- {
- stored_object().~T();
- }
+ template <bool AllowManualDestruction = !Destruct>
+ typename std::enable_if<AllowManualDestruction>::type destruct()
+ {
+ stored_object().~T();
+ }
- private:
- // If this is a constructor benchmark, destruct the underlying object
- template <typename U>
- void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); }
- // Otherwise, don't
- template <typename U>
- void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
-
- T& stored_object()
- {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
+ private:
+ // If this is a constructor benchmark, destruct the underlying object
+ template <typename U>
+ void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); }
+ // Otherwise, don't
+ template <typename U>
+ void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
+
+ T& stored_object() {
+ return *static_cast<T*>(static_cast<void*>(&data));
+ }
- TStorage data;
- };
- }
+ T const& stored_object() const {
+ return *static_cast<T*>(static_cast<void*>(&data));
+ }
- template <typename T>
- using storage_for = Detail::ObjectStorage<T, true>;
+ TStorage data;
+ };
+ }
- template <typename T>
- using destructable_object = Detail::ObjectStorage<T, false>;
+ template <typename T>
+ using storage_for = Detail::ObjectStorage<T, true>;
+
+ template <typename T>
+ using destructable_object = Detail::ObjectStorage<T, false>;
+ }
}
// end catch_constructor.hpp
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
+#elif defined(CATCH_PLATFORM_IPHONE)
+
+ // use inline assembler
+ #if defined(__i386__) || defined(__x86_64__)
+ #define CATCH_TRAP() __asm__("int $3")
+ #elif defined(__aarch64__)
+ #define CATCH_TRAP() __asm__(".inst 0xd4200000")
+ #elif defined(__arm__)
+ #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
+ #endif
+
#elif defined(CATCH_PLATFORM_LINUX)
// If we can use inline assembler, do it because this allows us to break
// directly at the location of the failing check instead of breaking inside
bool useColourOnPlatform() {
return
-#ifdef CATCH_PLATFORM_MAC
+#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
!isDebuggerActive() &&
#endif
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
// end catch_debug_console.cpp
// start catch_debugger.cpp
-#ifdef CATCH_PLATFORM_MAC
+#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
# include <assert.h>
# include <stdbool.h>
}
Version const& libraryVersion() {
- static Version version( 2, 11, 0, "", 0 );
+ static Version version( 2, 11, 1, "", 0 );
return version;
}
SECTION( "avg_match" )
{
auto ticks = entry.avg_match();
- INFO( ticks.count() << " == " << (1_ticks).count() );
+ INFO( ticks.count() << " == " << (1_ticks).count() )
CHECK( (ticks == 1_ticks) );
}
SECTION( "avg_no_match" )
{
auto ticks = entry.avg_no_match();
- INFO( ticks.count() << " == " << (1_ticks).count() );
+ INFO( ticks.count() << " == " << (1_ticks).count() )
CHECK( (ticks == 1_ticks) );
}
SECTION( "avg_check" )
{
auto ticks = entry.avg_check();
- INFO( ticks.count() << " == " << (1_ticks).count() );
+ INFO( ticks.count() << " == " << (1_ticks).count() )
CHECK( (ticks == 1_ticks) );
}
}
avoid_optimization();
}
- INFO( "elapsed: " << stats.elapsed.count() );
+ INFO( "elapsed: " << stats.elapsed.count() )
CHECK( (stats.elapsed > 0_ticks) );
CHECK( stats.checks == 1 );
- INFO( "elapsed_match: " << stats.elapsed_match.count() );
+ INFO( "elapsed_match: " << stats.elapsed_match.count() )
CHECK( (stats.elapsed_match == 0_ticks) );
}
avoid_optimization();
ctx.stop(true);
- INFO( "elapsed: " << stats.elapsed.count() );
+ INFO( "elapsed: " << stats.elapsed.count() )
CHECK( (stats.elapsed > 0_ticks) );
CHECK( stats.checks == 1 );
CHECK( stats.elapsed_match == stats.elapsed );
avoid_optimization();
ctx.stop(false);
- INFO( "elapsed: " << stats.elapsed.count() );
+ INFO( "elapsed: " << stats.elapsed.count() )
CHECK( (stats.elapsed > 0_ticks) );
CHECK( stats.checks == 1 );
CHECK( (stats.elapsed_match == 0_ticks) );
}
}
- INFO( "elapsed: " << stats.elapsed.count() );
+ INFO( "elapsed: " << stats.elapsed.count() )
CHECK( stats.elapsed == save.elapsed );
CHECK( stats.elapsed_match == save.elapsed_match );
CHECK( stats.checks == save.checks );