Mark various anonymous classes final

This commit is contained in:
Martin Hořeňovský 2023-03-20 22:56:43 +01:00
parent 173aa3f1f4
commit 2598116aa6
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
4 changed files with 10 additions and 11 deletions

View File

@ -85,7 +85,7 @@ namespace Catch {
namespace { namespace {
//! A do-nothing implementation of colour, used as fallback for unknown //! A do-nothing implementation of colour, used as fallback for unknown
//! platforms, and when the user asks to deactivate all colours. //! platforms, and when the user asks to deactivate all colours.
class NoColourImpl : public ColourImpl { class NoColourImpl final : public ColourImpl {
public: public:
NoColourImpl( IStream* stream ): ColourImpl( stream ) {} NoColourImpl( IStream* stream ): ColourImpl( stream ) {}
@ -103,7 +103,7 @@ namespace Catch {
namespace Catch { namespace Catch {
namespace { namespace {
class Win32ColourImpl : public ColourImpl { class Win32ColourImpl final : public ColourImpl {
public: public:
Win32ColourImpl(IStream* stream): Win32ColourImpl(IStream* stream):
ColourImpl(stream) { ColourImpl(stream) {
@ -169,7 +169,7 @@ namespace {
namespace Catch { namespace Catch {
namespace { namespace {
class ANSIColourImpl : public ColourImpl { class ANSIColourImpl final : public ColourImpl {
public: public:
ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {}

View File

@ -24,7 +24,7 @@ namespace Catch {
namespace Detail { namespace Detail {
namespace { namespace {
template<typename WriterF, std::size_t bufferSize=256> template<typename WriterF, std::size_t bufferSize=256>
class StreamBufImpl : public std::streambuf { class StreamBufImpl final : public std::streambuf {
char data[bufferSize]; char data[bufferSize];
WriterF m_writer; WriterF m_writer;
@ -72,7 +72,7 @@ namespace Detail {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
class FileStream : public IStream { class FileStream final : public IStream {
std::ofstream m_ofs; std::ofstream m_ofs;
public: public:
FileStream( std::string const& filename ) { FileStream( std::string const& filename ) {
@ -89,7 +89,7 @@ namespace Detail {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
class CoutStream : public IStream { class CoutStream final : public IStream {
std::ostream m_os; std::ostream m_os;
public: public:
// Store the streambuf from cout up-front because // 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; Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf;
std::ostream m_os; std::ostream m_os;
public: public:

View File

@ -27,7 +27,7 @@ namespace Catch {
namespace Generators { namespace Generators {
namespace { namespace {
struct GeneratorTracker : TestCaseTracking::TrackerBase, struct GeneratorTracker final : TestCaseTracking::TrackerBase,
IGeneratorTracker { IGeneratorTracker {
GeneratorBasePtr m_generator; GeneratorBasePtr m_generator;
@ -36,7 +36,7 @@ namespace Catch {
TrackerContext& ctx, TrackerContext& ctx,
ITracker* parent ): ITracker* parent ):
TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {}
~GeneratorTracker() override; ~GeneratorTracker() override = default;
static GeneratorTracker* static GeneratorTracker*
acquire( TrackerContext& ctx, acquire( TrackerContext& ctx,
@ -161,7 +161,6 @@ namespace Catch {
m_generator = CATCH_MOVE( generator ); m_generator = CATCH_MOVE( generator );
} }
}; };
GeneratorTracker::~GeneratorTracker() = default;
} // namespace } // namespace
} }

View File

@ -29,7 +29,7 @@ namespace Catch {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
class RunContext : public IResultCapture { class RunContext final : public IResultCapture {
public: public:
RunContext( RunContext const& ) = delete; RunContext( RunContext const& ) = delete;