Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit fd6c7336 authored by Mathieu Giraud's avatar Mathieu Giraud

tests: update tests

The Sequence structure has now an additional field.
parent 4b26eede
...@@ -24,7 +24,7 @@ void testCluster() { ...@@ -24,7 +24,7 @@ void testCluster() {
map<string, string> labels; map<string, string> labels;
WindowsStorage windows = WindowsStorage(labels); WindowsStorage windows = WindowsStorage(labels);
Sequence seq = {"", "", "", "", NULL}; Sequence seq = {"", "", "", "", NULL, 0};
windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT", seq, 0, 0); windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT", seq, 0, 0);
windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", seq, 0, 0); windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", seq, 0, 0);
......
...@@ -13,7 +13,7 @@ void testBinReadStorage() { ...@@ -13,7 +13,7 @@ void testBinReadStorage() {
TAP_TEST(reads.scoreToBin(11) == 3, TEST_BRS_SCORE_TO_BIN, ""); TAP_TEST(reads.scoreToBin(11) == 3, TEST_BRS_SCORE_TO_BIN, "");
TAP_TEST(reads.scoreToBin(5) == 1, TEST_BRS_SCORE_TO_BIN, ""); TAP_TEST(reads.scoreToBin(5) == 1, TEST_BRS_SCORE_TO_BIN, "");
Sequence seq1 = {"label", "l", "GAGAG", "", NULL}; Sequence seq1 = {"label", "l", "GAGAG", "", NULL, 0};
reads.add(seq1); reads.add(seq1);
TAP_TEST(reads.smallest_bin_not_empty == 1, TEST_BRS_SBNE, ""); TAP_TEST(reads.smallest_bin_not_empty == 1, TEST_BRS_SBNE, "");
TAP_TEST(reads.getNbInserted() == 1, TEST_BRS_GET_NB_INSERTED, ""); TAP_TEST(reads.getNbInserted() == 1, TEST_BRS_GET_NB_INSERTED, "");
...@@ -22,7 +22,7 @@ void testBinReadStorage() { ...@@ -22,7 +22,7 @@ void testBinReadStorage() {
&& reads.getScoreByScore(5.) == 5 && reads.getScoreByScore(5.) == 5
&& reads.getScore(1) == 5, TEST_BRS_GET_SCORE, ""); && reads.getScore(1) == 5, TEST_BRS_GET_SCORE, "");
Sequence seq2 = {"label2", "l2", "GA", "", NULL}; Sequence seq2 = {"label2", "l2", "GA", "", NULL, 0};
reads.add(seq2); reads.add(seq2);
TAP_TEST(reads.smallest_bin_not_empty == 0, TEST_BRS_SBNE, ""); TAP_TEST(reads.smallest_bin_not_empty == 0, TEST_BRS_SBNE, "");
TAP_TEST(reads.getNbInserted() == 2, TEST_BRS_GET_NB_INSERTED, ""); TAP_TEST(reads.getNbInserted() == 2, TEST_BRS_GET_NB_INSERTED, "");
...@@ -34,7 +34,7 @@ void testBinReadStorage() { ...@@ -34,7 +34,7 @@ void testBinReadStorage() {
TAP_TEST(reads.getScore() == 7, TEST_BRS_GET_SCORE, ""); TAP_TEST(reads.getScore() == 7, TEST_BRS_GET_SCORE, "");
TAP_TEST(reads.getAverageScore() == 3.5, TEST_BRS_GET_AVG_SCORE, ""); TAP_TEST(reads.getAverageScore() == 3.5, TEST_BRS_GET_AVG_SCORE, "");
Sequence seq3 = {"label3", "l3", "GGAGACAGTA", "", NULL}; Sequence seq3 = {"label3", "l3", "GGAGACAGTA", "", NULL, 0};
reads.add(seq3); reads.add(seq3);
TAP_TEST(reads.smallest_bin_not_empty == 0, TEST_BRS_SBNE, ""); TAP_TEST(reads.smallest_bin_not_empty == 0, TEST_BRS_SBNE, "");
TAP_TEST(reads.getNbInserted() == 3, TEST_BRS_GET_NB_INSERTED, ""); TAP_TEST(reads.getNbInserted() == 3, TEST_BRS_GET_NB_INSERTED, "");
...@@ -43,7 +43,7 @@ void testBinReadStorage() { ...@@ -43,7 +43,7 @@ void testBinReadStorage() {
&& reads.getScoreByScore(10.) == 10 && reads.getScoreByScore(10.) == 10
&& reads.getScore(2) == 10, TEST_BRS_GET_SCORE, ""); && reads.getScore(2) == 10, TEST_BRS_GET_SCORE, "");
Sequence seq4 = {"label4", "l4", "AGAGACAGTA", "", NULL}; Sequence seq4 = {"label4", "l4", "AGAGACAGTA", "", NULL, 0};
reads.add(seq4); reads.add(seq4);
TAP_TEST(reads.smallest_bin_not_empty == 1, TEST_BRS_SBNE, ""); TAP_TEST(reads.smallest_bin_not_empty == 1, TEST_BRS_SBNE, "");
TAP_TEST(reads.getNbInserted() == 4, TEST_BRS_GET_NB_INSERTED, ""); TAP_TEST(reads.getNbInserted() == 4, TEST_BRS_GET_NB_INSERTED, "");
...@@ -57,7 +57,7 @@ void testBinReadStorage() { ...@@ -57,7 +57,7 @@ void testBinReadStorage() {
&& reads.getScore(2) == 20, TEST_BRS_GET_SCORE, ""); && reads.getScore(2) == 20, TEST_BRS_GET_SCORE, "");
TAP_TEST(reads.getAverageScoreBySeq(seq4) == 10, TEST_BRS_GET_AVG_SCORE, ""); TAP_TEST(reads.getAverageScoreBySeq(seq4) == 10, TEST_BRS_GET_AVG_SCORE, "");
Sequence seq5 = {"label5", "l5", "AATAAGAGTGAGACAGTA", "", NULL}; Sequence seq5 = {"label5", "l5", "AATAAGAGTGAGACAGTA", "", NULL, 0};
reads.add(seq5); reads.add(seq5);
TAP_TEST(reads.smallest_bin_not_empty == 2, TEST_BRS_SBNE, ""); TAP_TEST(reads.smallest_bin_not_empty == 2, TEST_BRS_SBNE, "");
TAP_TEST(reads.getNbInserted() == 5, TEST_BRS_GET_NB_INSERTED, ""); TAP_TEST(reads.getNbInserted() == 5, TEST_BRS_GET_NB_INSERTED, "");
......
...@@ -323,8 +323,8 @@ void testProbability() { ...@@ -323,8 +323,8 @@ void testProbability() {
"CTTG", "CTTT"}; "CTTG", "CTTT"};
Fasta V, J; Fasta V, J;
for (int i = 0; i < 64; i++) { for (int i = 0; i < 64; i++) {
Sequence v = {"V_" + string_of_int(i+33), "V" + string_of_int(i+33), v_seq[i], "", NULL}; Sequence v = {"V_" + string_of_int(i+33), "V" + string_of_int(i+33), v_seq[i], "", NULL, 0};
Sequence j = {"J_" + string_of_int(i+33), "J" + string_of_int(i+33), j_seq[i], "", NULL}; Sequence j = {"J_" + string_of_int(i+33), "J" + string_of_int(i+33), j_seq[i], "", NULL, 0};
V.add(v); V.add(v);
J.add(j); J.add(j);
} }
...@@ -336,7 +336,7 @@ void testProbability() { ...@@ -336,7 +336,7 @@ void testProbability() {
TAP_TEST(germline.index->getIndexLoad(AFFECT_NOT_UNKNOWN) == .75, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_NOT_UNKNOWN"); TAP_TEST(germline.index->getIndexLoad(AFFECT_NOT_UNKNOWN) == .75, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_NOT_UNKNOWN");
TAP_TEST(germline.index->getIndexLoad(AFFECT_UNKNOWN) == .25, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_UNKNOWN"); TAP_TEST(germline.index->getIndexLoad(AFFECT_UNKNOWN) == .25, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_UNKNOWN");
Sequence seq = {"to_segment", "to_segment", "TATCG", "", NULL}; Sequence seq = {"to_segment", "to_segment", "TATCG", "", NULL, 0};
KmerSegmenter kseg(seq, &germline); KmerSegmenter kseg(seq, &germline);
KmerAffectAnalyser *kaa = kseg.getKmerAffectAnalyser(); KmerAffectAnalyser *kaa = kseg.getKmerAffectAnalyser();
......
...@@ -195,7 +195,7 @@ void testFastaAddThrows() { ...@@ -195,7 +195,7 @@ void testFastaAddThrows() {
void testSequenceOutputOperator() { void testSequenceOutputOperator() {
ostringstream oss; ostringstream oss;
Sequence seq = {"a b c", "a", "GATTACA", "AIIIIIH", NULL}; Sequence seq = {"a b c", "a", "GATTACA", "AIIIIIH", NULL, 0};
oss << seq; oss << seq;
TAP_TEST(oss.str() == "@a\nGATTACA\n+\nAIIIIIH\n", TEST_SEQUENCE_OUT, oss.str()); TAP_TEST(oss.str() == "@a\nGATTACA\n+\nAIIIIIH\n", TEST_SEQUENCE_OUT, oss.str());
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
void testWSAdd() { void testWSAdd() {
map<string, string> labels; map<string, string> labels;
WindowsStorage ws(labels); WindowsStorage ws(labels);
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL}; Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL, 0};
Germline germline("Test", 't', "../../data/small_V.fa", "", "../../data/small_J.fa", -10); Germline germline("Test", 't', "../../data/small_V.fa", "", "../../data/small_J.fa", -10);
TAP_TEST(ws.size() == 0, TEST_WS_SIZE_NONE, ""); TAP_TEST(ws.size() == 0, TEST_WS_SIZE_NONE, "");
...@@ -112,8 +112,8 @@ void testWSAddWithLimit() { ...@@ -112,8 +112,8 @@ void testWSAddWithLimit() {
WindowsStorage ws(labels); WindowsStorage ws(labels);
ws.setMaximalNbReadsPerWindow(3); ws.setMaximalNbReadsPerWindow(3);
ws.setBinParameters(1, 20); ws.setBinParameters(1, 20);
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL}; Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL, 0};
Sequence seq_long = {"label", "l", "GATACATTAGACAGCTTATATATATATTTATAT", "", NULL}; Sequence seq_long = {"label", "l", "GATACATTAGACAGCTTATATATATATTTATAT", "", NULL, 0};
Germline germline("Test", 't', "../../data/small_V.fa", "", "../../data/small_J.fa", -10); Germline germline("Test", 't', "../../data/small_V.fa", "", "../../data/small_J.fa", -10);
ws.add("ATTAG", seq, SEG_PLUS, &germline); ws.add("ATTAG", seq, SEG_PLUS, &germline);
......
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