From: Uwe Hermann Date: Tue, 8 Jan 2019 22:10:37 +0000 (+0100) Subject: Add tests/init.cpp and first unit test. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5b6e7c40e213f4e78e51c84dba699249209f80b2;p=libsigrokflow.git Add tests/init.cpp and first unit test. --- diff --git a/Makefile.am b/Makefile.am index 5370af1..533813a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,7 +45,8 @@ check_PROGRAMS = tests/main tests_main_SOURCES = \ include/libsigrokflow/libsigrokflow.hpp \ - tests/main.cpp + tests/main.cpp \ + tests/init.cpp tests_main_LDADD = libsigrokflow.la $(LIBSIGROKFLOW_LIBS) diff --git a/tests/init.cpp b/tests/init.cpp new file mode 100644 index 0000000..18b7438 --- /dev/null +++ b/tests/init.cpp @@ -0,0 +1,32 @@ +/* + * This file is part of the libsigrokflow project. + * + * Copyright (C) 2018 Uwe Hermann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +TEST_CASE("init/deinit", "[init]") +{ + REQUIRE_NOTHROW(Gst::init()); + + SECTION("Srf::init() after successful Gst::init() should not throw") { + CHECK_NOTHROW(Srf::init()); + } + + REQUIRE_NOTHROW(Gst::deinit()); +}