define window for showing a mussa alignment
[mussa.git] / alg / test / test_conserved_path.cpp
index b28c63573f63bde8d86a3e4e433ff199b9ec1954..ec1b54cde5fec5a872ea2819d10d7539e31045a6 100644 (file)
@@ -63,6 +63,26 @@ BOOST_AUTO_TEST_CASE ( conserved_path_vector )
   BOOST_CHECK_EQUAL( cp.size(), 1 );
 }
 
+// does the reverse compliment test work?
+BOOST_AUTO_TEST_CASE ( conserved_path_reverse_compliment ) 
+{
+  vector<int> path;
+  path += 3,4,-5,1; // magic from boost assign
+
+  ConservedPath cp1(10, path);
+  vector<bool> reversed = cp1.reverseComplimented();
+
+  BOOST_CHECK_EQUAL( path.size(), reversed.size());
+  vector<int>::iterator path_i = path.begin();
+  vector<bool>::iterator reversed_i = reversed.begin();
+  for(; path_i != path.end() and reversed_i != reversed.end(); 
+      ++path_i, ++reversed_i)
+  {
+    // if we're less than zero our reversed flag should be true
+    BOOST_CHECK_EQUAL( *path_i < 0, *reversed_i);
+  }
+}
+
 BOOST_AUTO_TEST_CASE ( extended_conserved_path_simple ) 
 {
   vector<int> path;