Commit 6eafafcc authored by Carsten Kemena's avatar Carsten Kemena

adjusted tests to new methodolgy

parent c6d4b13a
......@@ -26,8 +26,8 @@ BOOST_AUTO_TEST_CASE(test)
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,8 +35,8 @@ 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::bitset<16> prefix_target2(std::string("001001010000011"));
std::bitset<32> suffix_target2(std::string("011011011100100101110110110111"));
//std::cout << std::bitset< 60 >( suffix.suffix ).to_string() << "\n";
BOOST_CHECK_EQUAL(prefix, prefix_target2.to_ulong());
BOOST_CHECK_EQUAL(suffix.suffix, suffix_target2.to_ulong());
......@@ -44,11 +44,37 @@ BOOST_AUTO_TEST_CASE(test)
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);
}
// aa 8
static const std::unordered_map<char, PrefixType> alphabet2bit8 =
{
{'A', 0}, {'T', 1}, {'S', 1}, {'P', 2}, {'G', 0}, {'N', 3},
{'D', 3}, {'E', 3}, {'Q', 3}, {'K', 4}, {'R', 4}, {'H', 5},
{'Y', 6}, {'W', 6}, {'F', 6}, {'M', 7}, {'L', 7}, {'I', 7},
{'V', 7}, {'C', 7}
};
/*
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
*/
/*
00000
......
......@@ -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