diff options
| author | Martin Hořeňovský | 2023-03-20 22:56:43 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-03-20 22:56:43 +0100 |
| commit | 2598116aa640b012d42900bb565a7f1bfae5152e (patch) | |
| tree | add02a7d415c46716c12983542f37edc6720cc51 /src/catch2/internal | |
| parent | 173aa3f1f401ce1165ec9307d249dc506a976c3e (diff) | |
| download | catch3-2598116aa640b012d42900bb565a7f1bfae5152e.tar.gz | |
Mark various anonymous classes final
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_console_colour.cpp | 6 | ||||
| -rw-r--r-- | src/catch2/internal/catch_istream.cpp | 8 | ||||
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 5 | ||||
| -rw-r--r-- | src/catch2/internal/catch_run_context.hpp | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index 099a6c59..e1238816 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -85,7 +85,7 @@ namespace Catch { namespace { //! A do-nothing implementation of colour, used as fallback for unknown //! platforms, and when the user asks to deactivate all colours. - class NoColourImpl : public ColourImpl { + class NoColourImpl final : public ColourImpl { public: NoColourImpl( IStream* stream ): ColourImpl( stream ) {} @@ -103,7 +103,7 @@ namespace Catch { namespace Catch { namespace { - class Win32ColourImpl : public ColourImpl { + class Win32ColourImpl final : public ColourImpl { public: Win32ColourImpl(IStream* stream): ColourImpl(stream) { @@ -169,7 +169,7 @@ namespace { namespace Catch { namespace { - class ANSIColourImpl : public ColourImpl { + class ANSIColourImpl final : public ColourImpl { public: ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} diff --git a/src/catch2/internal/catch_istream.cpp b/src/catch2/internal/catch_istream.cpp index 489396ec..bf0f66e4 100644 --- a/src/catch2/internal/catch_istream.cpp +++ b/src/catch2/internal/catch_istream.cpp @@ -24,7 +24,7 @@ namespace Catch { namespace Detail { namespace { template<typename WriterF, std::size_t bufferSize=256> - class StreamBufImpl : public std::streambuf { + class StreamBufImpl final : public std::streambuf { char data[bufferSize]; WriterF m_writer; @@ -72,7 +72,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class FileStream : public IStream { + class FileStream final : public IStream { std::ofstream m_ofs; public: FileStream( std::string const& filename ) { @@ -89,7 +89,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class CoutStream : public IStream { + class CoutStream final : public IStream { std::ostream m_os; public: // Store the streambuf from cout up-front because @@ -118,7 +118,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class DebugOutStream : public IStream { + class DebugOutStream final : public IStream { Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf; std::ostream m_os; public: diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index 8ffa7d47..11fcda45 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -27,7 +27,7 @@ namespace Catch { namespace Generators { namespace { - struct GeneratorTracker : TestCaseTracking::TrackerBase, + struct GeneratorTracker final : TestCaseTracking::TrackerBase, IGeneratorTracker { GeneratorBasePtr m_generator; @@ -36,7 +36,7 @@ namespace Catch { TrackerContext& ctx, ITracker* parent ): TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} - ~GeneratorTracker() override; + ~GeneratorTracker() override = default; static GeneratorTracker* acquire( TrackerContext& ctx, @@ -161,7 +161,6 @@ namespace Catch { m_generator = CATCH_MOVE( generator ); } }; - GeneratorTracker::~GeneratorTracker() = default; } // namespace } diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index ea2ca7c8..de6999e5 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -29,7 +29,7 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - class RunContext : public IResultCapture { + class RunContext final : public IResultCapture { public: RunContext( RunContext const& ) = delete; |