COMPILE_FLAGS "-DEXAMPLE_DIR=\\\"${EXAMPLE_DIR}\\\" ${ALG_TEST_CFLAGS}"
)
ADD_EXECUTABLE(${basename} ${${basename}_SRC})
- TARGET_LINK_LIBRARIES(${basename} ${ALG_TEST_LIBS}) # ${${basename}_extra_libs})
+ TARGET_LINK_LIBRARIES(${basename} ${ALG_TEST_LIBS})
SET_TARGET_PROPERTIES(
${basename}
MAKE_ALG_UNITTEST( test_nway )
MAKE_ALG_UNITTEST( test_sequence )
MAKE_ALG_UNITTEST( test_sequence_location )
+
+IF(USE_PAIRCOMP)
+ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/paircomp/lib )
+ MAKE_ALG_UNITTEST( test_paircomp )
+ TARGET_LINK_LIBRARIES( test_paircomp paircomplib )
+ENDIF(USE_PAIRCOMP)
--- /dev/null
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
+
+#include <string>
+#include <iostream>
+
+#include "alg/sequence.hpp"
+#include "paircomp.hh"
+
+using namespace std;
+
+BOOST_AUTO_TEST_CASE( simple_nxn_comparison )
+{
+ std::string s(10, 'A');
+ Sequence s1(s);
+ Sequence s2(s);
+
+ paircomp::ImmutableComparison *cmp;
+ // Make sure we called the string constructor correctly
+ BOOST_REQUIRE_EQUAL( s1.size(), 10 );
+ BOOST_REQUIRE_EQUAL( s2.size(), 10 );
+ cmp = paircomp::simple_nxn_comparison<Sequence>(s1, s2, 10, 0.10);
+
+ BOOST_CHECK_EQUAL( cmp->is_empty(), false);
+ const paircomp::_MatchContainer *matches = cmp->get_matches(0);
+ BOOST_REQUIRE( matches != 0);
+ BOOST_CHECK_EQUAL( matches->num, 1 );
+}
+
+BOOST_AUTO_TEST_CASE( simple_nxn_comparison_mixed_case )
+{
+ Sequence s1("AtGGcT");
+ Sequence s2("aTggCt");
+
+ paircomp::ImmutableComparison *cmp;
+ // Make sure we called the string constructor correctly
+ BOOST_REQUIRE_EQUAL( s1.size(), 6 );
+ BOOST_REQUIRE_EQUAL( s2.size(), 6 );
+ cmp = paircomp::simple_nxn_comparison<Sequence>(s1, s2, 6, 1.0);
+
+ BOOST_CHECK_EQUAL( cmp->is_empty(), false);
+ const paircomp::_MatchContainer *matches = cmp->get_matches(0);
+ BOOST_REQUIRE( matches != 0);
+ BOOST_CHECK_EQUAL( matches->num, 1 );
+}
\ No newline at end of file