Commit 520a3f55 authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud
Browse files

testScore: Test ReadQualityScore

parent 5ca7d62c
......@@ -16,4 +16,28 @@ void testScore() {
TAP_TEST(rls.getScore(seq3) == 1., TEST_LENGTH_SCORE,
"score should be 1, is " << rls.getScore(seq3));
// ReadQualityScore testing
ReadQualityScore rqs;
Sequence seq4 = {"s", "s", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII", NULL, 0};
TAP_TEST((int) rqs.getScore(seq4) == (int) (41 * 120/ GOOD_QUALITY), TEST_QUALITY_SCORE,
"score should be " << (int) (41 * 120/ GOOD_QUALITY) << " not " << rqs.getScore(seq4));
// Changing the quality, put the percentile should not change yet.
seq4.quality[10] = '-';
TAP_TEST((int) rqs.getScore(seq4) == (int) (41 * 120/ GOOD_QUALITY), TEST_QUALITY_SCORE,
"score should be " << (int) (41 * 120/ GOOD_QUALITY) << " not " << rqs.getScore(seq4));
// Now the percentile value should change and should correspond to '-'
seq4.quality[22] = '!';
TAP_TEST((int) rqs.getScore(seq4) == (int) (('-' - ' ') * 120/ GOOD_QUALITY), TEST_QUALITY_SCORE,
"score should be " << (int) (('-' - ' ') * 120/ GOOD_QUALITY) << " not " << rqs.getScore(seq4));
// Quality does not exist anymore → the score is the length
seq4.quality = "";
TAP_TEST(rqs.getScore(seq4) == 120, TEST_QUALITY_SCORE,
"score should be 120 not " << rqs.getScore(seq4));
}
......@@ -90,6 +90,7 @@ enum {
/* Score */
TEST_LENGTH_SCORE,
TEST_QUALITY_SCORE,
/* Chooser */
TEST_READ_CHOOSER_BEST,
......@@ -243,6 +244,7 @@ inline void declare_tests() {
RECORD_TAP_TEST(TEST_CLUSTER, "Test automatic clusterisation");
RECORD_TAP_TEST(TEST_LENGTH_SCORE, "Test ReadLengthScore getScore()");
RECORD_TAP_TEST(TEST_QUALITY_SCORE, "Test ReadQualityScore getScore()");
RECORD_TAP_TEST(TEST_READ_CHOOSER_BEST, "Test getBest() in ReadChooser");
RECORD_TAP_TEST(TEST_READ_CHOOSER_SORTED, "Test getSorted() in ReadChooser");
......
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