diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 551bafbc..9b4cf9b3 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -115,6 +115,16 @@ inline std::string toString( bool value ) { return value ? "true" : "false"; } +inline std::string toString( char value ) { + return value < ' ' + ? toString( (unsigned int)value ) + : Detail::makeString( value ); +} + +inline std::string toString( signed char value ) { + return toString( static_cast( value ) ); +} + #ifdef CATCH_CONFIG_CPP11_NULLPTR inline std::string toString( std::nullptr_t ) { return "nullptr"; diff --git a/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm b/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm index 4b67efee..032660f3 100644 --- a/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm +++ b/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm @@ -42,6 +42,12 @@ OC_TEST_CASE( "OCTest/test2", "This is another test case" ) REQUIRE( obj.int_val == 2 ); } +OC_TEST_CASE( "OCTest/BOOL", "tests a boolean value" ) +{ + CHECK( [obj isTrue] == NO ); + CHECK( [obj isFalse] == YES ); +} + OC_TEST_CASE( "OCTest/throws/objc", "throws an Objective-C exception" ) { @throw [[NSException alloc] initWithName: NSGenericException diff --git a/projects/XCode4/OCTest/OCTest/TestObj.h b/projects/XCode4/OCTest/OCTest/TestObj.h index 388e9a8d..be0a4141 100644 --- a/projects/XCode4/OCTest/OCTest/TestObj.h +++ b/projects/XCode4/OCTest/OCTest/TestObj.h @@ -16,6 +16,9 @@ int int_val; } +-(BOOL) isTrue; +-(BOOL) isFalse; + @property (nonatomic, assign ) int int_val; @end diff --git a/projects/XCode4/OCTest/OCTest/TestObj.m b/projects/XCode4/OCTest/OCTest/TestObj.m index 943f4450..2c7dc99b 100644 --- a/projects/XCode4/OCTest/OCTest/TestObj.m +++ b/projects/XCode4/OCTest/OCTest/TestObj.m @@ -15,4 +15,11 @@ @synthesize int_val; +-(BOOL) isTrue { + return YES; +} +-(BOOL) isFalse { + return NO; +} + @end diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 556cb916..3921b1c7 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-06-05 20:50:55.068066 + * Generated: 2012-06-06 08:05:56.928287 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -633,6 +633,16 @@ inline std::string toString( bool value ) { return value ? "true" : "false"; } +inline std::string toString( char value ) { + return value < ' ' + ? toString( (unsigned int)value ) + : Detail::makeString( value ); +} + +inline std::string toString( signed char value ) { + return toString( static_cast( value ) ); +} + #ifdef CATCH_CONFIG_CPP11_NULLPTR inline std::string toString( std::nullptr_t ) { return "nullptr";