Store Sequence sequence location in a shared_ptr class
[mussa.git] / alg / test / test_sequence.cpp
index 19904d0df26e700d867dd2944fd2bfca2f805f5c..3847252a80884fa06786afe18feb7cf7f387a1e4 100644 (file)
@@ -1,3 +1,4 @@
+#define BOOST_AUTO_TEST_MAIN
 #include <boost/test/auto_unit_test.hpp>
 #include <boost/filesystem/path.hpp>
 #include <boost/filesystem/operations.hpp>
@@ -26,6 +27,24 @@ BOOST_AUTO_TEST_CASE( sequence_get_sequence )
        BOOST_CHECK_EQUAL(s.get_sequence(), std::string() );
 }
 
+BOOST_AUTO_TEST_CASE( sequence_from_string )
+{
+  std::string str1("AAAT");
+  Sequence seq1(str1);
+  BOOST_CHECK_EQUAL(seq1.get_sequence(), str1);
+} 
+
+BOOST_AUTO_TEST_CASE( sequence_find_first_not_of )
+{
+  std::string str1("AAAAT");
+  Sequence seq1(str1);
+  BOOST_CHECK_EQUAL(seq1.find_first_not_of("A"), str1.find_first_not_of("A"));
+  
+  std::string str2("AATTGGCC");
+  Sequence seq2(str2);
+  BOOST_CHECK_EQUAL(seq2.find_first_not_of("qwer"), str2.find_first_not_of("qwer"));
+}
+
 //! when we try to load a missing file, do we get an error?
 BOOST_AUTO_TEST_CASE( sequence_load_exception )
 {
@@ -946,5 +965,5 @@ BOOST_AUTO_TEST_CASE( serialize_xml_two )
   BOOST_CHECK_EQUAL(seq1_loaded, seq1);
   BOOST_CHECK_EQUAL(seq2_loaded, seq2);
   // test if our pointers are the same
-  BOOST_CHECK_EQUAL(seq1_loaded.c_str(), seq2_loaded.c_str());
+  BOOST_CHECK_EQUAL(seq1_loaded.data(), seq2_loaded.data());
 }