Merge branch 'BillyONeal-master'

This commit is contained in:
Phil Nash 2016-10-26 12:06:35 +01:00
commit 072114293b
2 changed files with 6 additions and 3 deletions

View File

@ -21,8 +21,11 @@ namespace Catch {
bool contains( std::string const& s, std::string const& infix ) { bool contains( std::string const& s, std::string const& infix ) {
return s.find( infix ) != std::string::npos; return s.find( infix ) != std::string::npos;
} }
char toLowerCh(char c) {
return static_cast<char>( ::tolower( c ) );
}
void toLowerInPlace( std::string& s ) { void toLowerInPlace( std::string& s ) {
std::transform( s.begin(), s.end(), s.begin(), ::tolower ); std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
} }
std::string toLower( std::string const& s ) { std::string toLower( std::string const& s ) {
std::string lc = s; std::string lc = s;

View File

@ -24,9 +24,9 @@
#endif #endif
namespace Catch { namespace Catch {
struct RandomNumberGenerator { struct RandomNumberGenerator {
typedef int result_type; typedef std::ptrdiff_t result_type;
result_type operator()( result_type n ) const { return std::rand() % n; } result_type operator()( result_type n ) const { return std::rand() % n; }