X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Ftest%2Fmodelidentifiertest.cpp;h=b4848cc30326410550b9fea3fe23e4ede54bebf5;hb=69cfdf79b7597ee6133dc3add1a759bc94861fa6;hp=1e5563f1993ffe391a38b18cbdbfb373f4ff0db5;hpb=868e1b08fbbd49e489dc1349cb3657521c5c1dd9;p=germs.git diff --git a/src/test/modelidentifiertest.cpp b/src/test/modelidentifiertest.cpp index 1e5563f..b4848cc 100644 --- a/src/test/modelidentifiertest.cpp +++ b/src/test/modelidentifiertest.cpp @@ -4,10 +4,12 @@ #include #include #include +#include #include #include #include + using namespace std; /* @@ -18,13 +20,8 @@ using namespace std; #define TESTNAME ModelIdentifierTest -typedef pair modelpair; +typedef pair modelpair; -struct ModelCmp { - bool operator()(modelpair m1, modelpair m2){ - return m1.second < m2.second; - } -}; class TESTNAME : public CPPUNIT_NS::TestFixture { @@ -65,24 +62,20 @@ protected: ModelIdentifier mi("default.ann"); GeneOrder axis(_1axis.begin(),_1axis.end()); - map scores = mi.identify(axis); - priority_queue, ModelCmp > pq(scores.begin(),scores.end()); - CPPUNIT_ASSERT_EQUAL(ModelIdentifier::X,pq.top().first); + priority_queue pq = mi.identify(axis); + CPPUNIT_ASSERT_EQUAL(string("X"),string(pq.top().second.name())); GeneOrder uniform(_uniform.begin(),_uniform.end()); - scores = mi.identify(uniform); - pq = priority_queue, ModelCmp >(scores.begin(),scores.end()); - CPPUNIT_ASSERT_EQUAL(ModelIdentifier::Whirl,pq.top().first); + pq = mi.identify(uniform); + CPPUNIT_ASSERT_EQUAL(string("Whirl"),string(pq.top().second.name())); GeneOrder zipper(_zipper.begin(),_zipper.end()); - scores = mi.identify(zipper); - pq = priority_queue, ModelCmp >(scores.begin(),scores.end()); - CPPUNIT_ASSERT_EQUAL(ModelIdentifier::Zipper,pq.top().first); + pq = mi.identify(zipper); + CPPUNIT_ASSERT_EQUAL(string("Zipper"),string(pq.top().second.name())); GeneOrder transpos(_transpos.begin(),_transpos.end()); - scores = mi.identify(transpos); - pq = priority_queue, ModelCmp >(scores.begin(),scores.end()); - CPPUNIT_ASSERT_EQUAL(ModelIdentifier::Cloud,pq.top().first); + pq = mi.identify(transpos); + CPPUNIT_ASSERT_EQUAL(string("Cloud"),string(pq.top().second.name())); } };