tests.h 13.4 KB
Newer Older
Mikaël Salson's avatar
Mikaël Salson committed
1
2
3
4
5
6
#ifndef TESTS_H
#define TESTS_H

enum {
  /* Tools tests */
  TEST_REVCOMP,
Mikaël Salson's avatar
Mikaël Salson committed
7
8
9
  TEST_O_FASTA_HAS_NEXT,
  TEST_O_FASTA_GET_SEQUENCE,
  TEST_O_FASTA_LINE_NB,
Mikaël Salson's avatar
Mikaël Salson committed
10
11
12
13
  TEST_FASTA_SIZE,
  TEST_FASTA_LABEL,
  TEST_FASTA_LABEL_FULL,
  TEST_FASTA_SEQUENCE,
14
  TEST_FASTA_ADD,
15
  TEST_FASTA_INVALID_FILE,
16
  TEST_FASTA_OUT,
Mathieu Giraud's avatar
Mathieu Giraud committed
17
18
19
20
  TEST_CREATE_SEQUENCE_LABEL_FULL,
  TEST_CREATE_SEQUENCE_LABEL,
  TEST_CREATE_SEQUENCE_SEQUENCE,
  TEST_CREATE_SEQUENCE_QUALITY,
21
  TEST_SEQUENCE_OUT,
22
  TEST_NUC_TO_INT,
Mikaël Salson's avatar
Mikaël Salson committed
23
  TEST_DNA_TO_INT,
24
  TEST_REVCOMP_INT,
25
  TEST_EXTENDED_NUCL,
26
  TEST_EXTRACT_BASENAME,
Mikaël Salson's avatar
Mikaël Salson committed
27
  TEST_N_CHOOSE_K,
Mikaël Salson's avatar
Mikaël Salson committed
28
29
30
31
32
33

  /* Storage tests */
  TEST_ARRAY_KMERSTORE,
  TEST_MAP_KMERSTORE,
  TEST_ARRAY_KMERSTORE_RC,
  TEST_MAP_KMERSTORE_RC,
34
35
36
  TEST_KMERSTORE_GET_K,
  TEST_KMERSTORE_GET_S,
  TEST_KMERSTORE_GET_SEED,
37
  TEST_KMERSTORE_INSERT_ONE_SEQ,
38
  TEST_GET_INDEX_LOAD,
Mikaël Salson's avatar
Mikaël Salson committed
39

Mikaël Salson's avatar
Mikaël Salson committed
40
41
42
43
44
45
46
  /* KmerAffect */
  TEST_AFFECT_STRAND,
  TEST_AFFECT_CHAR,
  TEST_AFFECT_COMPARISON,
  TEST_AFFECT_TO_STRING,
  TEST_AFFECT_OUT,
  TEST_KMERAFFECT_CONSTRUCTOR,
47
  TEST_KMERAFFECT_CONSTRUCTOR_COPY_REVERSE,
Mikaël Salson's avatar
Mikaël Salson committed
48
49
50
51
52
53
54
55
56
  TEST_KMERAFFECT_AFFECTATION,
  TEST_KMERAFFECT_ADD,
  TEST_KMERAFFECT_UNKNOWN,
  TEST_KMERAFFECT_AMBIGUOUS,
  TEST_KMERAFFECT_STRAND,
  TEST_KMERAFFECT_LABEL,
  TEST_KMERAFFECT_COMPARISON,
  TEST_KMERAFFECT_OUT,

Mikaël Salson's avatar
Mikaël Salson committed
57
58
59
60
61
62
63
  /* Affect analyzer */
  TEST_AA_COUNT,
  TEST_AA_GET_AFFECT,
  TEST_AA_GET_DISTINCT_AFFECT,
  TEST_AA_FIRST,
  TEST_AA_LAST,
  TEST_AA_PREDICATES,
64
65
  TEST_AA_GET_ALL_AO_NONE,
  TEST_AA_GET_ALL_AO_NO_CONSECUTIVE,
66
67
  TEST_AA_REVCOMP_LABEL,
  TEST_AA_REVCOMP_STRAND,
68
69
70
71
  TEST_AA_GET_MAXIMUM_MAX_FOUND,
  TEST_AA_GET_MAXIMUM_POSITIONS,
  TEST_AA_GET_MAXIMUM_COUNTS,
  TEST_AA_GET_MAXIMUM_VALUE,
72
  TEST_AA_GET_SEQUENCE,
73
  TEST_COUNT_AA_GET_OVERLAP,
Mikaël Salson's avatar
Mikaël Salson committed
74
75
76
77
78
  TEST_COUNT_AA_COUNT,
  TEST_COUNT_AA_COUNT_BEFORE,
  TEST_COUNT_AA_COUNT_AFTER,
  TEST_COUNT_AA_FIRST_MAX,
  TEST_COUNT_AA_LAST_MAX,
79
  TEST_COUNT_AA_MAX,
80
  TEST_COUNT_AA_MAX12,
81
  TEST_AA_SORT_LEFT_RIGHT,
Mikaël Salson's avatar
Mikaël Salson committed
82
83
84
85

  /* Cluster */
  TEST_CLUSTER,

Mathieu Giraud's avatar
Mathieu Giraud committed
86
87
88
89
90
91
92
  /* Score */
  TEST_LENGTH_SCORE,

  /* Chooser */
  TEST_READ_CHOOSER_BEST,
  TEST_READ_CHOOSER_SORTED,

Mathieu Giraud's avatar
Mathieu Giraud committed
93
94
95
96
97
  /* Sampler */
  TEST_SAMPLER_LENGTH,
  TEST_SAMPLER_LONGEST,
  TEST_SAMPLER_RANDOM,

Mathieu Giraud's avatar
Mathieu Giraud committed
98
99
  /* Representative */
  TEST_KMER_REPRESENTATIVE,
100
  TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ,
Mikaël Salson's avatar
Mikaël Salson committed
101
  TEST_KMER_REPRESENTATIVE_REVCOMP,
Mathieu Giraud's avatar
Mathieu Giraud committed
102

Mathieu Giraud's avatar
Mathieu Giraud committed
103
104
105
  /* Kmer segmentation */
  TEST_KMER_IS_SEGMENTED,
  TEST_KMER_SEGMENTATION_CAUSE,
106
  TEST_SET_SEGMENTATION_CAUSE,
Mathieu Giraud's avatar
Mathieu Giraud committed
107
108
  TEST_KMER_JUNCTION,
  TEST_KMER_DATA,
109
110
  TEST_KMER_LEFT,
  TEST_KMER_RIGHT,
111
  TEST_PROBABILITY_SEGMENTATION,
Mathieu Giraud's avatar
Mathieu Giraud committed
112
113
114
115
116
117
118
119

  /* WindowExtractor */
  TEST_EXTRACTOR_NB_READS,
  TEST_EXTRACTOR_NB_SEGMENTED,
  TEST_EXTRACTOR_AVG_LENGTH,
  TEST_EXTRACTOR_OUT_SEG,
  TEST_EXTRACTOR_OUT_UNSEG,

Mikaël Salson's avatar
Mikaël Salson committed
120
121
122
  /* WindowsStorage */
  TEST_WS_GET_GERMLINE,
  TEST_WS_GET_GERMLINE_NONE,
123
  TEST_WS_GET_NB_READS,
124
  TEST_WS_HAS_WINDOW,
Mikaël Salson's avatar
Mikaël Salson committed
125
126
127
128
129
130
131
132
133
  TEST_WS_SIZE,
  TEST_WS_SIZE_NONE,
  TEST_WS_GET_LABEL_NONE,
  TEST_WS_GET_READS_SINGLE,
  TEST_WS_GET_READS,
  TEST_WS_SORT,
  TEST_WS_TOP_GERMLINES_ONE,
  TEST_WS_TOP_GERMLINES_NONE,
  TEST_WS_TOP_GERMLINES_MULTI,
134
135
  TEST_WS_LIMIT_READS_COUNT,
  TEST_WS_LIMIT_READS_CONTENT,
Mikaël Salson's avatar
Mikaël Salson committed
136

137
138
139
140
141
142
143
144
  /* ReadStorage */
  TEST_BRS_SCORE_TO_BIN,
  TEST_BRS_SBNE,
  TEST_BRS_GET_NB_INSERTED,
  TEST_BRS_GET_NB_STORED,
  TEST_BRS_ADD,
  TEST_BRS_GET_READS,

Mikaël Salson's avatar
Mikaël Salson committed
145
146
147
  /* Bugs */
  TEST_BUG_SEGMENTATION,
  TEST_SEGMENT_POSITION,
Mikaël Salson's avatar
Mikaël Salson committed
148
149
150
151
  /* Revcomp */
  TEST_SEGMENT_REVCOMP,
  TEST_KMER_SEGMENT_OVERLAP,
  TEST_FINE_SEGMENT_OVERLAP,
Mikaël Salson's avatar
Mikaël Salson committed
152
153
154
155
156
157
158
159

  NB_TESTS
};

#include "testing.h"

inline void declare_tests() {
  RECORD_TAP_TEST(TEST_REVCOMP, "revcomp");
Mikaël Salson's avatar
Mikaël Salson committed
160
161
162
  RECORD_TAP_TEST(TEST_O_FASTA_HAS_NEXT, "OnlineFasta hasNext()");
  RECORD_TAP_TEST(TEST_O_FASTA_GET_SEQUENCE, "OnlineFasta next()");
  RECORD_TAP_TEST(TEST_O_FASTA_LINE_NB, "OnlineFasta getLineNb()");
Mikaël Salson's avatar
Mikaël Salson committed
163
164
165
166
  RECORD_TAP_TEST(TEST_FASTA_SIZE, "Fasta/Fastq size");
  RECORD_TAP_TEST(TEST_FASTA_LABEL, "Fasta/Fastq label");
  RECORD_TAP_TEST(TEST_FASTA_LABEL_FULL, "Fasta/Fastq full label");
  RECORD_TAP_TEST(TEST_FASTA_SEQUENCE, "Fasta/Fastq sequence");
167
  RECORD_TAP_TEST(TEST_FASTA_ADD, "Fasta add() method");
168
  RECORD_TAP_TEST(TEST_FASTA_INVALID_FILE, "Fasta with invalid file");
169
  RECORD_TAP_TEST(TEST_FASTA_OUT, "Test operator<< with Fasta");
Mathieu Giraud's avatar
Mathieu Giraud committed
170
171
172
173
  RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_LABEL_FULL, "create_sequence: label_full field");
  RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_LABEL, "create_sequence: label field");
  RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_SEQUENCE, "create_sequence: sequence field");
  RECORD_TAP_TEST(TEST_CREATE_SEQUENCE_QUALITY, "create_sequence: quality field");
174
  RECORD_TAP_TEST(TEST_SEQUENCE_OUT, "Test operator<< for Sequence");
175
  RECORD_TAP_TEST(TEST_NUC_TO_INT, "nuc_to_int()");
Mikaël Salson's avatar
Mikaël Salson committed
176
  RECORD_TAP_TEST(TEST_DNA_TO_INT, "dna_to_int()");
177
  RECORD_TAP_TEST(TEST_REVCOMP_INT, "revcomp_int()");
178
  RECORD_TAP_TEST(TEST_EXTRACT_BASENAME, "extractBasename()");
Mikaël Salson's avatar
Mikaël Salson committed
179
  RECORD_TAP_TEST(TEST_N_CHOOSE_K, "test nChooseK()");
Mikaël Salson's avatar
Mikaël Salson committed
180
181

  RECORD_TAP_TEST(TEST_ARRAY_KMERSTORE, "Testing ArrayKmerStore");
182
  RECORD_TAP_TEST(TEST_KMERSTORE_INSERT_ONE_SEQ, "Testing IKmerStore::insert() on one sequence");
Mikaël Salson's avatar
Mikaël Salson committed
183
184
185
  RECORD_TAP_TEST(TEST_MAP_KMERSTORE, "Testing MapKmerStore");
  RECORD_TAP_TEST(TEST_ARRAY_KMERSTORE_RC, "Testing ArrayKmerStore with revcomp");
  RECORD_TAP_TEST(TEST_MAP_KMERSTORE_RC, "Testing MapKmerStore with revcomp");
186
187
188
  RECORD_TAP_TEST(TEST_KMERSTORE_GET_K, "Testing getK() in KmerStore");
  RECORD_TAP_TEST(TEST_KMERSTORE_GET_S, "Testing getK() in KmerStore");
  RECORD_TAP_TEST(TEST_KMERSTORE_GET_SEED, "Testing getK() in KmerStore");
189
  RECORD_TAP_TEST(TEST_GET_INDEX_LOAD, "Testing getIndexLoad() in KmerStore");
Mikaël Salson's avatar
Mikaël Salson committed
190

Mikaël Salson's avatar
Mikaël Salson committed
191
192
193
194
195
196
  RECORD_TAP_TEST(TEST_AFFECT_STRAND, "affect_strand()");
  RECORD_TAP_TEST(TEST_AFFECT_CHAR, "affect_char()");
  RECORD_TAP_TEST(TEST_AFFECT_COMPARISON, "Comparison operators for affect_t");
  RECORD_TAP_TEST(TEST_AFFECT_TO_STRING, "toString() for affect_t");
  RECORD_TAP_TEST(TEST_AFFECT_OUT, "operator<< for affect_t");
  RECORD_TAP_TEST(TEST_KMERAFFECT_CONSTRUCTOR, "KmerAffect constructor");
197
  RECORD_TAP_TEST(TEST_KMERAFFECT_CONSTRUCTOR_COPY_REVERSE, "KmerAffect constructor, with copy and reverse");
Mikaël Salson's avatar
Mikaël Salson committed
198
199
200
201
202
203
204
205
206
207
  RECORD_TAP_TEST(TEST_KMERAFFECT_AFFECTATION, "KmerAffect operator=");
  RECORD_TAP_TEST(TEST_KMERAFFECT_ADD, "KmerAffect operator +=");
  RECORD_TAP_TEST(TEST_KMERAFFECT_UNKNOWN, "KmerAffect::isUnknown()");
  RECORD_TAP_TEST(TEST_KMERAFFECT_AMBIGUOUS, "KmerAffect::isAmbiguous()");
  RECORD_TAP_TEST(TEST_KMERAFFECT_STRAND, "KmerAffect::getStrand()");
  RECORD_TAP_TEST(TEST_KMERAFFECT_LABEL, "KmerAffect::getLabel()");
  RECORD_TAP_TEST(TEST_KMERAFFECT_COMPARISON, "KmerAffect comparison operators");
  RECORD_TAP_TEST(TEST_KMERAFFECT_OUT, "KmerAffect operator<<");


Mikaël Salson's avatar
Mikaël Salson committed
208
209
210
211
212
213
  RECORD_TAP_TEST(TEST_AA_COUNT, "AffectAnalyser.count()");
  RECORD_TAP_TEST(TEST_AA_GET_AFFECT, "AffectAnalyser.getAffectation()");
  RECORD_TAP_TEST(TEST_AA_GET_DISTINCT_AFFECT, "AffectAnalyser.getDistinctAffectations()");
  RECORD_TAP_TEST(TEST_AA_FIRST, "AffectAnalyser.first()");
  RECORD_TAP_TEST(TEST_AA_LAST, "AffectAnalyser.last()");
  RECORD_TAP_TEST(TEST_AA_PREDICATES, "AffectAnalyser: isUnknown() isAmbiguous()");
214
215
  RECORD_TAP_TEST(TEST_AA_GET_ALL_AO_NONE, "AffectAnalyser: getAllAffectations() with AO_NONE");
  RECORD_TAP_TEST(TEST_AA_GET_ALL_AO_NO_CONSECUTIVE, "AffectAnalyser: getAllAffectations() with AO_NO_CONSECUTIVE");
216
217
  RECORD_TAP_TEST(TEST_AA_REVCOMP_LABEL, "AffectAnalyser: check that label is the same on revcomp sequence");
  RECORD_TAP_TEST(TEST_AA_REVCOMP_STRAND, "AffectAnalyser: check that strand is opposite on revcomp sequence");
218
219
220
221
  RECORD_TAP_TEST(TEST_AA_GET_MAXIMUM_MAX_FOUND, "KmerAffectAnalyser: getMaximum() function, max_found value");
  RECORD_TAP_TEST(TEST_AA_GET_MAXIMUM_POSITIONS, "KmerAffectAnalyser: getMaximum() function, positions of maximum");
  RECORD_TAP_TEST(TEST_AA_GET_MAXIMUM_COUNTS, "KmerAffectAnalyser: getMaximum() function, counts of affectations");
  RECORD_TAP_TEST(TEST_AA_GET_MAXIMUM_VALUE, "KmerAffectAnalyser: getMaximum() function, maximum value");
222
  RECORD_TAP_TEST(TEST_AA_GET_SEQUENCE, "KmerAffectAnalyser: getSequence() function");
223
  RECORD_TAP_TEST(TEST_COUNT_AA_GET_OVERLAP, "CountKmerAffectAnalyser::getAllowedOverlap");
Mikaël Salson's avatar
Mikaël Salson committed
224
225
226
227
228
  RECORD_TAP_TEST(TEST_COUNT_AA_COUNT, "CountKmerAffectAnalyser::count");
  RECORD_TAP_TEST(TEST_COUNT_AA_COUNT_BEFORE, "CountKmerAffectAnalyser::countBefore");
  RECORD_TAP_TEST(TEST_COUNT_AA_COUNT_AFTER, "CountKmerAffectAnalyser::countAfter");
  RECORD_TAP_TEST(TEST_COUNT_AA_FIRST_MAX, "CountKmerAffectAnalyser::firstMax");
  RECORD_TAP_TEST(TEST_COUNT_AA_LAST_MAX, "CountKmerAffectAnalyser::lastMax");
229
  RECORD_TAP_TEST(TEST_COUNT_AA_MAX, "CountKmerAffectAnalyser::max");
230
  RECORD_TAP_TEST(TEST_COUNT_AA_MAX12, "CountKmerAffectAnalyser::max12");
Mikaël Salson's avatar
Mikaël Salson committed
231
232
233

  RECORD_TAP_TEST(TEST_CLUSTER, "Test automatic clusterisation");

Mathieu Giraud's avatar
Mathieu Giraud committed
234
235
236
237
238
  RECORD_TAP_TEST(TEST_LENGTH_SCORE, "Test ReadLengthScore getScore()");

  RECORD_TAP_TEST(TEST_READ_CHOOSER_BEST, "Test getBest() in ReadChooser");
  RECORD_TAP_TEST(TEST_READ_CHOOSER_SORTED, "Test getSorted() in ReadChooser");

Mathieu Giraud's avatar
Mathieu Giraud committed
239
240
241
242
243
244
  RECORD_TAP_TEST(TEST_SAMPLER_LENGTH, "Test getLengthDistribution() in SequenceSampler");
  RECORD_TAP_TEST(TEST_SAMPLER_LONGEST, "Test getLongest() in SequenceSampler");
  RECORD_TAP_TEST(TEST_SAMPLER_RANDOM, "Test getRandom() in SequenceSampler");

  RECORD_TAP_TEST(TEST_KMER_IS_SEGMENTED, "Test isSegmented() in KmerSegmenter");
  RECORD_TAP_TEST(TEST_KMER_SEGMENTATION_CAUSE, "Test getSegmentationStatus() in KmerSegmenter");
245
  RECORD_TAP_TEST(TEST_SET_SEGMENTATION_CAUSE, "Test setSegmentationStatus() in KmerSegmenter");
Mathieu Giraud's avatar
Mathieu Giraud committed
246
247
  RECORD_TAP_TEST(TEST_KMER_JUNCTION, "Test getJunction() in KmerSegmenter");
  RECORD_TAP_TEST(TEST_KMER_DATA, "Test that data is consistent with what we expect for KmerSegmenter");
248
249
  RECORD_TAP_TEST(TEST_KMER_LEFT, "Test V end (resp. J start) with KmerSegmenter on fwd (resp bwd) strand");
  RECORD_TAP_TEST(TEST_KMER_RIGHT, "Test J start (resp. V end) with KmerSegmenter on fwd (resp bwd) strand");
250
  RECORD_TAP_TEST(TEST_PROBABILITY_SEGMENTATION, "Test getProbabilityAtLeastOrAbove()");
Mathieu Giraud's avatar
Mathieu Giraud committed
251
252
253
254
255
256
257

  RECORD_TAP_TEST(TEST_EXTRACTOR_NB_READS, "Test getNbReads() in WindowExtractor");
  RECORD_TAP_TEST(TEST_EXTRACTOR_NB_SEGMENTED, "Test getNbSegmented() in WindowsExtractor");
  RECORD_TAP_TEST(TEST_EXTRACTOR_AVG_LENGTH, "Test getAverageSegmentationLength() in WindowsExtractor");
  RECORD_TAP_TEST(TEST_EXTRACTOR_OUT_SEG, "Test segmentation output for WindowsExtractor");
  RECORD_TAP_TEST(TEST_EXTRACTOR_OUT_UNSEG, "Test unsegmentation output for WindowsExtractor");

Mikaël Salson's avatar
Mikaël Salson committed
258
  RECORD_TAP_TEST(TEST_WS_GET_GERMLINE, "Test WindowsStorage::getGermline");
259
  RECORD_TAP_TEST(TEST_WS_HAS_WINDOW, "Test WindowsStorage::hasWindow");
Mikaël Salson's avatar
Mikaël Salson committed
260
  RECORD_TAP_TEST(TEST_WS_GET_GERMLINE_NONE, "Test WindowsStorage::getGermline() with undefined window");
261
  RECORD_TAP_TEST(TEST_WS_GET_NB_READS, "Test WindowsStorage::getNbReads");
Mikaël Salson's avatar
Mikaël Salson committed
262
263
264
265
266
267
268
269
270
  RECORD_TAP_TEST(TEST_WS_SIZE, "Test WindowsStorage::size()");
  RECORD_TAP_TEST(TEST_WS_SIZE_NONE, "Test WindowsStorage::size() when empty");
  RECORD_TAP_TEST(TEST_WS_GET_LABEL_NONE, "Test WindowsStorage::getLabel() with no label");
  RECORD_TAP_TEST(TEST_WS_GET_READS_SINGLE, "Test WindowsStorage::getReads() with single result");
  RECORD_TAP_TEST(TEST_WS_GET_READS, "Test WindowsStorage::getReads() with several results");
  RECORD_TAP_TEST(TEST_WS_SORT, "Test WindowsStorage is correctly sorted");
  RECORD_TAP_TEST(TEST_WS_TOP_GERMLINES_ONE, "Test WindowsStorage::getTopGermlines() with the most abundant germline");
  RECORD_TAP_TEST(TEST_WS_TOP_GERMLINES_NONE, "Test WindowsStorage::getTopGermlines() with no germline fulfilling the requirements");
  RECORD_TAP_TEST(TEST_WS_TOP_GERMLINES_MULTI, "Test WindowsStorage::getTopGermlines() with several germlines");
271
272
  RECORD_TAP_TEST(TEST_WS_LIMIT_READS_COUNT, "Test that with setMaximalNbReadsPerWindow, the count is correct");
  RECORD_TAP_TEST(TEST_WS_LIMIT_READS_CONTENT, "Test that with setMaximalNbReadsPerWindow, the sequences are correct");
Mikaël Salson's avatar
Mikaël Salson committed
273

274
275
276
277
278
279
280
  RECORD_TAP_TEST(TEST_BRS_SCORE_TO_BIN, "Test the scoreToBin() method in ReadStorage");
  RECORD_TAP_TEST(TEST_BRS_SBNE, "Test the smallest_bin_not_empty variables in ReadStorage");
  RECORD_TAP_TEST(TEST_BRS_GET_NB_INSERTED, "Test the getNbInserted() method in ReadStorage");
  RECORD_TAP_TEST(TEST_BRS_GET_NB_STORED, "Test the getNbStored() method in ReadStorage");
  RECORD_TAP_TEST(TEST_BRS_ADD, "Test the add() method in ReadStorage");
  RECORD_TAP_TEST(TEST_BRS_GET_READS, "Test the getReads() method in ReadStorage");

Mathieu Giraud's avatar
Mathieu Giraud committed
281
  RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE, "Test KmerRepresentativeComputer computations");
282
  RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ, "Test KmerRepresentativeComputer computations with a required sequence");
Mikaël Salson's avatar
Mikaël Salson committed
283
  RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE_REVCOMP, "Test KmerRepresentativeComputer computations on a dataset and its revcomp");
Mikaël Salson's avatar
Mikaël Salson committed
284
285
  RECORD_TAP_TEST(TEST_BUG_SEGMENTATION, "Test segmentation bug");
  RECORD_TAP_TEST(TEST_SEGMENT_POSITION, "Test V,D,J position");
Mikaël Salson's avatar
Mikaël Salson committed
286
287
288
  RECORD_TAP_TEST(TEST_KMER_SEGMENT_OVERLAP, "Test kmer segmentation with an overlap");
  RECORD_TAP_TEST(TEST_FINE_SEGMENT_OVERLAP, "Test fine segmentation with an overlap");
  RECORD_TAP_TEST(TEST_SEGMENT_REVCOMP, "Test segmentation on a sequence and its revcomp");
Mikaël Salson's avatar
Mikaël Salson committed
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
}

TAP_DECLARATIONS


const string seq[] = {"CCCCCCCCCCCCCCCCCCCC", "C lots of",
                      "GGGGGGGGGGGGGGGGGGGG", "G lots of",
                      "AAAAAAAAAAAAAAAAAAAA", "A lots of",
                      "TTTTTTTTTTTTTTTTTTTT", "T lots of",
                      "TTTTATTTTATTTTATTTTA", "U : TTTA lots of",
                      "AAAACAAAACAAAACAAAAC", "V : AAAC lots of"};
const int nb_seq = 6;


template<typename Index>
inline Index *createIndex(int k, bool revcomp) {
  Index *index = new Index(k, revcomp);
  for (int i=0; i < nb_seq; i++)
    index->insert(seq[2*i], seq[2*i+1]);
  return index;
}

#endif