X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Ftest%2Ftest_annotations.cpp;h=2e4cb50642e6871858df209ea8234952332ebcbd;hp=8bb0bea6407778ae365ecd61dc757a3f1dcd58e1;hb=f3c0553a22b0e4ddc39ee45f51725352d92e97f1;hpb=2dea10e86e45dfef6deb896be3fb14343e1f4006 diff --git a/alg/test/test_annotations.cpp b/alg/test/test_annotations.cpp index 8bb0bea..2e4cb50 100644 --- a/alg/test/test_annotations.cpp +++ b/alg/test/test_annotations.cpp @@ -53,6 +53,16 @@ BOOST_AUTO_TEST_CASE( annotations_get_metadata ) BOOST_CHECK_THROW( asp->get("not there"), annotations_key_error ); } + +BOOST_AUTO_TEST_CASE( annotations_getdefault_metadata ) +{ + boost::shared_ptr 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 asp(new Annotations("asp")); @@ -61,4 +71,5 @@ BOOST_AUTO_TEST_CASE( annotations_has_key ) 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 +} +