Cosmetic fixes (whitespace and spelling)

This commit is contained in:
Martin Hořeňovský 2017-05-27 14:42:54 +02:00
parent ea48ae0f75
commit 377c9a746d
13 changed files with 30 additions and 31 deletions

View File

@ -25,11 +25,11 @@
# # # #
# include(ParseAndAddCatchTests) # # include(ParseAndAddCatchTests) #
# ParseAndAddCatchTests(${PROJECT_NAME}) # # ParseAndAddCatchTests(${PROJECT_NAME}) #
# # # #
# The following variables affect the behavior of the script: # # The following variables affect the behavior of the script: #
# # # #
# PARSE_CATCH_TESTS_VERBOSE (Default OFF) # # PARSE_CATCH_TESTS_VERBOSE (Default OFF) #
# -- enabels debug messages # # -- enables debug messages #
# # # #
#==================================================================================================# #==================================================================================================#
@ -44,8 +44,8 @@ function(PrintDebugMessage)
endfunction() endfunction()
# This removes the contents between # This removes the contents between
# - block comments (i.e. /* ... */) # - block comments (i.e. /* ... */)
# - full line comments (i.e. // ... ) # - full line comments (i.e. // ... )
# contents have been read into '${CppCode}'. # contents have been read into '${CppCode}'.
# !keep partial line comments # !keep partial line comments
function(RemoveComments CppCode) function(RemoveComments CppCode)
@ -61,7 +61,7 @@ endfunction()
# Worker function # Worker function
function(ParseFile SourceFile TestTarget) function(ParseFile SourceFile TestTarget)
# accroding to CMake docs EXISTS behavior is well-defined only for full paths. # According to CMake docs EXISTS behavior is well-defined only for full paths.
get_filename_component(SourceFile ${SourceFile} ABSOLUTE) get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
if(NOT EXISTS ${SourceFile}) if(NOT EXISTS ${SourceFile})
message(WARNING "Cannot find source file: ${SourceFile}") message(WARNING "Cannot find source file: ${SourceFile}")
@ -121,9 +121,9 @@ function(ParseFile SourceFile TestTarget)
string(REPLACE "]" ";" Tags "${Tags}") string(REPLACE "]" ";" Tags "${Tags}")
string(REPLACE "[" "" Tags "${Tags}") string(REPLACE "[" "" Tags "${Tags}")
endif() endif()
list(APPEND Labels ${Tags}) list(APPEND Labels ${Tags})
PrintDebugMessage("Adding test \"${CTestName}\"") PrintDebugMessage("Adding test \"${CTestName}\"")
if(Labels) if(Labels)
PrintDebugMessage("Setting labels to ${Labels}") PrintDebugMessage("Setting labels to ${Labels}")

View File

@ -57,16 +57,16 @@
#include <crtdbg.h> #include <crtdbg.h>
class LeakDetector { class LeakDetector {
public: public:
LeakDetector() { LeakDetector() {
int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
flag |= _CRTDBG_LEAK_CHECK_DF; flag |= _CRTDBG_LEAK_CHECK_DF;
flag |= _CRTDBG_ALLOC_MEM_DF; flag |= _CRTDBG_ALLOC_MEM_DF;
_CrtSetDbgFlag(flag); _CrtSetDbgFlag(flag);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
// Change this to leaking allocation's number to break there // Change this to leaking allocation's number to break there
_CrtSetBreakAlloc(-1); _CrtSetBreakAlloc(-1);
} }
}; };
#else #else
class LeakDetector {}; class LeakDetector {};

View File

@ -33,8 +33,8 @@ namespace Catch {
template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( T const& ); template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( T const& );
template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( T const& ); template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( T const& );
private: private:
DecomposedExpression& operator = (DecomposedExpression const&); DecomposedExpression& operator = (DecomposedExpression const&);
}; };
struct AssertionInfo struct AssertionInfo

View File

@ -60,7 +60,7 @@
// source code rather than in Catch library code // source code rather than in Catch library code
#define INTERNAL_CATCH_REACT( resultBuilder ) \ #define INTERNAL_CATCH_REACT( resultBuilder ) \
if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \ if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \
resultBuilder.react(); resultBuilder.react();
#endif #endif

View File

@ -18,7 +18,7 @@ extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
int main (int argc, char * argv[]) { int main (int argc, char * argv[]) {
#endif #endif
int result = Catch::Session().run( argc, argv ); int result = Catch::Session().run( argc, argv );
return ( result < 0xff ? result : 0xff ); return ( result < 0xff ? result : 0xff );
} }

View File

@ -28,7 +28,7 @@ namespace Catch {
namespace Catch { namespace Catch {
struct FatalConditionHandler { struct FatalConditionHandler {
void reset() {} void reset() {}
}; };
} }
@ -106,7 +106,7 @@ namespace Catch {
namespace Catch { namespace Catch {
struct FatalConditionHandler { struct FatalConditionHandler {
void reset() {} void reset() {}
}; };
} }

View File

@ -104,7 +104,7 @@ namespace Catch {
namespace Matchers { namespace Matchers {
namespace Impl { namespace Impl {
namespace NSStringMatchers { namespace NSStringMatchers {
struct StringHolder : MatcherBase<NSString*>{ struct StringHolder : MatcherBase<NSString*>{
StringHolder( NSString* substr ) : m_substr( [substr copy] ){} StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}

View File

@ -69,7 +69,7 @@ namespace Catch {
T *nullableValue; T *nullableValue;
union { union {
char storage[sizeof(T)]; char storage[sizeof(T)];
// These are here to force alignment for the storage // These are here to force alignment for the storage
long double dummy1; long double dummy1;
void (*dummy2)(); void (*dummy2)();

View File

@ -300,7 +300,7 @@ namespace Catch {
// This just means the test was aborted due to failure // This just means the test was aborted due to failure
} }
catch(...) { catch(...) {
// Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
// are reported without translation at the point of origin. // are reported without translation at the point of origin.
if (m_shouldReportUnexpected) { if (m_shouldReportUnexpected) {
makeUnexpectedResultBuilder().useActiveException(); makeUnexpectedResultBuilder().useActiveException();

View File

@ -25,7 +25,7 @@ namespace Catch {
#else #else
template <typename T> template <typename T>
struct add_const { struct add_const {
typedef const T type; typedef const T type;
}; };

View File

@ -28,7 +28,7 @@ namespace Catch {
// + 1 for null terminator // + 1 for null terminator
const size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1; const size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1;
char buffer[maxDoubleSize]; char buffer[maxDoubleSize];
// Save previous errno, to prevent sprintf from overwriting it // Save previous errno, to prevent sprintf from overwriting it
ErrnoGuard guard; ErrnoGuard guard;
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -403,5 +403,5 @@ static int f() {
TEST_CASE( "#835 -- errno should not be touched by Catch", "[!shouldfail]" ) { TEST_CASE( "#835 -- errno should not be touched by Catch", "[!shouldfail]" ) {
errno = 1; errno = 1;
CHECK(f() == 0); CHECK(f() == 0);
REQUIRE(errno == 1); // Check that f() doesn't touch errno. REQUIRE(errno == 1); // Check that f() doesn't touch errno.
} }

View File

@ -9,7 +9,6 @@
TEST_CASE( "Character pretty printing" ){ TEST_CASE( "Character pretty printing" ){
//
SECTION("Specifically escaped"){ SECTION("Specifically escaped"){
char tab = '\t'; char tab = '\t';
char newline = '\n'; char newline = '\n';
@ -36,7 +35,7 @@ TEST_CASE( "Character pretty printing" ){
char c = static_cast<char>(i); char c = static_cast<char>(i);
REQUIRE(c == i); REQUIRE(c == i);
} }
} }
} }