-#define BOOST_AUTO_TEST_MAIN
-#include <boost/test/auto_unit_test.hpp>
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE test_annotations
+#include <boost/test/unit_test.hpp>
#include <boost/shared_ptr.hpp>
#include "annotations.hpp"
BOOST_CHECK_THROW( asp->get("not there"), annotations_key_error );
}
+
+BOOST_AUTO_TEST_CASE( annotations_getdefault_metadata )
+{
+ boost::shared_ptr<Annotations> asp(new Annotations("asp"));
+ asp->set("header", "> amsp");
+
+ BOOST_CHECK_EQUAL( asp->size(), 2 );
+ BOOST_CHECK_EQUAL( asp->getdefault("header", "foo"), "> amsp" );
+ BOOST_CHECK_EQUAL( asp->getdefault("not there", "foo"), "foo" );
+}
BOOST_AUTO_TEST_CASE( annotations_has_key )
{
boost::shared_ptr<Annotations> asp(new Annotations("asp"));
BOOST_CHECK_EQUAL(asp->has_key("header"), true);
BOOST_CHECK_EQUAL(asp->has_key("name"), true);
BOOST_CHECK_EQUAL(asp->has_key("secret"), false);
-}
\ No newline at end of file
+}
+