1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "base/perfdatavalue.hpp"
4 #include "base/dictionary.hpp"
5 #include "base/objectlock.hpp"
6 #include "base/application.hpp"
7 #include "base/type.hpp"
8 #include <BoostTestTargetConfig.h>
10 using namespace icinga;
12 BOOST_AUTO_TEST_SUITE(base_type)
14 BOOST_AUTO_TEST_CASE(gettype)
16 Type::Ptr t = Type::GetByName("Application");
21 BOOST_AUTO_TEST_CASE(assign)
23 Type::Ptr t1 = Type::GetByName("Application");
24 Type::Ptr t2 = Type::GetByName("ConfigObject");
26 BOOST_CHECK(t1->IsAssignableFrom(t1));
27 BOOST_CHECK(t2->IsAssignableFrom(t1));
28 BOOST_CHECK(!t1->IsAssignableFrom(t2));
31 BOOST_AUTO_TEST_CASE(byname)
33 Type::Ptr t = Type::GetByName("Application");
38 BOOST_AUTO_TEST_CASE(instantiate)
40 Type::Ptr t = Type::GetByName("PerfdataValue");
42 Object::Ptr p = t->Instantiate(std::vector<Value>());
47 BOOST_AUTO_TEST_SUITE_END()