diff --git a/CMakeLists.txt b/CMakeLists.txt index a22e846..005c0f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,8 +114,8 @@ set(META_APP_AUTHOR "Martchus") set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parser, IO and conversion utilities") set(META_VERSION_MAJOR 5) -set(META_VERSION_MINOR 14) -set(META_VERSION_PATCH 1) +set(META_VERSION_MINOR 15) +set(META_VERSION_PATCH 0) # find required 3rd party libraries include(3rdParty) diff --git a/tests/testutils.h b/tests/testutils.h index 122a376..441023a 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -5,6 +5,7 @@ #include "../misc/traits.h" #include +#include #include #include @@ -196,6 +197,19 @@ CPP_UTILITIES_EXPORT int execHelperAppInSearchPath( const char *appName, const char *const *args, std::string &output, std::string &errors, bool suppressLogging = false, int timeout = -1); #endif // PLATFORM_UNIX +/*! + * \brief Allows printing std::optional objects so those can be asserted using CPPUNIT_ASSERT_EQUAL. + */ +template > * = nullptr> +inline std::ostream &operator<<(std::ostream &out, const Optional &optional) +{ + if (optional.has_value()) { + return out << *optional; + } else { + return out << "[no value]"; + } +} + /*! * \brief The AsHexNumber class allows printing values asserted with cppunit (or similar test framework) using the * hex system in the error case.