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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-05-28 23:43:15 +0200
committerMartin Hořeňovský2021-05-28 23:43:15 +0200
commit2ae28fc8525813023f8ec0f5318670cfaf86ec83 (patch)
tree8d901e2879195f41460f70d569ef010c77f7dc1b /src
parentf9ec34ce016ad5b12afc22251b254e93ad7fd038 (diff)
downloadcatch3-2ae28fc8525813023f8ec0f5318670cfaf86ec83.tar.gz
Use make_unique instead of unique_ptr(new T) in more places
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_test_registry.cpp2
-rw-r--r--src/catch2/internal/catch_test_registry.hpp2
-rw-r--r--src/catch2/reporters/catch_reporter_console.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_test_registry.cpp b/src/catch2/internal/catch_test_registry.cpp
index bb5d7810..e4ebc2dd 100644
--- a/src/catch2/internal/catch_test_registry.cpp
+++ b/src/catch2/internal/catch_test_registry.cpp
@@ -14,7 +14,7 @@
namespace Catch {
Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) {
- return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsFunction( testAsFunction ));
+ return Detail::make_unique<TestInvokerAsFunction>( testAsFunction );
}
AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept {
diff --git a/src/catch2/internal/catch_test_registry.hpp b/src/catch2/internal/catch_test_registry.hpp
index 3c6ce957..c7e110f0 100644
--- a/src/catch2/internal/catch_test_registry.hpp
+++ b/src/catch2/internal/catch_test_registry.hpp
@@ -42,7 +42,7 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() );
template<typename C>
Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) {
- return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsMethod<C>(testAsMethod) );
+ return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod );
}
struct NameAndTags {
diff --git a/src/catch2/reporters/catch_reporter_console.cpp b/src/catch2/reporters/catch_reporter_console.cpp
index e8970214..20f6b121 100644
--- a/src/catch2/reporters/catch_reporter_console.cpp
+++ b/src/catch2/reporters/catch_reporter_console.cpp
@@ -354,7 +354,7 @@ public:
ConsoleReporter::ConsoleReporter(ReporterConfig const& config)
: StreamingReporterBase(config),
- m_tablePrinter(new TablePrinter(config.stream(),
+ m_tablePrinter(Detail::make_unique<TablePrinter>(config.stream(),
[&config]() -> std::vector<ColumnInfo> {
if (config.fullConfig()->benchmarkNoAnalysis())
{