Fixed string indexing bug

This commit is contained in:
Phil Nash 2013-09-07 12:07:38 +01:00
parent 04a3364b5a
commit f7378eebb6
6 changed files with 17 additions and 9 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png)
*v1.0 build 8 (master branch)*
*v1.0 build 9 (master branch)*
# New release with significant changes

View File

@ -111,7 +111,7 @@ namespace Catch {
inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
std::string className = classOrQualifiedMethodName;
if( className[0] == '&' )
if( startsWith( className, "&" ) )
{
std::size_t lastColons = className.rfind( "::" );
std::size_t penultimateColons = className.rfind( "::", lastColons-1 );

View File

@ -13,7 +13,7 @@
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion( 1, 0, 8, "master" );
Version libraryVersion( 1, 0, 9, "master" );
}
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -72,6 +72,10 @@ namespace Catch {
stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
m_headerPrinted = false;
}
else {
if( m_config->showDurations() == ShowDurations::Always )
stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
}
StreamingReporterBase::sectionEnded( _sectionStats );
}

View File

@ -1,6 +1,6 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CatchSelfTest is a Catch v1.0 b8 host application.
CatchSelfTest is a Catch v1.0 b9 host application.
Run with -? for options
-------------------------------------------------------------------------------
@ -712,7 +712,7 @@ with expansion:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CatchSelfTest is a Catch v1.0 b8 host application.
CatchSelfTest is a Catch v1.0 b9 host application.
Run with -? for options
-------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
/*
* CATCH v1.0 build 8 (master branch)
* Generated: 2013-08-16 19:08:52.941769
* CATCH v1.0 build 9 (master branch)
* Generated: 2013-09-07 12:04:25.989589
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -5527,7 +5527,7 @@ namespace Catch {
inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
std::string className = classOrQualifiedMethodName;
if( className[0] == '&' )
if( startsWith( className, "&" ) )
{
std::size_t lastColons = className.rfind( "::" );
std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
@ -6352,7 +6352,7 @@ namespace Catch {
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion( 1, 0, 8, "master" );
Version libraryVersion( 1, 0, 9, "master" );
}
// #included from: catch_text.hpp
@ -7303,6 +7303,10 @@ namespace Catch {
stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
m_headerPrinted = false;
}
else {
if( m_config->showDurations() == ShowDurations::Always )
stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
}
StreamingReporterBase::sectionEnded( _sectionStats );
}