diff --git a/Makefile.am b/Makefile.am index 3b14e5578..4b43ee578 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,8 @@ SUBDIRS = \ jsonrpc \ icinga \ components \ - icinga-app + icinga-app \ + test icinga2docdir = ${prefix}/share/doc/icinga2 icinga2doc_DATA = \ diff --git a/base/delegate.h b/base/delegate.h index 81ee3f6b3..f1aa22e10 100644 --- a/base/delegate.h +++ b/base/delegate.h @@ -37,7 +37,7 @@ int delegate_fwd(int (TObject::*function)(TArgs), weak_ptr wref, TArgs template function bind_weak(int (TObject::*function)(TArgs), const weak_ptr& wref) { - return bind(&delegate_fwd, function, wref, _1); + return bind(&delegate_fwd, function, wref, placeholders::_1); } template diff --git a/compat/Makefile.am b/compat/Makefile.am index 229d9e1a2..267c1c6c8 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -1,9 +1,10 @@ EXTRA_DIST=include -dist-hook: - mkdir -p boost && \ +include: + rm -Rf boost && mkdir -p boost && \ bcp --boost=$(BOOST_PATH)/include tr1 smart_ptr bind function make_shared boost && \ - rm -Rf include && \ - mkdir include && \ - mv boost/boost include/ && \ - rm -Rf boost + rm -Rf include && mkdir include && \ + mv boost/boost include/ + +clean: + rm -Rf include diff --git a/configure.ac b/configure.ac index 48263587e..d0df6c4e1 100644 --- a/configure.ac +++ b/configure.ac @@ -37,11 +37,7 @@ AX_CXX_COMPILE_STDCXX_0X AX_CXX_GCC_ABI_DEMANGLE AX_PTHREAD -<<<<<<< Updated upstream -LT_INIT([dlopen disable-static]) -======= LT_INIT([dlopen shared disable-static win32-dll]) ->>>>>>> Stashed changes LT_CONFIG_LTDL_DIR([ltdl]) LTDL_INIT @@ -93,5 +89,6 @@ icinga/Makefile icinga-app/Makefile jsonrpc/Makefile mmatch/Makefile +test/Makefile Doxyfile ]) diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 000000000..7c4cce695 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,20 @@ +## Process this file with automake to produce Makefile.in + +TESTS = \ + base-dictionary + +check_PROGRAMS = \ + base-dictionary + +base_dictionary_SOURCES = \ + base-dictionary.cpp + +base_dictionary_CXXFLAGS = \ + $(BOOST_CPPFLAGS) \ + -I${top_srcdir}/base \ + -I${top_srcdir} + +base_dictionary_LDADD = \ + $(BOOST_LDFLAGS) \ + $(BOOST_UNIT_TEST_FRAMEWORK_LIB) \ + ${top_builddir}/base/libbase.la diff --git a/test/base-dictionary.cpp b/test/base-dictionary.cpp new file mode 100644 index 000000000..62b8012d2 --- /dev/null +++ b/test/base-dictionary.cpp @@ -0,0 +1,27 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE base_dictionary +#include + +#include +using namespace icinga; + +BOOST_AUTO_TEST_CASE(construct) +{ + Dictionary::Ptr dictionary = make_shared(); + BOOST_REQUIRE(dictionary); +} + +BOOST_AUTO_TEST_CASE(setproperty) +{ + Dictionary::Ptr dictionary = make_shared(); + dictionary->SetProperty("test1", 7); + dictionary->SetProperty("test2", "hello world"); + + long test1; + BOOST_REQUIRE(dictionary->GetProperty("test1", &test1)); + BOOST_REQUIRE(test1 == 7); + + string test2; + BOOST_REQUIRE(dictionary->GetProperty("test2", &test2)); + BOOST_REQUIRE(test2 == "hello world"); +}