Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,711
Issues
1,711
List
Boards
Labels
Service Desk
Milestones
Merge Requests
86
Merge Requests
86
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
8e3c3f5a
Commit
8e3c3f5a
authored
Oct 30, 2014
by
Mikaël Salson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests: Test getters() on seed in IKMerStore
parent
546e9193
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
algo/tests/testStorage.cpp
algo/tests/testStorage.cpp
+31
-0
algo/tests/tests.h
algo/tests/tests.h
+6
-0
No files found.
algo/tests/testStorage.cpp
View file @
8e3c3f5a
...
...
@@ -5,6 +5,8 @@
template
<
template
<
class
>
class
T
>
void
testKmerStoreWithKmerSimple
(
int
k
,
bool
revcomp
,
int
test_id
)
{
T
<
Kmer
>
*
index
=
createIndex
<
T
<
Kmer
>
>
(
k
,
revcomp
);
TAP_TEST
(
k
==
index
->
getK
(),
TEST_KMERSTORE_GET_K
,
""
);
for
(
int
i
=
0
;
i
<
nb_seq
-
2
;
i
++
)
{
string
tmp
=
seq
[
2
*
i
].
substr
(
0
,
k
);
...
...
@@ -49,6 +51,32 @@ void testKmerStoreWithKmer(int k, int test_id) {
delete
index2
;
}
template
<
template
<
class
>
class
KmerStore
>
void
testKmerStoreSeed
()
{
KmerStore
<
Kmer
>
*
index
=
new
KmerStore
<
Kmer
>
(
8
,
true
);
TAP_TEST
(
index
->
getK
()
==
8
,
TEST_KMERSTORE_GET_K
,
""
);
TAP_TEST
(
index
->
getS
()
==
8
,
TEST_KMERSTORE_GET_S
,
""
);
TAP_TEST
(
index
->
getSeed
()
==
"########"
,
TEST_KMERSTORE_GET_SEED
,
""
);
delete
index
;
string
seed
=
"#####-#####"
;
index
=
new
KmerStore
<
Kmer
>
(
seed
,
true
);
TAP_TEST
(
index
->
getK
()
==
10
,
TEST_KMERSTORE_GET_K
,
""
);
TAP_TEST
(
index
->
getS
()
==
11
,
TEST_KMERSTORE_GET_S
,
""
);
TAP_TEST
(
index
->
getSeed
()
==
seed
,
TEST_KMERSTORE_GET_SEED
,
""
);
delete
index
;
seed
=
"##-##-##-##"
;
index
=
new
KmerStore
<
Kmer
>
(
seed
,
true
);
TAP_TEST
(
index
->
getK
()
==
8
,
TEST_KMERSTORE_GET_K
,
""
);
TAP_TEST
(
index
->
getS
()
==
11
,
TEST_KMERSTORE_GET_S
,
""
);
TAP_TEST
(
index
->
getSeed
()
==
seed
,
TEST_KMERSTORE_GET_SEED
,
""
);
delete
index
;
}
void
testStorage
()
{
testKmerStoreWithKmerSimple
<
ArrayKmerStore
>
(
5
,
false
,
TEST_ARRAY_KMERSTORE
);
testKmerStoreWithKmerSimple
<
ArrayKmerStore
>
(
5
,
true
,
TEST_ARRAY_KMERSTORE_RC
);
...
...
@@ -58,4 +86,7 @@ void testStorage() {
testKmerStoreWithKmer
<
ArrayKmerStore
>
(
10
,
TEST_ARRAY_KMERSTORE_RC
);
testKmerStoreWithKmer
<
MapKmerStore
>
(
14
,
TEST_MAP_KMERSTORE_RC
);
testKmerStoreSeed
<
ArrayKmerStore
>
();
testKmerStoreSeed
<
MapKmerStore
>
();
}
algo/tests/tests.h
View file @
8e3c3f5a
...
...
@@ -22,6 +22,9 @@ enum {
TEST_MAP_KMERSTORE
,
TEST_ARRAY_KMERSTORE_RC
,
TEST_MAP_KMERSTORE_RC
,
TEST_KMERSTORE_GET_K
,
TEST_KMERSTORE_GET_S
,
TEST_KMERSTORE_GET_SEED
,
/* Affect analyzer */
TEST_AA_COUNT
,
...
...
@@ -110,6 +113,9 @@ inline void declare_tests() {
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"
);
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"
);
RECORD_TAP_TEST
(
TEST_AA_COUNT
,
"AffectAnalyser.count()"
);
RECORD_TAP_TEST
(
TEST_AA_GET_AFFECT
,
"AffectAnalyser.getAffectation()"
);
...
...
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