Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1,432
Issues
1,432
List
Boards
Labels
Milestones
Merge Requests
50
Merge Requests
50
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
a1b2c9bd
Commit
a1b2c9bd
authored
Oct 02, 2018
by
Mikaël Salson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
algo/tests/: Add tests for core/math.cpp
parent
8d259859
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
algo/tests/unit-tests/testMath.cpp
algo/tests/unit-tests/testMath.cpp
+20
-0
algo/tests/unit-tests/tests.cpp
algo/tests/unit-tests/tests.cpp
+2
-0
algo/tests/unit-tests/tests.h
algo/tests/unit-tests/tests.h
+4
-0
No files found.
algo/tests/unit-tests/testMath.cpp
0 → 100644
View file @
a1b2c9bd
#include <core/math.hpp>
void
testComputeNbKmers
()
{
// When all k-mers match, probability of error is 0, thus we return the same
// number of occurrences as in input
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
100
,
109
,
99
),
100
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
100
,
109
,
90
),
100
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
100
,
109
,
95
),
100
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
100
,
109
,
999
),
100
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
10
,
109
,
999
),
0
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
1
,
109
,
999
),
0
,
TEST_MATH_LIMIT_KMERS
,
""
);
TAP_TEST_EQUAL
(
compute_nb_kmers_limit
(
10
,
20
,
109
,
999
),
7
,
TEST_MATH_LIMIT_KMERS
,
""
);
}
void
testMath
()
{
testComputeNbKmers
();
}
algo/tests/unit-tests/tests.cpp
View file @
a1b2c9bd
...
...
@@ -16,6 +16,7 @@
#include "testWindowsStorage.cpp"
#include "testReadStorage.cpp"
#include "testAutomaton.cpp"
#include "testMath.cpp"
int
main
(
void
)
{
TAP_START
(
NB_TESTS
);
...
...
@@ -36,6 +37,7 @@ int main(void) {
testWindowStorage
();
testReadStorage
();
testAutomaton
();
testMath
();
TAP_END_TEST_EXIT
}
algo/tests/unit-tests/tests.h
View file @
a1b2c9bd
...
...
@@ -178,6 +178,9 @@ enum {
TEST_BRS_GET_NB_SCORES
,
TEST_BRS_GET_BEST_READS
,
/* Math */
TEST_MATH_LIMIT_KMERS
,
/* Bugs */
TEST_BUG_SEGMENTATION
,
TEST_SEGMENT_POSITION
,
...
...
@@ -350,6 +353,7 @@ inline void declare_tests() {
RECORD_TAP_TEST
(
TEST_KMER_REPRESENTATIVE
,
"Test KmerRepresentativeComputer computations"
);
RECORD_TAP_TEST
(
TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ
,
"Test KmerRepresentativeComputer computations with a required sequence"
);
RECORD_TAP_TEST
(
TEST_KMER_REPRESENTATIVE_REVCOMP
,
"Test KmerRepresentativeComputer computations on a dataset and its revcomp"
);
RECORD_TAP_TEST
(
TEST_MATH_LIMIT_KMERS
,
"Test computation on limit of number of k-mers"
);
RECORD_TAP_TEST
(
TEST_KMER_REPRESENTATIVE_QUALITY
,
"Test KmerRepresentativeComputer quality computations"
);
RECORD_TAP_TEST
(
TEST_BUG_SEGMENTATION
,
"Test segmentation bug"
);
RECORD_TAP_TEST
(
TEST_SEGMENT_POSITION
,
"Test V,D,J position"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment