Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / alg / test / test_sequence_location.cpp
1 #define BOOST_TEST_DYN_LINK
2 #define BOOST_TEST_MODULE
3 #include <boost/test/unit_test.hpp>
4
5 #include "alg/sequence_location.hpp"
6 #include "alg/sequence.hpp"
7
8 BOOST_AUTO_TEST_CASE( basic_sequence_location )
9 {
10   Sequence s("AAGGCCTT");
11
12   SequenceLocation sl(s, 0, 2);
13
14   BOOST_CHECK_EQUAL( sl.getLeft(), 0 );
15   BOOST_CHECK_EQUAL( sl.getRight(), 2 );
16   BOOST_CHECK_EQUAL( sl.getCount(), 2 );
17
18   sl.setLeft(1);
19   sl.setRight(3);
20
21   BOOST_CHECK_EQUAL( sl.getLeft(), 1 );
22   BOOST_CHECK_EQUAL( sl.getRight(), 3 );
23   BOOST_CHECK_EQUAL( sl.getCount(), 2 );
24 }
25
26 BOOST_AUTO_TEST_CASE( memory_test )
27 {
28   SequenceLocation *sl;
29   // storing references is a bad idea
30   {
31     Sequence s("AAGGCCTT");
32     sl = new SequenceLocation(s, 0, 2);
33   }
34
35   BOOST_CHECK_EQUAL(sl->getSequence(), "AAGGCCTT");
36   BOOST_CHECK_EQUAL(sl->getSelectedSequence(), "AA");
37 }