2 #include <QtTest/QtTest>
4 #include "alg/sequence.hpp"
5 #include "alg/glsequence.hpp"
6 #include "alg/annotation_colors.hpp"
7 #include "qui/seqbrowser/SequenceDescription.hpp"
13 class TestSequenceDescription : public QObject
19 boost::shared_ptr<Sequence> seq1(new Sequence("AAGGCCTT"));
20 seq1->set_species("foo");
21 boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
22 boost::shared_ptr<GlSequence> glseq1(new GlSequence(seq1, cm));
24 SequenceDescription sd(glseq1, 0);
25 QVERIFY(sd.glsequence() == glseq1);
26 QVERIFY(sd.glsequence()->sequence()->get_species() == seq1->get_species());
27 sd.setName(std::string("bar"));
28 QVERIFY(sd.glsequence()->sequence()->get_species() == seq1->get_species());
29 QVERIFY(seq1->get_species() == "bar");
31 void testDeletedPointer() {
32 SequenceDescription sd;
35 boost::shared_ptr<Sequence> seq1(new Sequence("AAGGCCTT"));
38 seq1->set_species("foo");
39 boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
40 boost::shared_ptr<GlSequence> glseq1(new GlSequence(seq1, cm));
41 sd.setGlSequence(glseq1);
44 QVERIFY(sd.name() == "foo");
48 QTEST_MAIN(TestSequenceDescription)
49 #include "moc_TestSequenceDescription.cxx"