mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Remove some uses of std::shared_ptr
This commit is contained in:
parent
4394d3ae65
commit
c2852c9944
@ -51,7 +51,7 @@ namespace Catch {
|
|||||||
|
|
||||||
template <typename Clock = default_clock>
|
template <typename Clock = default_clock>
|
||||||
void run() {
|
void run() {
|
||||||
IConfigPtr cfg = getCurrentContext().getConfig();
|
auto const* cfg = getCurrentContext().getConfig();
|
||||||
|
|
||||||
auto env = Detail::measure_environment<Clock>();
|
auto env = Detail::measure_environment<Clock>();
|
||||||
|
|
||||||
|
@ -105,10 +105,9 @@ namespace {
|
|||||||
IColourImpl* platformColourInstance() {
|
IColourImpl* platformColourInstance() {
|
||||||
static Win32ColourImpl s_instance;
|
static Win32ColourImpl s_instance;
|
||||||
|
|
||||||
IConfigPtr config = getCurrentContext().getConfig();
|
auto const* config = getCurrentContext().getConfig();
|
||||||
UseColour::YesOrNo colourMode = config
|
UseColour::YesOrNo colourMode = config?
|
||||||
? config->useColour()
|
config->useColour() : UseColour::Auto;
|
||||||
: UseColour::Auto;
|
|
||||||
if( colourMode == UseColour::Auto )
|
if( colourMode == UseColour::Auto )
|
||||||
colourMode = UseColour::Yes;
|
colourMode = UseColour::Yes;
|
||||||
return colourMode == UseColour::Yes
|
return colourMode == UseColour::Yes
|
||||||
@ -179,7 +178,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
IColourImpl* platformColourInstance() {
|
IColourImpl* platformColourInstance() {
|
||||||
ErrnoGuard guard;
|
ErrnoGuard guard;
|
||||||
IConfigPtr config = getCurrentContext().getConfig();
|
auto const* config = getCurrentContext().getConfig();
|
||||||
UseColour::YesOrNo colourMode = config
|
UseColour::YesOrNo colourMode = config
|
||||||
? config->useColour()
|
? config->useColour()
|
||||||
: UseColour::Auto;
|
: UseColour::Auto;
|
||||||
|
@ -21,8 +21,8 @@ namespace Catch {
|
|||||||
return m_runner;
|
return m_runner;
|
||||||
}
|
}
|
||||||
|
|
||||||
IConfigPtr const& getConfig() const override {
|
IConfig const* getConfig() const override {
|
||||||
return m_config;
|
return m_config.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
~Context() override;
|
~Context() override;
|
||||||
|
@ -25,7 +25,7 @@ namespace Catch {
|
|||||||
|
|
||||||
virtual IResultCapture* getResultCapture() = 0;
|
virtual IResultCapture* getResultCapture() = 0;
|
||||||
virtual IRunner* getRunner() = 0;
|
virtual IRunner* getRunner() = 0;
|
||||||
virtual IConfigPtr const& getConfig() const = 0;
|
virtual IConfig const* getConfig() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IMutableContext : IContext
|
struct IMutableContext : IContext
|
||||||
|
Loading…
Reference in New Issue
Block a user