]> granicus.if.org Git - icinga2/commitdiff
Add more unit tests for the Value class.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Sep 2013 13:11:39 +0000 (15:11 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Sep 2013 13:11:39 +0000 (15:11 +0200)
test/base-object.cpp

index bacead0db5a68ea67f919f380c4287879e8d7f75..678e25f964f5214ef75cc99fb3b5d83e9d92c48f 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "base/object.h"
+#include "base/value.h"
 #include <boost/test/unit_test.hpp>
 #include <boost/smart_ptr/make_shared.hpp>
 
@@ -48,6 +49,10 @@ BOOST_AUTO_TEST_CASE(getself)
        TestObject::Ptr tobject = boost::make_shared<TestObject>();
        TestObject::Ptr tobject_self = tobject->GetTestRef();
        BOOST_CHECK(tobject == tobject_self);
+
+       Value vobject = tobject;
+       BOOST_CHECK(!vobject.IsEmpty());
+       BOOST_CHECK(vobject.IsObjectType<TestObject>());
 }
 
 BOOST_AUTO_TEST_CASE(weak)