Commit 65c691c6 authored by Mathieu Giraud's avatar Mathieu Giraud

tests: update

The tests instantiated 67 Sequence objects... all of them with a NULL *seq.
parent b8037fc7
Pipeline #33723 passed with stages
in 46 minutes and 39 seconds
......@@ -24,7 +24,7 @@ void testCluster() {
map<string, string> labels;
WindowsStorage windows = WindowsStorage(labels);
Sequence seq = {"", "", "", "", NULL, 0};
Sequence seq = {"", "", "", "", 0};
windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT", seq, 0, 0);
windows.add("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", seq, 0, 0);
......
......@@ -14,19 +14,19 @@
BioReader getDebugBioReader1(){
BioReader result;
Sequence sequences[13];
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", NULL, 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTGA", "", NULL, 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTGT", "", NULL, 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAA", "", NULL, 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCA", "", NULL, 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGG", "", NULL, 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATG", "", NULL, 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATT", "", NULL, 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATA", "", NULL, 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATC", "", NULL, 0};
sequences[10] = {"seq5_full_name", "seq-05", "TTTT", "", NULL, 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAAT", "", NULL, 0};
sequences[12] = {"seq6_full_name", "seq-06*02", "AAAA", "", NULL, 0};
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTGA", "", 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTGT", "", 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAA", "", 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCA", "", 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGG", "", 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATG", "", 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATT", "", 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATA", "", 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATC", "", 0};
sequences[10] = {"seq5_full_name", "seq-05", "TTTT", "", 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAAT", "", 0};
sequences[12] = {"seq6_full_name", "seq-06*02", "AAAA", "", 0};
for(int i = 0;i < 13; ++i){
result.add(sequences[i]);
}
......@@ -43,17 +43,17 @@ BioReader getDebugBioReader1(){
BioReader getDebugBioReader2(){
BioReader result;
Sequence sequences[11];
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", NULL, 0};
sequences[1] = {"seq2_full_name", "seq-02*01", "TCAA", "", NULL, 0};
sequences[2] = {"seq2_full_name", "seq-02*02", "TCCA", "", NULL, 0};
sequences[3] = {"seq3_full_name", "seq-03*01", "GGGG", "", NULL, 0};
sequences[4] = {"seq4_full_name", "seq-04*01", "CCAATG", "", NULL, 0};
sequences[5] = {"seq4_full_name", "seq-04*02", "CCAATT", "", NULL, 0};
sequences[6] = {"seq4_full_name", "seq-04*03", "CCAATA", "", NULL, 0};
sequences[7] = {"seq4_full_name", "seq-04*04", "CCAATC", "", NULL, 0};
sequences[8] = {"seq5_full_name", "seq-05*01", "TTTT", "", NULL, 0};
sequences[9] = {"seq6_full_name", "seq-06*01", "AAAT", "", NULL, 0};
sequences[10] = {"seq6_full_name", "seq-06*02", "AAAA", "", NULL, 0};
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", 0};
sequences[1] = {"seq2_full_name", "seq-02*01", "TCAA", "", 0};
sequences[2] = {"seq2_full_name", "seq-02*02", "TCCA", "", 0};
sequences[3] = {"seq3_full_name", "seq-03*01", "GGGG", "", 0};
sequences[4] = {"seq4_full_name", "seq-04*01", "CCAATG", "", 0};
sequences[5] = {"seq4_full_name", "seq-04*02", "CCAATT", "", 0};
sequences[6] = {"seq4_full_name", "seq-04*03", "CCAATA", "", 0};
sequences[7] = {"seq4_full_name", "seq-04*04", "CCAATC", "", 0};
sequences[8] = {"seq5_full_name", "seq-05*01", "TTTT", "", 0};
sequences[9] = {"seq6_full_name", "seq-06*01", "AAAT", "", 0};
sequences[10] = {"seq6_full_name", "seq-06*02", "AAAA", "", 0};
for(int i = 0;i < 11; ++i){
result.add(sequences[i]);
}
......@@ -69,18 +69,18 @@ BioReader getDebugBioReader2(){
BioReader getDebugBioReader3(){
BioReader result;
Sequence sequences[12];
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", NULL, 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTGA", "", NULL, 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTGT", "", NULL, 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAA", "", NULL, 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCA", "", NULL, 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGG", "", NULL, 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATG", "", NULL, 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATT", "", NULL, 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATA", "", NULL, 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATC", "", NULL, 0};
sequences[10] = {"seq5_full_name", "seq-05*01", "TTTT", "", NULL, 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAAT", "", NULL, 0};
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTGC","", 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTGA", "", 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTGT", "", 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAA", "", 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCA", "", 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGG", "", 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATG", "", 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATT", "", 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATA", "", 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATC", "", 0};
sequences[10] = {"seq5_full_name", "seq-05*01", "TTTT", "", 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAAT", "", 0};
for(int i = 0;i < 12; ++i){
result.add(sequences[i]);
}
......@@ -385,19 +385,19 @@ void testExAequoKmersWhenSignificantParameter(){
string BIOREADER_EXAEQUO = "BioReader doesn't have ex-aequo";
string SIZE_BIOREADER = "BioReader doesn't contain the good amount of sequences";
Sequence sequences[13];
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTAGCTA","", NULL, 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTAGCTT", "", NULL, 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTAGCTC", "", NULL, 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAATCAA", "", NULL, 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCATCAA", "", NULL, 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGGGGGG", "", NULL, 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATGCC", "", NULL, 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATTCC", "", NULL, 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATACC", "", NULL, 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATCCC", "", NULL, 0};
sequences[10] = {"seq5_full_name", "seq-05*01", "TTTTTTTT", "", NULL, 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAATAAAT", "", NULL, 0};
sequences[12] = {"seq7_full_name", "seq-07*01", "CCCCCCCC", "", NULL, 0};
sequences[0] = {"seq1-full_name", "seq-01*01", "AGCTAGCTA","", 0};
sequences[1] = {"seq1-full_name", "seq-01*02", "AGCTAGCTT", "", 0};
sequences[2] = {"seq1-full_name", "seq-01*03", "AGCTAGCTC", "", 0};
sequences[3] = {"seq2_full_name", "seq-02*01", "TCAATCAA", "", 0};
sequences[4] = {"seq2_full_name", "seq-02*02", "TCCATCAA", "", 0};
sequences[5] = {"seq3_full_name", "seq-03*01", "GGGGGGGG", "", 0};
sequences[6] = {"seq4_full_name", "seq-04*01", "CCAATGCC", "", 0};
sequences[7] = {"seq4_full_name", "seq-04*02", "CCAATTCC", "", 0};
sequences[8] = {"seq4_full_name", "seq-04*03", "CCAATACC", "", 0};
sequences[9] = {"seq4_full_name", "seq-04*04", "CCAATCCC", "", 0};
sequences[10] = {"seq5_full_name", "seq-05*01", "TTTTTTTT", "", 0};
sequences[11] = {"seq6_full_name", "seq-06*01", "AAATAAAT", "", 0};
sequences[12] = {"seq7_full_name", "seq-07*01", "CCCCCCCC", "", 0};
for(int i = 0;i < 13; ++i){
testedBioReader.add(sequences[i]);
}
......
......@@ -13,7 +13,7 @@ void testBinReadStorage() {
TAP_TEST_EQUAL(reads.scoreToBin(11), 3, TEST_BRS_SCORE_TO_BIN, "");
TAP_TEST_EQUAL(reads.scoreToBin(5), 1, TEST_BRS_SCORE_TO_BIN, "");
Sequence seq1 = {"label", "l", "GAGAG", "", NULL, 0};
Sequence seq1 = {"label", "l", "GAGAG", "", 0};
reads.add(seq1);
TAP_TEST_EQUAL(reads.smallest_bin_not_empty, 1, TEST_BRS_SBNE, "");
TAP_TEST_EQUAL(reads.getNbInserted(), 1, TEST_BRS_GET_NB_INSERTED, "");
......@@ -22,7 +22,7 @@ void testBinReadStorage() {
&& reads.getScoreByScore(5.) == 5
&& reads.getScore(1) == 5, TEST_BRS_GET_SCORE, "");
Sequence seq2 = {"label2", "l2", "GA", "", NULL, 0};
Sequence seq2 = {"label2", "l2", "GA", "", 0};
reads.add(seq2);
TAP_TEST_EQUAL(reads.smallest_bin_not_empty, 0, TEST_BRS_SBNE, "");
TAP_TEST_EQUAL(reads.getNbInserted(), 2, TEST_BRS_GET_NB_INSERTED, "");
......@@ -34,7 +34,7 @@ void testBinReadStorage() {
TAP_TEST_EQUAL(reads.getScore(), 7, TEST_BRS_GET_SCORE, "");
TAP_TEST_EQUAL(reads.getAverageScore(), 3.5, TEST_BRS_GET_AVG_SCORE, "");
Sequence seq3 = {"label3", "l3", "GGAGACAGTA", "", NULL, 0};
Sequence seq3 = {"label3", "l3", "GGAGACAGTA", "", 0};
reads.add(seq3);
TAP_TEST_EQUAL(reads.smallest_bin_not_empty, 0, TEST_BRS_SBNE, "");
TAP_TEST_EQUAL(reads.getNbInserted(), 3, TEST_BRS_GET_NB_INSERTED, "");
......@@ -43,7 +43,7 @@ void testBinReadStorage() {
&& reads.getScoreByScore(10.) == 10
&& reads.getScore(2) == 10, TEST_BRS_GET_SCORE, "");
Sequence seq4 = {"label4", "l4", "AGAGACAGTA", "", NULL, 0};
Sequence seq4 = {"label4", "l4", "AGAGACAGTA", "", 0};
reads.add(seq4);
TAP_TEST_EQUAL(reads.smallest_bin_not_empty, 1, TEST_BRS_SBNE, "");
TAP_TEST_EQUAL(reads.getNbInserted(), 4, TEST_BRS_GET_NB_INSERTED, "");
......@@ -57,7 +57,7 @@ void testBinReadStorage() {
&& reads.getScore(2) == 20, TEST_BRS_GET_SCORE, "");
TAP_TEST_EQUAL(reads.getAverageScoreBySeq(seq4), 10, TEST_BRS_GET_AVG_SCORE, "");
Sequence seq5 = {"label5", "l5", "AATAAGAGTGAGACAGTA", "", NULL, 0};
Sequence seq5 = {"label5", "l5", "AATAAGAGTGAGACAGTA", "", 0};
reads.add(seq5);
TAP_TEST_EQUAL(reads.smallest_bin_not_empty, 2, TEST_BRS_SBNE, "");
TAP_TEST_EQUAL(reads.getNbInserted(), 5, TEST_BRS_GET_NB_INSERTED, "");
......
......@@ -4,15 +4,15 @@ void testScore() {
// ReadLengthScore testing
ReadLengthScore rls;
Sequence seq1 = {"seq", "seq", "", "", NULL, 0};
Sequence seq1 = {"seq", "seq", "", "", 0};
TAP_TEST_EQUAL(rls.getScore(seq1), 0., TEST_LENGTH_SCORE,
"score should be 0, is " << rls.getScore(seq1));
Sequence seq2 = {"seq", "seq", "ATCGTTTACGTC", "", NULL, 0};
Sequence seq2 = {"seq", "seq", "ATCGTTTACGTC", "", 0};
TAP_TEST_EQUAL(rls.getScore(seq2), 12., TEST_LENGTH_SCORE,
"score should be 12, is " << rls.getScore(seq2));
Sequence seq3 = {"seq", "seq", "A", "", NULL, 0};
Sequence seq3 = {"seq", "seq", "A", "", 0};
TAP_TEST_EQUAL(rls.getScore(seq3), 1., TEST_LENGTH_SCORE,
"score should be 1, is " << rls.getScore(seq3));
......@@ -20,7 +20,7 @@ void testScore() {
// ReadQualityScore testing
ReadQualityScore rqs;
Sequence seq4 = {"s", "s", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII", NULL, 0};
Sequence seq4 = {"s", "s", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII", 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));
......
......@@ -264,7 +264,7 @@ void testBug2224(IndexTypes index) {
BioReader seqJ("../../germline/homo-sapiens/TRGJ.fa", 2);
BioReader data(true, "virtual");
Sequence s = {">label", ">label", "ATTATATA", "", NULL, 0};
Sequence s = {">label", ">label", "ATTATATA", "", 0};
data.add(s);
......@@ -402,8 +402,8 @@ void testProbability(IndexTypes index) {
"CTTG", "CTTT"};
BioReader V, J;
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, 0};
Sequence j = {"J_" + string_of_int(i+33), "J" + string_of_int(i+33), j_seq[i], "", NULL, 0};
Sequence v = {"V_" + string_of_int(i+33), "V" + string_of_int(i+33), v_seq[i], "", 0};
Sequence j = {"J_" + string_of_int(i+33), "J" + string_of_int(i+33), j_seq[i], "", 0};
V.add(v);
J.add(j);
}
......@@ -419,7 +419,7 @@ void testProbability(IndexTypes index) {
TAP_TEST_EQUAL(germline.index->getIndexLoad(AFFECT_NOT_UNKNOWN), .75, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_NOT_UNKNOWN = " << germline.index->getIndexLoad(AFFECT_NOT_UNKNOWN));
TAP_TEST_EQUAL(germline.index->getIndexLoad(AFFECT_UNKNOWN), .25, TEST_GET_INDEX_LOAD, ".getIndexLoad with AFFECT_UNKNOWN : " << germline.index->getIndexLoad(AFFECT_UNKNOWN));
Sequence seq = {"to_segment", "to_segment", "TATCG", "", NULL, 0};
Sequence seq = {"to_segment", "to_segment", "TATCG", "", 0};
KmerSegmenter kseg(seq, &germline);
KmerAffectAnalyser *kaa = kseg.getKmerAffectAnalyser();
......
......@@ -218,7 +218,7 @@ void testFastaLabelAndMark() {
void testSequenceOutputOperator() {
ostringstream oss;
Sequence seq = {"a b c", "a", "GATTACA", "AIIIIIH", NULL, 0};
Sequence seq = {"a b c", "a", "GATTACA", "AIIIIIH", 0};
oss << seq;
TAP_TEST_EQUAL(oss.str(), "@a\nGATTACA\n+\nAIIIIIH\n", TEST_SEQUENCE_OUT, oss.str());
......
......@@ -6,7 +6,7 @@
void testWSAdd() {
map<string, string> labels;
WindowsStorage ws(labels);
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL, 0};
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", 0};
Germline germline("Test", 't', "data/small_V.fa", "", "data/small_J.fa", "");
TAP_TEST_EQUAL(ws.size(), 0, TEST_WS_SIZE_NONE, "");
......@@ -112,8 +112,8 @@ void testWSAddWithLimit() {
WindowsStorage ws(labels);
ws.setMaximalNbReadsPerWindow(3);
ws.setBinParameters(1, 20);
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", NULL, 0};
Sequence seq_long = {"label", "l", "GATACATTAGACAGCTTATATATATATTTATAT", "", NULL, 0};
Sequence seq = {"label", "l", "GATACATTAGACAGCT", "", 0};
Sequence seq_long = {"label", "l", "GATACATTAGACAGCTTATATATATATTTATAT", "", 0};
Germline germline("Test", 't', "data/small_V.fa", "", "data/small_J.fa", "");
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