1 #define BOOST_AUTO_TEST_MAIN
2 #include <boost/test/auto_unit_test.hpp>
3 #include <boost/filesystem/path.hpp>
4 namespace fs = boost::filesystem;
9 #include "alg/sequence.hpp"
10 #include "paircomp.hh"
14 BOOST_AUTO_TEST_CASE( simple_nxn_comparison )
16 std::string s(10, 'A');
20 paircomp::ImmutableComparison *cmp;
21 // Make sure we called the string constructor correctly
22 BOOST_REQUIRE_EQUAL( s1.size(), 10 );
23 BOOST_REQUIRE_EQUAL( s2.size(), 10 );
24 cmp = paircomp::simple_nxn_comparison<Sequence>(s1, s2, 10, 0.10);
26 BOOST_CHECK_EQUAL( cmp->is_empty(), false);
27 const paircomp::_MatchContainer *matches = cmp->get_matches(0);
28 BOOST_REQUIRE( matches != 0);
29 BOOST_CHECK_EQUAL( matches->num, 1 );
32 BOOST_AUTO_TEST_CASE( simple_nxn_comparison_mixed_case )
34 Sequence s1("AtGGcT");
35 Sequence s2("aTggCt");
37 paircomp::ImmutableComparison *cmp;
38 // Make sure we called the string constructor correctly
39 BOOST_REQUIRE_EQUAL( s1.size(), 6 );
40 BOOST_REQUIRE_EQUAL( s2.size(), 6 );
41 cmp = paircomp::simple_nxn_comparison<Sequence>(s1, s2, 6, 1.0);
43 BOOST_CHECK_EQUAL( cmp->is_empty(), false);
44 const paircomp::_MatchContainer *matches = cmp->get_matches(0);
45 BOOST_REQUIRE( matches != 0);
46 BOOST_CHECK_EQUAL( matches->num, 1 );