From 7eb5acc18357056bd3b0a94cb09f620e448cfbc7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 8 Jan 2014 17:17:31 +0000 Subject: [PATCH] build 25 - fix for #231 --- README.md | 2 +- include/internal/catch_debugger.hpp | 7 ++++--- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 42767531..14a391d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 24 (master branch)* +*v1.0 build 25 (master 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_debugger.hpp b/include/internal/catch_debugger.hpp index f3ad100f..49c485ff 100644 --- a/include/internal/catch_debugger.hpp +++ b/include/internal/catch_debugger.hpp @@ -30,7 +30,6 @@ // running under the debugger or has a debugger attached post facto). bool isDebuggerActive(){ - int junk; int mib[4]; struct kinfo_proc info; size_t size; @@ -51,8 +50,10 @@ // Call sysctl. size = sizeof(info); - junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0); - assert(junk == 0); + if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) { + std::cerr << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; + return false; + } // We're being debugged if the P_TRACED flag is set. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 67390ce8..2fcf72d1 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, 0, 24, "master" ); + Version libraryVersion( 1, 0, 25, "master" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 031479b0..746e9f4e 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 24 (master branch) - * Generated: 2014-01-07 17:26:42.421599 + * CATCH v1.0 build 25 (master branch) + * Generated: 2014-01-08 17:16:38.496390 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -685,17 +685,16 @@ namespace Detail { // Does not consider endian-ness template std::string rawMemoryToString( T value ) { - union - { - T value; + union { + T typedValue; unsigned char bytes[sizeof(T)]; - } valueAsBuffer; + }; - valueAsBuffer.value = value; + typedValue = value; std::ostringstream oss; oss << "0x"; - for( unsigned char* cp = valueAsBuffer.bytes; cp < valueAsBuffer.bytes+sizeof(T); ++cp ) + for( unsigned char* cp = bytes; cp < bytes+sizeof(T); ++cp ) oss << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)*cp; return oss.str(); } @@ -6207,7 +6206,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 24, "master" ); + Version libraryVersion( 1, 0, 25, "master" ); } // #included from: catch_text.hpp @@ -6626,7 +6625,6 @@ namespace Catch { // running under the debugger or has a debugger attached post facto). bool isDebuggerActive(){ - int junk; int mib[4]; struct kinfo_proc info; size_t size; @@ -6647,8 +6645,10 @@ namespace Catch { // Call sysctl. size = sizeof(info); - junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0); - assert(junk == 0); + if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) { + std::cerr << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; + return false; + } // We're being debugged if the P_TRACED flag is set.