diff --git a/include/internal/TestCPPAssertions.h b/include/internal/TestCPPAssertions.h index 5b3bc34..c7b6fec 100644 --- a/include/internal/TestCPPAssertions.h +++ b/include/internal/TestCPPAssertions.h @@ -181,7 +181,7 @@ namespace TestCPP { * type. */ static void assertNoThrows ( - function shouldNotThrow, + const function& shouldNotThrow, const string& failureMessage = "Should not have thrown anything!" ); diff --git a/include/internal/TestCPPTestCase.h b/include/internal/TestCPPTestCase.h index 1a5326c..5e4b35f 100644 --- a/include/internal/TestCPPTestCase.h +++ b/include/internal/TestCPPTestCase.h @@ -342,7 +342,7 @@ namespace TestCPP { * @return The duration of the function run, in nanoseconds. */ template - static nanoseconds duration (F func, Args&&... args) + static nanoseconds duration (const F& func, Args&&... args) { auto start = system_clock::now(); func(forward(args)...); diff --git a/src/TestCPPAssertions.cpp b/src/TestCPPAssertions.cpp index 1ec0ac6..53d4eae 100644 --- a/src/TestCPPAssertions.cpp +++ b/src/TestCPPAssertions.cpp @@ -134,7 +134,7 @@ namespace TestCPP { } void Assertions::assertNoThrows ( - function shouldNotThrow, + const function& shouldNotThrow, const string& failureMessage ) {