Fixed errors and warnings on OC project

This commit is contained in:
Phil Nash 2018-06-12 13:42:33 +01:00
parent c5301bf8bf
commit 788f81230f
8 changed files with 20 additions and 14 deletions

View File

@ -18,7 +18,7 @@
namespace Catch {
auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
inline auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
expr.streamReconstructedExpression( os );
return os;
}

View File

@ -93,7 +93,7 @@ namespace Catch {
std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
const char* className = class_getName( cls );
getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo("",0) ) );
getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
noTestMethods++;
}
}

View File

@ -29,7 +29,7 @@ namespace Catch {
bool contains( std::string const& s, std::string const& infix ) {
return s.find( infix ) != std::string::npos;
}
char toLowerCh(char c) {
inline char toLowerCh(char c) {
return static_cast<char>( std::tolower( c ) );
}
void toLowerInPlace( std::string& s ) {

View File

@ -19,7 +19,7 @@
namespace Catch {
TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
if( startsWith( tag, '.' ) ||
tag == "!hide" )
return TestCaseInfo::IsHidden;
@ -36,10 +36,10 @@ namespace Catch {
else
return TestCaseInfo::None;
}
bool isReservedTag( std::string const& tag ) {
inline bool isReservedTag( std::string const& tag ) {
return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( static_cast<unsigned char>(tag[0]) );
}
void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
CATCH_ENFORCE( !isReservedTag(tag),
"Tag name: [" << tag << "] is not allowed.\n"
<< "Tag names starting with non alpha-numeric characters are reserved\n"

View File

@ -18,7 +18,7 @@ namespace Catch {
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
}
auto estimateClockResolution() -> uint64_t {
inline auto estimateClockResolution() -> uint64_t {
uint64_t sum = 0;
static const uint64_t iterations = 1000000;

View File

@ -12,11 +12,6 @@
# pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
// Enable specific decls locally
#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
#endif
#include "catch_tostring.h"
#include "catch_interfaces_config.h"
#include "catch_context.h"
@ -229,13 +224,14 @@ std::string StringMaker<double>::convert(double value) {
return fpToString(value, 10);
}
#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
std::string ratio_string<std::atto>::symbol() { return "a"; }
std::string ratio_string<std::femto>::symbol() { return "f"; }
std::string ratio_string<std::pico>::symbol() { return "p"; }
std::string ratio_string<std::nano>::symbol() { return "n"; }
std::string ratio_string<std::micro>::symbol() { return "u"; }
std::string ratio_string<std::milli>::symbol() { return "m"; }
#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
} // end namespace Catch

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -29,6 +29,7 @@
#include "../../../include/internal/catch_matchers.cpp"
#include "../../../include/internal/catch_matchers_string.cpp"
#include "../../../include/internal/catch_message.cpp"
#include "../../../include/internal/catch_output_redirect.cpp"
#include "../../../include/internal/catch_random_number_generator.cpp"
#include "../../../include/internal/catch_registry_hub.cpp"
#include "../../../include/internal/catch_reporter_registry.cpp"
@ -53,6 +54,7 @@
#include "../../../include/internal/catch_timer.cpp"
#include "../../../include/internal/catch_tostring.cpp"
#include "../../../include/internal/catch_totals.cpp"
#include "../../../include/internal/catch_uncaught_exceptions.cpp"
#include "../../../include/internal/catch_version.cpp"
#include "../../../include/internal/catch_wildcard_pattern.cpp"
#include "../../../include/internal/catch_xmlwriter.cpp"
@ -63,5 +65,5 @@
#include "../../../include/reporters/catch_reporter_compact.cpp"
#include "../../../include/reporters/catch_reporter_console.cpp"
#include "../../../include/reporters/catch_reporter_junit.cpp"
#include "../../../include/reporters/catch_reporter_multi.cpp"
#include "../../../include/reporters/catch_reporter_listening.cpp"
#include "../../../include/reporters/catch_reporter_xml.cpp"