+#ifndef _TEST_SEQUENCE_DESCRIPTION_HPP_
+#define _TEST_SEQUENCE_DESCRIPTION_HPP_
+
+#include <QtGui>
+#include <QtTest/QtTest>
+
+#include "alg/sequence.hpp"
+#include "alg/glsequence.hpp"
+#include "alg/annotation_colors.hpp"
+#include "qui/seqbrowser/SequenceDescription.hpp"
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+class TestSequenceDescription : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testSimple() {
+ 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()->get_species() == glseq1->get_species());
+ sd.setName(std::string("bar"));
+ QVERIFY(sd.glsequence()->get_species() == glseq1->get_species());
+ QVERIFY(seq1.get_species() != "bar");
+ QVERIFY(glseq1->get_species() == "bar");
+ }
+ void testDeletedPointer() {
+ SequenceDescription sd;
+
+ {
+ boost::shared_ptr<Sequence> seq1(new Sequence("AAGGCCTT"));
+ Sequence m("AAGG");
+ seq1->find_motif(m);
+ seq1->set_species("foo");
+ boost::shared_ptr<AnnotationColors> cm(new AnnotationColors);
+ boost::shared_ptr<GlSequence> glseq1(new GlSequence(*seq1, cm));
+ sd.setGlSequence(glseq1);
+ }
+
+ QVERIFY(sd.name() == "foo");
+ }
+};
+#endif