From 5eb7748a55a88a99223c7059f2a7ff0377d917e6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 4 Mar 2015 07:08:53 +0000 Subject: [PATCH] Changed relative #includes and made SourceLineInfo sortable (added < op) --- include/internal/catch_capture.hpp | 2 +- include/internal/catch_common.h | 1 + include/internal/catch_common.hpp | 3 +++ include/internal/catch_context_impl.hpp | 2 +- include/internal/catch_impl.hpp | 2 +- include/internal/catch_objc.hpp | 2 +- include/internal/catch_test_registry.hpp | 2 +- 7 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 39e5fc87..58591265 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -15,7 +15,7 @@ #include "catch_common.h" #include "catch_tostring.h" #include "catch_interfaces_runner.h" -#include "internal/catch_compiler_capabilities.h" +#include "catch_compiler_capabilities.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 68d23688..aadb0d34 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -94,6 +94,7 @@ namespace Catch { # endif bool empty() const; bool operator == ( SourceLineInfo const& other ) const; + bool operator < ( SourceLineInfo const& other ) const; std::string file; std::size_t line; diff --git a/include/internal/catch_common.hpp b/include/internal/catch_common.hpp index 29e9ed5a..8a42d0a0 100644 --- a/include/internal/catch_common.hpp +++ b/include/internal/catch_common.hpp @@ -78,6 +78,9 @@ namespace Catch { bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { return line == other.line && file == other.file; } + bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { + return line < other.line || ( line == other.line && file < other.file ); + } std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { #ifndef __GNUG__ diff --git a/include/internal/catch_context_impl.hpp b/include/internal/catch_context_impl.hpp index 19534de0..a495503c 100644 --- a/include/internal/catch_context_impl.hpp +++ b/include/internal/catch_context_impl.hpp @@ -60,7 +60,7 @@ namespace Catch { std::string testName = getResultCapture()->getCurrentTestName(); std::map::const_iterator it = - m_generatorsByTestName.find( testName ); + m_generatorsByTestName.find( testName ); return it != m_generatorsByTestName.end() ? it->second : NULL; diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 820b4975..24a8c3f8 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -16,7 +16,7 @@ #pragma clang diagnostic ignored "-Wweak-vtables" #endif -#include "catch_runner.hpp" +#include "../catch_runner.hpp" #include "catch_registry_hub.hpp" #include "catch_notimplemented_exception.hpp" #include "catch_context_impl.hpp" diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index 88b5ef78..7e315c22 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -17,7 +17,7 @@ // NB. Any general catch headers included here must be included // in catch.hpp first to make sure they are included by the single // header for non obj-usage -#include "internal/catch_test_case_info.h" +#include "catch_test_case_info.h" /////////////////////////////////////////////////////////////////////////////// // This protocol is really only here for (self) documenting purposes, since diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp index 73de60b4..d12411d4 100644 --- a/include/internal/catch_test_registry.hpp +++ b/include/internal/catch_test_registry.hpp @@ -10,7 +10,7 @@ #include "catch_common.h" #include "catch_interfaces_testcase.h" -#include "internal/catch_compiler_capabilities.h" +#include "catch_compiler_capabilities.h" namespace Catch {