Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-04-11 00:00:19 +0200
committerMartin Hořeňovský2022-04-11 18:32:35 +0200
commit8cdaebe9643f77b2e62cde01df0176d15385b12c (patch)
tree97cc618b4ae6b3d61c7fe368da494d35df7ccec2 /src
parent1a56ba851b7a66145ffe4b9fac722a692485b973 (diff)
downloadcatch3-8cdaebe9643f77b2e62cde01df0176d15385b12c.tar.gz
struct -> class normalization for various interface types
Diffstat (limited to 'src')
-rw-r--r--src/catch2/catch_test_case_info.hpp2
-rw-r--r--src/catch2/catch_test_spec.hpp2
-rw-r--r--src/catch2/generators/catch_generators.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_capture.hpp8
-rw-r--r--src/catch2/interfaces/catch_interfaces_config.hpp4
-rw-r--r--src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_exception.hpp9
-rw-r--r--src/catch2/interfaces/catch_interfaces_generatortracker.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_registry_hub.hpp22
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp2
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_factory.hpp5
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_registry.hpp7
-rw-r--r--src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_testcase.hpp8
-rw-r--r--src/catch2/internal/catch_assertion_handler.hpp2
-rw-r--r--src/catch2/internal/catch_console_colour.hpp2
-rw-r--r--src/catch2/internal/catch_context.hpp12
-rw-r--r--src/catch2/internal/catch_decomposer.hpp8
-rw-r--r--src/catch2/internal/catch_lazy_expr.hpp2
-rw-r--r--src/catch2/internal/catch_run_context.hpp6
-rw-r--r--src/catch2/internal/catch_test_case_registry_impl.hpp2
-rw-r--r--src/catch2/internal/catch_test_spec_parser.hpp2
-rw-r--r--src/catch2/reporters/catch_reporter_helpers.hpp2
23 files changed, 66 insertions, 53 deletions
diff --git a/src/catch2/catch_test_case_info.hpp b/src/catch2/catch_test_case_info.hpp
index 3ea656f6..6cfc2aaf 100644
--- a/src/catch2/catch_test_case_info.hpp
+++ b/src/catch2/catch_test_case_info.hpp
@@ -42,7 +42,7 @@ namespace Catch {
friend bool operator==( Tag const& lhs, Tag const& rhs );
};
- struct ITestInvoker;
+ class ITestInvoker;
enum class TestCaseProperties : uint8_t {
None = 0,
diff --git a/src/catch2/catch_test_spec.hpp b/src/catch2/catch_test_spec.hpp
index 4f444fff..499bfaa5 100644
--- a/src/catch2/catch_test_spec.hpp
+++ b/src/catch2/catch_test_spec.hpp
@@ -21,7 +21,7 @@
namespace Catch {
- struct IConfig;
+ class IConfig;
struct TestCaseInfo;
class TestCaseHandle;
diff --git a/src/catch2/generators/catch_generators.hpp b/src/catch2/generators/catch_generators.hpp
index 9ffb9b76..948d6f0f 100644
--- a/src/catch2/generators/catch_generators.hpp
+++ b/src/catch2/generators/catch_generators.hpp
@@ -29,7 +29,8 @@ namespace Detail {
} // end namespace detail
template<typename T>
- struct IGenerator : GeneratorUntypedBase {
+ class IGenerator : public GeneratorUntypedBase {
+ public:
~IGenerator() override = default;
IGenerator() = default;
IGenerator(IGenerator const&) = default;
diff --git a/src/catch2/interfaces/catch_interfaces_capture.hpp b/src/catch2/interfaces/catch_interfaces_capture.hpp
index 2e7a631f..6981e724 100644
--- a/src/catch2/interfaces/catch_interfaces_capture.hpp
+++ b/src/catch2/interfaces/catch_interfaces_capture.hpp
@@ -26,15 +26,15 @@ namespace Catch {
struct AssertionReaction;
struct SourceLineInfo;
- struct ITransientExpression;
- struct IGeneratorTracker;
+ class ITransientExpression;
+ class IGeneratorTracker;
struct BenchmarkInfo;
template <typename Duration = std::chrono::duration<double, std::nano>>
struct BenchmarkStats;
- struct IResultCapture {
-
+ class IResultCapture {
+ public:
virtual ~IResultCapture();
virtual bool sectionStarted( SectionInfo const& sectionInfo,
diff --git a/src/catch2/interfaces/catch_interfaces_config.hpp b/src/catch2/interfaces/catch_interfaces_config.hpp
index 968c868e..7e3c9d0b 100644
--- a/src/catch2/interfaces/catch_interfaces_config.hpp
+++ b/src/catch2/interfaces/catch_interfaces_config.hpp
@@ -62,8 +62,8 @@ namespace Catch {
class TestSpec;
class IStream;
- struct IConfig : Detail::NonCopyable {
-
+ class IConfig : public Detail::NonCopyable {
+ public:
virtual ~IConfig();
virtual bool allowThrows() const = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp b/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp
index e00f2c9d..cf25d896 100644
--- a/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp
+++ b/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp
@@ -25,7 +25,8 @@ namespace Catch {
};
} // namespace Detail
- struct IMutableEnumValuesRegistry {
+ class IMutableEnumValuesRegistry {
+ public:
virtual ~IMutableEnumValuesRegistry(); // = default;
virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_exception.hpp b/src/catch2/interfaces/catch_interfaces_exception.hpp
index c1834074..b72b49a1 100644
--- a/src/catch2/interfaces/catch_interfaces_exception.hpp
+++ b/src/catch2/interfaces/catch_interfaces_exception.hpp
@@ -17,17 +17,18 @@
namespace Catch {
using exceptionTranslateFunction = std::string(*)();
- struct IExceptionTranslator;
+ class IExceptionTranslator;
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
- struct IExceptionTranslator {
+ class IExceptionTranslator {
+ public:
virtual ~IExceptionTranslator(); // = default
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
};
- struct IExceptionTranslatorRegistry {
+ class IExceptionTranslatorRegistry {
+ public:
virtual ~IExceptionTranslatorRegistry(); // = default
-
virtual std::string translateActiveException() const = 0;
};
diff --git a/src/catch2/interfaces/catch_interfaces_generatortracker.hpp b/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
index f1ca3441..fa475e28 100644
--- a/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
+++ b/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
@@ -33,7 +33,8 @@ namespace Catch {
} // namespace Generators
- struct IGeneratorTracker {
+ class IGeneratorTracker {
+ public:
virtual ~IGeneratorTracker(); // = default;
virtual auto hasGenerator() const -> bool = 0;
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_registry_hub.hpp b/src/catch2/interfaces/catch_interfaces_registry_hub.hpp
index 1c40f2de..22e62b79 100644
--- a/src/catch2/interfaces/catch_interfaces_registry_hub.hpp
+++ b/src/catch2/interfaces/catch_interfaces_registry_hub.hpp
@@ -16,14 +16,14 @@ namespace Catch {
class TestCaseHandle;
struct TestCaseInfo;
- struct ITestCaseRegistry;
- struct IExceptionTranslatorRegistry;
- struct IExceptionTranslator;
- struct IReporterRegistry;
- struct IReporterFactory;
- struct ITagAliasRegistry;
- struct ITestInvoker;
- struct IMutableEnumValuesRegistry;
+ class ITestCaseRegistry;
+ class IExceptionTranslatorRegistry;
+ class IExceptionTranslator;
+ class IReporterRegistry;
+ class IReporterFactory;
+ class ITagAliasRegistry;
+ class ITestInvoker;
+ class IMutableEnumValuesRegistry;
struct SourceLineInfo;
class StartupExceptionRegistry;
@@ -31,7 +31,8 @@ namespace Catch {
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
- struct IRegistryHub {
+ class IRegistryHub {
+ public:
virtual ~IRegistryHub(); // = default
virtual IReporterRegistry const& getReporterRegistry() const = 0;
@@ -43,7 +44,8 @@ namespace Catch {
virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
};
- struct IMutableRegistryHub {
+ class IMutableRegistryHub {
+ public:
virtual ~IMutableRegistryHub(); // = default
virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0;
virtual void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp
index 7f6ed249..4cf98ba1 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp
@@ -30,7 +30,7 @@ namespace Catch {
struct TagInfo;
struct TestCaseInfo;
class TestCaseHandle;
- struct IConfig;
+ class IConfig;
class IStream;
enum class ColourMode : std::uint8_t;
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
index 4300fdb2..7a71a168 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
@@ -15,12 +15,13 @@
namespace Catch {
struct ReporterConfig;
- struct IConfig;
+ class IConfig;
class IEventListener;
using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
- struct IReporterFactory {
+ class IReporterFactory {
+ public:
virtual ~IReporterFactory(); // = default
virtual IEventListenerPtr
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
index fcb42755..5645640a 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
@@ -17,16 +17,17 @@
namespace Catch {
- struct IConfig;
+ class IConfig;
class IEventListener;
using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
- struct IReporterFactory;
+ class IReporterFactory;
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
struct ReporterConfig;
class EventListenerFactory;
- struct IReporterRegistry {
+ class IReporterRegistry {
+ public:
using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>;
using Listeners = std::vector<Detail::unique_ptr<EventListenerFactory>>;
diff --git a/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp b/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp
index 6b0973b4..141560a1 100644
--- a/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp
+++ b/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp
@@ -14,7 +14,8 @@ namespace Catch {
struct TagAlias;
- struct ITagAliasRegistry {
+ class ITagAliasRegistry {
+ public:
virtual ~ITagAliasRegistry(); // = default
// Nullptr if not present
virtual TagAlias const* find( std::string const& alias ) const = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_testcase.hpp b/src/catch2/interfaces/catch_interfaces_testcase.hpp
index 2d0b6c28..9701d342 100644
--- a/src/catch2/interfaces/catch_interfaces_testcase.hpp
+++ b/src/catch2/interfaces/catch_interfaces_testcase.hpp
@@ -15,15 +15,17 @@ namespace Catch {
class TestSpec;
struct TestCaseInfo;
- struct ITestInvoker {
+ class ITestInvoker {
+ public:
virtual void invoke () const = 0;
virtual ~ITestInvoker(); // = default
};
class TestCaseHandle;
- struct IConfig;
+ class IConfig;
- struct ITestCaseRegistry {
+ class ITestCaseRegistry {
+ public:
virtual ~ITestCaseRegistry(); // = default
// TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later
virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0;
diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp
index b7c7613e..4d397766 100644
--- a/src/catch2/internal/catch_assertion_handler.hpp
+++ b/src/catch2/internal/catch_assertion_handler.hpp
@@ -16,7 +16,7 @@
namespace Catch {
struct AssertionResultData;
- struct IResultCapture;
+ class IResultCapture;
class RunContext;
struct AssertionReaction {
diff --git a/src/catch2/internal/catch_console_colour.hpp b/src/catch2/internal/catch_console_colour.hpp
index 7f91a5fc..bf7cb893 100644
--- a/src/catch2/internal/catch_console_colour.hpp
+++ b/src/catch2/internal/catch_console_colour.hpp
@@ -16,7 +16,7 @@
namespace Catch {
enum class ColourMode : std::uint8_t;
- struct IConfig;
+ class IConfig;
class IStream;
struct Colour {
diff --git a/src/catch2/internal/catch_context.hpp b/src/catch2/internal/catch_context.hpp
index d3552448..45901739 100644
--- a/src/catch2/internal/catch_context.hpp
+++ b/src/catch2/internal/catch_context.hpp
@@ -10,19 +10,19 @@
namespace Catch {
- struct IResultCapture;
- struct IConfig;
+ class IResultCapture;
+ class IConfig;
- struct IContext
- {
+ class IContext {
+ public:
virtual ~IContext(); // = default
virtual IResultCapture* getResultCapture() = 0;
virtual IConfig const* getConfig() const = 0;
};
- struct IMutableContext : IContext
- {
+ class IMutableContext : public IContext {
+ public:
virtual ~IMutableContext(); // = default
virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
virtual void setConfig( IConfig const* config ) = 0;
diff --git a/src/catch2/internal/catch_decomposer.hpp b/src/catch2/internal/catch_decomposer.hpp
index a747c34c..e7dd1e9a 100644
--- a/src/catch2/internal/catch_decomposer.hpp
+++ b/src/catch2/internal/catch_decomposer.hpp
@@ -33,7 +33,11 @@
namespace Catch {
- struct ITransientExpression {
+ class ITransientExpression {
+ bool m_isBinaryExpression;
+ bool m_result;
+
+ public:
auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
auto getResult() const -> bool { return m_result; }
virtual void streamReconstructedExpression( std::ostream &os ) const = 0;
@@ -51,8 +55,6 @@ namespace Catch {
// complain if it's not here :-(
virtual ~ITransientExpression(); // = default;
- bool m_isBinaryExpression;
- bool m_result;
friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) {
expr.streamReconstructedExpression(out);
return out;
diff --git a/src/catch2/internal/catch_lazy_expr.hpp b/src/catch2/internal/catch_lazy_expr.hpp
index e69a72ef..d4aa79d7 100644
--- a/src/catch2/internal/catch_lazy_expr.hpp
+++ b/src/catch2/internal/catch_lazy_expr.hpp
@@ -12,7 +12,7 @@
namespace Catch {
- struct ITransientExpression;
+ class ITransientExpression;
class LazyExpression {
friend class AssertionHandler;
diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp
index 4441a097..cf894176 100644
--- a/src/catch2/internal/catch_run_context.hpp
+++ b/src/catch2/internal/catch_run_context.hpp
@@ -24,9 +24,9 @@
namespace Catch {
- struct IMutableContext;
- struct IGeneratorTracker;
- struct IConfig;
+ class IMutableContext;
+ class IGeneratorTracker;
+ class IConfig;
///////////////////////////////////////////////////////////////////////////
diff --git a/src/catch2/internal/catch_test_case_registry_impl.hpp b/src/catch2/internal/catch_test_case_registry_impl.hpp
index 60a8f9bd..b0064cbb 100644
--- a/src/catch2/internal/catch_test_case_registry_impl.hpp
+++ b/src/catch2/internal/catch_test_case_registry_impl.hpp
@@ -16,7 +16,7 @@
namespace Catch {
class TestCaseHandle;
- struct IConfig;
+ class IConfig;
class TestSpec;
std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases );
diff --git a/src/catch2/internal/catch_test_spec_parser.hpp b/src/catch2/internal/catch_test_spec_parser.hpp
index 22b288eb..75f2fd76 100644
--- a/src/catch2/internal/catch_test_spec_parser.hpp
+++ b/src/catch2/internal/catch_test_spec_parser.hpp
@@ -20,7 +20,7 @@
namespace Catch {
- struct ITagAliasRegistry;
+ class ITagAliasRegistry;
class TestSpecParser {
enum Mode{ None, Name, QuotedName, Tag, EscapedName };
diff --git a/src/catch2/reporters/catch_reporter_helpers.hpp b/src/catch2/reporters/catch_reporter_helpers.hpp
index 8a8051d7..28ab966c 100644
--- a/src/catch2/reporters/catch_reporter_helpers.hpp
+++ b/src/catch2/reporters/catch_reporter_helpers.hpp
@@ -17,7 +17,7 @@
namespace Catch {
- struct IConfig;
+ class IConfig;
class TestCaseHandle;
class ColourImpl;