Commit edcd6e82 authored by Carsten Kemena's avatar Carsten Kemena

fixed tests

parent aaf64d96
......@@ -14,7 +14,6 @@ BOOST_AUTO_TEST_SUITE(Encode_Test)
BOOST_AUTO_TEST_CASE(test)
{
//auto alphabet = alphabet2bit20;
std::string name = "";
std::string seqq = "ATSPGNDEQKRHYWFMLIVCg";
BioSeqDataLib::Sequence<> seq(name, seqq, "", "");
......@@ -22,12 +21,11 @@ BOOST_AUTO_TEST_CASE(test)
PrefixType prefix = 0;
CodedSuffix suffix(0,0);
//auto a =
auto success = getCompletePrefixSuffix(seq, 0, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
std::bitset<32> prefix_target(std::string("000000000100010000110010000101"));
std::bitset<60> suffix_target(std::string("001100011101000010010101001011011000110101110011111000010001"));
std::bitset<16> prefix_target(std::string("000001001010000"));
std::bitset<32> suffix_target(std::string("011011011011100100101110110110"));
BOOST_CHECK_EQUAL(prefix, prefix_target.to_ulong());
BOOST_CHECK_EQUAL(suffix.suffix, suffix_target.to_ulong());
......@@ -35,44 +33,37 @@ BOOST_AUTO_TEST_CASE(test)
success = getNextPrefixSuffix(seq, 1, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
std::bitset<32> prefix_target2(std::string("000010001000011001000010100110"));
std::bitset<60> suffix_target2(std::string("001110100001001010100101101100011010111001111100001000110010"));
//std::cout << std::bitset< 60 >( suffix.suffix ).to_string() << "\n";
std::bitset<16> prefix_target2(std::string("001001010000011"));
std::bitset<32> suffix_target2(std::string("011011011100100101110110110111"));
BOOST_CHECK_EQUAL(prefix, prefix_target2.to_ulong());
BOOST_CHECK_EQUAL(suffix.suffix, suffix_target2.to_ulong());
success = getNextPrefixSuffix(seq, 2, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
success = getNextPrefixSuffix(seq, 3, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
success = getNextPrefixSuffix(seq, 4, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
success = getNextPrefixSuffix(seq, 5, prefix, suffix);
BOOST_CHECK_EQUAL(success, true);
success = getNextPrefixSuffix(seq, 6, prefix, suffix);
BOOST_CHECK_EQUAL(success, false);
}
/*
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
*/
BOOST_AUTO_TEST_SUITE_END()
......
......@@ -111,10 +111,11 @@ BOOST_AUTO_TEST_CASE(cleanDB)
db.emplace(std::piecewise_construct, std::forward_as_tuple(36,0), std::forward_as_tuple(8));
db.emplace(std::piecewise_construct, std::forward_as_tuple(39,0), std::forward_as_tuple(7));
db.emplace(std::piecewise_construct, std::forward_as_tuple(40,0), std::forward_as_tuple(0));
BOOST_CHECK_EQUAL(db.size(), 15);
cleanSuffixe(db);
BOOST_CHECK_EQUAL(db.size(), 5);
BOOST_CHECK_EQUAL(db.size(), 4);
auto it = db.begin();
BOOST_CHECK_EQUAL(it->first.suffix, 5);
BOOST_CHECK_EQUAL(it->second, 8);
......@@ -122,9 +123,9 @@ BOOST_AUTO_TEST_CASE(cleanDB)
BOOST_CHECK_EQUAL(it->first.suffix, 10);
BOOST_CHECK_EQUAL(it->second, 8);
++it;
BOOST_CHECK_EQUAL(it->first.suffix, 30);
/*BOOST_CHECK_EQUAL(it->first.suffix, 30); removed in last cleaning
BOOST_CHECK_EQUAL(it->second, 0);
++it;
++it;*/
BOOST_CHECK_EQUAL(it->first.suffix, 34);
BOOST_CHECK_EQUAL(it->second, 8);
++it;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment