1 #ifndef _TEST_SEQUENCE_DESCRIPTION_HPP_
2 #define _TEST_SEQUENCE_DESCRIPTION_HPP_
5 #include <QtTest/QtTest>
7 #include "alg/sequence.hpp"
8 #include "alg/glsequence.hpp"
9 #include "alg/annotation_colors.hpp"
10 #include "qui/seqbrowser/SequenceDescription.hpp"
16 class TestSequenceDescription : public QObject
22 Sequence seq1(new Sequence("AAGGCCTT"));
23 seq1.set_species("foo");
24 boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
25 // this is now a copy of the original sequence... which
26 // means changes to the shared GlSequence wont do anything to Sequence
27 boost::shared_ptr<GlSequence> glseq1(new GlSequence(seq1, cm));
29 SequenceDescription sd(glseq1, 0);
30 QVERIFY(sd.glsequence() == glseq1);
31 QVERIFY(sd.glsequence()->get_species() == glseq1->get_species());
32 sd.setName(std::string("bar"));
33 QVERIFY(sd.glsequence()->get_species() == glseq1->get_species());
34 QVERIFY(seq1.get_species() != "bar");
35 QVERIFY(glseq1->get_species() == "bar");
37 void testDeletedPointer() {
38 SequenceDescription sd;
41 boost::shared_ptr<Sequence> seq1(new Sequence("AAGGCCTT"));
44 seq1->set_species("foo");
45 boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
46 boost::shared_ptr<GlSequence> glseq1(new GlSequence(*seq1, cm));
47 sd.setGlSequence(glseq1);
50 QVERIFY(sd.name() == "foo");