This commit is contained in:
Phil Nash 2014-09-03 19:23:22 +01:00
parent 5ea3266857
commit 4caabfa45e
3 changed files with 46 additions and 12 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png) ![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) Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)

View File

@ -13,7 +13,7 @@
namespace Catch { namespace Catch {
// These numbers are maintained by a script // 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 #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v1.1 build 2 (develop branch) * CATCH v1.1 build 3 (develop branch)
* Generated: 2014-08-22 19:34:41.932570 * Generated: 2014-09-03 19:22:56.858064
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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) 2012 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -139,6 +139,10 @@
//#define CATCH_CONFIG_SFINAE // Not confirmed //#define CATCH_CONFIG_SFINAE // Not confirmed
#endif #endif
#if (_MSC_VER >= 1400)
#define CATCH_CONFIG_CPP11_NULLPTR
#endif
#endif // _MSC_VER #endif // _MSC_VER
// Use variadic macros if the compiler supports them // Use variadic macros if the compiler supports them
@ -1037,6 +1041,11 @@ inline id performOptionalSelector( id obj, SEL sel ) {
#endif #endif
namespace Catch { namespace Catch {
// Why we're here.
template<typename T>
std::string toString( T const& value );
namespace Detail { namespace Detail {
// SFINAE is currently disabled by default for all compilers. // SFINAE is currently disabled by default for all compilers.
@ -1079,10 +1088,38 @@ namespace Detail {
#endif #endif
#if defined(CATCH_CPP11_OR_GREATER)
template<typename T,
bool IsEmum = std::is_enum<T>::value
>
struct EnumStringMaker
{
static std::string convert( T const& ) { return "{?}"; }
};
template<typename T>
struct EnumStringMaker<T,true>
{
static std::string convert( T const& v )
{
return ::Catch::toString(
static_cast<typename std::underlying_type<T>::type>(v)
);
}
};
#endif
template<bool C> template<bool C>
struct StringMakerBase { struct StringMakerBase {
#if defined(CATCH_CPP11_OR_GREATER)
template<typename T>
static std::string convert( T const& v )
{
return EnumStringMaker<T>::convert( v );
}
#else
template<typename T> template<typename T>
static std::string convert( T const& ) { return "{?}"; } static std::string convert( T const& ) { return "{?}"; }
#endif
}; };
template<> template<>
@ -1104,9 +1141,6 @@ namespace Detail {
} // end namespace Detail } // end namespace Detail
template<typename T>
std::string toString( T const& value );
template<typename T> template<typename T>
struct StringMaker : struct StringMaker :
Detail::StringMakerBase<Detail::IsStreamInsertable<T>::value> {}; Detail::StringMakerBase<Detail::IsStreamInsertable<T>::value> {};
@ -1692,7 +1726,7 @@ namespace Catch {
public: public:
Timer() : m_ticks( 0 ) {} Timer() : m_ticks( 0 ) {}
void start(); void start();
unsigned int getElapsedNanoseconds() const; unsigned int getElapsedMicroseconds() const;
unsigned int getElapsedMilliseconds() const; unsigned int getElapsedMilliseconds() const;
double getElapsedSeconds() const; double getElapsedSeconds() const;
@ -6530,7 +6564,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 2, "develop" ); Version libraryVersion( 1, 1, 3, "develop" );
} }
// #included from: catch_message.hpp // #included from: catch_message.hpp
@ -6728,14 +6762,14 @@ namespace Catch {
void Timer::start() { void Timer::start() {
m_ticks = getCurrentTicks(); m_ticks = getCurrentTicks();
} }
unsigned int Timer::getElapsedNanoseconds() const { unsigned int Timer::getElapsedMicroseconds() const {
return static_cast<unsigned int>(getCurrentTicks() - m_ticks); return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
} }
unsigned int Timer::getElapsedMilliseconds() const { unsigned int Timer::getElapsedMilliseconds() const {
return static_cast<unsigned int>((getCurrentTicks() - m_ticks)/1000); return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
} }
double Timer::getElapsedSeconds() const { double Timer::getElapsedSeconds() const {
return (getCurrentTicks() - m_ticks)/1000000.0; return getElapsedMicroseconds()/1000000.0;
} }
} // namespace Catch } // namespace Catch