X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=alg%2Ftest%2Ftest_annotation_color.cpp;h=15373d89243ee2a4238b08ee4a0d3e1f603d8404;hb=HEAD;hp=af7035b3c1315cba062ea0334f491adf40de83fa;hpb=405a7ba78e41c730ce8efd889e290e959dd93103;p=mussa.git diff --git a/alg/test/test_annotation_color.cpp b/alg/test/test_annotation_color.cpp index af7035b..15373d8 100644 --- a/alg/test/test_annotation_color.cpp +++ b/alg/test/test_annotation_color.cpp @@ -1,4 +1,6 @@ -#include +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_annotation_color +#include #include "alg/annotation_colors.hpp" #include "alg/color.hpp" @@ -25,8 +27,10 @@ BOOST_AUTO_TEST_CASE( simple_annot_colors ) BOOST_CHECK_EQUAL( ac.lookup("bleem", "foo"), black ); BOOST_CHECK_EQUAL( ac.lookup("venchent", "a"), white ); + /* + // Removed as we're phasing out the annot and annotation colors classes annot a; - a.start = 30; + a.begin = 30; a.end = 45; a.type = "bleem"; a.name = "a"; @@ -36,5 +40,28 @@ BOOST_AUTO_TEST_CASE( simple_annot_colors ) BOOST_CHECK_EQUAL( ac.lookup(a), black ); a.type = "venchent"; BOOST_CHECK_EQUAL( ac.lookup(a), white ); + */ + + ac.clear(); + BOOST_CHECK_EQUAL( ac.lookup("bleem", "a"), black); } +// can we assign a color? +BOOST_AUTO_TEST_CASE( annotation_color_assignment ) +{ + Color black(0.0, 0.0, 0.0); + Color white(1.0, 1.0, 1.0); + Color red(1.0, 0.0, 0.0); + + AnnotationColors ac1; + ac1.setColor(white); + ac1.appendTypeColor("bleem", black); + ac1.appendInstanceColor("bleem", "a", red); + + AnnotationColors ac2; + BOOST_CHECK_EQUAL( ac2.color(), black ); + ac2 = ac1; + BOOST_CHECK_EQUAL( ac2.color(), white ); + BOOST_CHECK_EQUAL( ac2.typeColor("bleem"), ac1.typeColor("bleem") ); + BOOST_CHECK_EQUAL( ac2.lookup("bleem","a"), ac1.lookup("bleem","a") ); +}