diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-11 15:06:51 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-07-11 15:02:07 +0200 |
commit | fa5363538125d996ae5cede55f7f05e88701ace2 (patch) | |
tree | 06fa703f68df37e0ae4697b6c4bcd631791471c7 /src/test/util_tests.cpp | |
parent | 5f96bce9b7f38c687817d58e8b54a5b7ebfe91b3 (diff) |
util: Make Assert work with any value
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r-- | src/test/util_tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 257328974b..e247c09a97 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -41,6 +41,16 @@ namespace BCLog { BOOST_FIXTURE_TEST_SUITE(util_tests, BasicTestingSetup) +BOOST_AUTO_TEST_CASE(util_check) +{ + // Check that Assert can forward + const std::unique_ptr<int> p_two = Assert(MakeUnique<int>(2)); + // Check that Assert works on lvalues and rvalues + const int two = *Assert(p_two); + Assert(two == 2); + Assert(true); +} + BOOST_AUTO_TEST_CASE(util_criticalsection) { RecursiveMutex cs; |