From 4caabfa45ebe21cf9c0c07e04af3cd43614a984c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 3 Sep 2014 19:23:22 +0100 Subject: [PATCH] build 3 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 54 ++++++++++++++++++++++++------ 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 38f6884f..f7bc851c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.1 build 2 (develop branch)* +*v1.1 build 3 (develop branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index ac17c619..07d9c8e7 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 1, 2, "develop" ); + Version libraryVersion( 1, 1, 3, "develop" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 39644f21..df8594bd 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.1 build 2 (develop branch) - * Generated: 2014-08-22 19:34:41.932570 + * CATCH v1.1 build 3 (develop branch) + * Generated: 2014-09-03 19:22:56.858064 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -139,6 +139,10 @@ //#define CATCH_CONFIG_SFINAE // Not confirmed #endif +#if (_MSC_VER >= 1400) +#define CATCH_CONFIG_CPP11_NULLPTR +#endif + #endif // _MSC_VER // Use variadic macros if the compiler supports them @@ -1037,6 +1041,11 @@ inline id performOptionalSelector( id obj, SEL sel ) { #endif namespace Catch { + +// Why we're here. +template +std::string toString( T const& value ); + namespace Detail { // SFINAE is currently disabled by default for all compilers. @@ -1079,10 +1088,38 @@ namespace Detail { #endif +#if defined(CATCH_CPP11_OR_GREATER) + template::value + > + struct EnumStringMaker + { + static std::string convert( T const& ) { return "{?}"; } + }; + + template + struct EnumStringMaker + { + static std::string convert( T const& v ) + { + return ::Catch::toString( + static_cast::type>(v) + ); + } + }; +#endif template struct StringMakerBase { +#if defined(CATCH_CPP11_OR_GREATER) + template + static std::string convert( T const& v ) + { + return EnumStringMaker::convert( v ); + } +#else template static std::string convert( T const& ) { return "{?}"; } +#endif }; template<> @@ -1104,9 +1141,6 @@ namespace Detail { } // end namespace Detail -template -std::string toString( T const& value ); - template struct StringMaker : Detail::StringMakerBase::value> {}; @@ -1692,7 +1726,7 @@ namespace Catch { public: Timer() : m_ticks( 0 ) {} void start(); - unsigned int getElapsedNanoseconds() const; + unsigned int getElapsedMicroseconds() const; unsigned int getElapsedMilliseconds() const; double getElapsedSeconds() const; @@ -6530,7 +6564,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 1, 2, "develop" ); + Version libraryVersion( 1, 1, 3, "develop" ); } // #included from: catch_message.hpp @@ -6728,14 +6762,14 @@ namespace Catch { void Timer::start() { m_ticks = getCurrentTicks(); } - unsigned int Timer::getElapsedNanoseconds() const { + unsigned int Timer::getElapsedMicroseconds() const { return static_cast(getCurrentTicks() - m_ticks); } unsigned int Timer::getElapsedMilliseconds() const { - return static_cast((getCurrentTicks() - m_ticks)/1000); + return static_cast(getElapsedMicroseconds()/1000); } double Timer::getElapsedSeconds() const { - return (getCurrentTicks() - m_ticks)/1000000.0; + return getElapsedMicroseconds()/1000000.0; } } // namespace Catch