diff --git a/Makefile.am b/Makefile.am index bbb11c2bc..4e80c72c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,7 +68,7 @@ check-coverage: all lcov -d . -z make check lcov -d . -c -o icinga2.info - lcov -e icinga2.info -o icinga2-filtered.info `pwd`\* + lcov -e icinga2.info -o icinga2-filtered.info "`readlink -f $(top_srcdir)`/*" mkdir -p docs/lcov genhtml -o docs/lcov icinga2-filtered.info diff --git a/test/Makefile.am b/test/Makefile.am index 3199fca59..4aa1963c8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,6 +12,7 @@ icinga2_test_SOURCES = \ base-convert.cpp \ base-dictionary.cpp \ base-fifo.cpp \ + base-match.cpp \ base-object.cpp \ base-shellescape.cpp \ base-timer.cpp diff --git a/test/base-match.cpp b/test/base-match.cpp new file mode 100644 index 000000000..84ae92e97 --- /dev/null +++ b/test/base-match.cpp @@ -0,0 +1,36 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * 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 2 * + * 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, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "base/utility.h" +#include + +using namespace icinga; + +BOOST_AUTO_TEST_SUITE(base_match) + +BOOST_AUTO_TEST_CASE(tolong) +{ + BOOST_CHECK(Utility::Match("*", "hello")); + BOOST_CHECK(!Utility::Match("world", "hello")); + BOOST_CHECK(!Utility::Match("hee*", "hello")); + BOOST_CHECK(Utility::Match("he??o", "hello")); + BOOST_CHECK(Utility::Match("he?", "hel")); +} + +BOOST_AUTO_TEST_SUITE_END()