X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=tests%2Finit.cpp;h=0c4c47d94cfdd57bdd099183292da5eb3c66f088;hb=HEAD;hp=89cb23e23dee71f9842b1ac6e6dae4bf1be623c5;hpb=7dc59fc4a38b6032158d2551cd3c449fe5e87e62;p=libsigrokflow.git diff --git a/tests/init.cpp b/tests/init.cpp index 89cb23e..0c4c47d 100644 --- a/tests/init.cpp +++ b/tests/init.cpp @@ -22,6 +22,10 @@ TEST_CASE("init/deinit", "[init]") { + SECTION("Srf::init() before successful Gst::init() should throw") { + CHECK_THROWS(Srf::init()); + } + REQUIRE_NOTHROW(Gst::init()); SECTION("Srf::init() after successful Gst::init() should not throw") { @@ -29,6 +33,15 @@ TEST_CASE("init/deinit", "[init]") SECTION("Multiple Srf::init() calls should throw") { for (int i = 0; i < 10; ++i) CHECK_THROWS(Srf::init()); + CHECK_NOTHROW(Srf::deinit()); + } + SECTION("Srf::deinit() should not throw") { + CHECK_NOTHROW(Srf::deinit()); + } + SECTION("Multiple Srf::deinit() calls should throw") { + CHECK_NOTHROW(Srf::deinit()); + for (int i = 0; i < 10; ++i) + CHECK_THROWS(Srf::deinit()); } }