private slots:
void testSimple() {
- boost::shared_ptr<Sequence> seq1(new Sequence("AAGGCCTT"));
- seq1->set_species("foo");
+ Sequence seq1(new Sequence("AAGGCCTT"));
+ seq1.set_species("foo");
boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
+ // this is now a copy of the original sequence... which
+ // means changes to the shared GlSequence wont do anything to Sequence
boost::shared_ptr<GlSequence> glseq1(new GlSequence(seq1, cm));
SequenceDescription sd(glseq1, 0);
QVERIFY(sd.glsequence() == glseq1);
- QVERIFY(sd.glsequence()->sequence()->get_species() == seq1->get_species());
+ QVERIFY(sd.glsequence()->get_species() == glseq1->get_species());
sd.setName(std::string("bar"));
- QVERIFY(sd.glsequence()->sequence()->get_species() == seq1->get_species());
- QVERIFY(seq1->get_species() == "bar");
+ QVERIFY(sd.glsequence()->get_species() == glseq1->get_species());
+ QVERIFY(seq1.get_species() != "bar");
+ QVERIFY(glseq1->get_species() == "bar");
}
void testDeletedPointer() {
SequenceDescription sd;
seq1->find_motif(m);
seq1->set_species("foo");
boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
- boost::shared_ptr<GlSequence> glseq1(new GlSequence(seq1, cm));
+ boost::shared_ptr<GlSequence> glseq1(new GlSequence(*seq1, cm));
sd.setGlSequence(glseq1);
}