diff options
author | louiz’ <louiz@louiz.org> | 2017-03-06 03:04:26 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-06 03:04:26 +0100 |
commit | a1349361d2c15929e8260536c9091f2a4c2048a4 (patch) | |
tree | a2eb734566a7ae708a705b071f04cc2f20bb2e0e /tests/utils.cpp | |
parent | ef3c6c28dd1f58ad60928487115a9124ffb99266 (diff) | |
parent | 11c63ebceb07d9b65ed16182139477ea79739c12 (diff) | |
download | biboumi-a1349361d2c15929e8260536c9091f2a4c2048a4.tar.gz biboumi-a1349361d2c15929e8260536c9091f2a4c2048a4.tar.bz2 biboumi-a1349361d2c15929e8260536c9091f2a4c2048a4.tar.xz biboumi-a1349361d2c15929e8260536c9091f2a4c2048a4.zip |
Merge branch 'master' into debian
Diffstat (limited to 'tests/utils.cpp')
-rw-r--r-- | tests/utils.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/utils.cpp b/tests/utils.cpp index 48951da..b8a3e75 100644 --- a/tests/utils.cpp +++ b/tests/utils.cpp @@ -8,6 +8,8 @@ #include <utils/empty_if_fixed_server.hpp> #include <utils/get_first_non_empty.hpp> #include <utils/time.hpp> +#include <utils/system.hpp> +#include <utils/scopeguard.hpp> using namespace std::string_literals; @@ -140,3 +142,19 @@ TEST_CASE("parse_datetime") CHECK(utils::parse_datetime("1970-01-02T00:00:12*00:00") == -1); CHECK(utils::parse_datetime("1970-01-02T00:00:12+0000") == -1); } + +TEST_CASE("scope_guard") +{ + bool res = false; + { + auto guard = utils::make_scope_guard([&res](){ res = true; }); + CHECK(!res); + } + CHECK(res); +} + +TEST_CASE("system_name") +{ + CHECK(utils::get_system_name() != "Unknown"); + CHECK(!utils::get_system_name().empty()); +}
\ No newline at end of file |