Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ROCK
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Véronique LEGRAND
ROCK
Commits
674e6528
Commit
674e6528
authored
9 years ago
by
Veronique Legrand
Browse files
Options
Downloads
Patches
Plain Diff
updated path of input data files so that unit tests can also be ran with make distcheck.
parent
99e3c5a3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/unit_test_fqreader.cpp
+11
-11
11 additions, 11 deletions
src/unit_test_fqreader.cpp
src/unit_test_fqwriter.cpp
+8
-8
8 additions, 8 deletions
src/unit_test_fqwriter.cpp
src/unit_test_read_utils.cpp
+3
-3
3 additions, 3 deletions
src/unit_test_read_utils.cpp
with
22 additions
and
22 deletions
src/unit_test_fqreader.cpp
+
11
−
11
View file @
674e6528
...
...
@@ -26,7 +26,7 @@ void test_processSingleFile() {
//printf("MAX_UINT=%u \n",UINT_MAX);
srp
sr
;
unsigned
char
f_id
=
1
;
processSingleFile
((
char
*
)
"../
data
/test_single.fq"
,
f_id
,
&
sr
);
processSingleFile
((
char
*
)
"../
test/data/unit
/test_single.fq"
,
f_id
,
&
sr
);
srp
::
reverse_iterator
rit
;
i_dim
::
iterator
it_offs
;
k_dim
::
iterator
it_struct
;
...
...
@@ -67,8 +67,8 @@ void test_processSingleFile() {
*/
void
test_processPEfilesWithA
()
{
char
*
fq_3_test
=
(
char
*
)
"../
data
/klebsiella_PE1.fq"
;
char
*
fq_4_test
=
(
char
*
)
"../
data
/klebsiella_PE2.fq"
;
char
*
fq_3_test
=
(
char
*
)
"../
test/data/unit
/klebsiella_PE1.fq"
;
char
*
fq_4_test
=
(
char
*
)
"../
test/data/unit
/klebsiella_PE2.fq"
;
unsigned
char
f_id3
=
3
;
unsigned
char
f_id4
=
4
;
...
...
@@ -124,8 +124,8 @@ void test_processPEfilesWithA() {
}
void
test_processPEFiles
()
{
char
*
fq_1_test
=
(
char
*
)
"../
data
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
data
/test_PE2.fq"
;
char
*
fq_1_test
=
(
char
*
)
"../
test/data/unit
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
test/data/unit
/test_PE2.fq"
;
unsigned
char
f_id1
=
1
;
unsigned
char
f_id2
=
2
;
...
...
@@ -205,9 +205,9 @@ void check_processAIFilesResults(srp& sr) {
}
void
test_processAllFiles
()
{
char
*
fq_1_test
=
(
char
*
)
"../
data
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
data
/test_PE2.fq"
;
char
*
fq_single
=
(
char
*
)
"../
data
/test_single.fq"
;
char
*
fq_1_test
=
(
char
*
)
"../
test/data/unit
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
test/data/unit
/test_PE2.fq"
;
char
*
fq_single
=
(
char
*
)
"../
test/data/unit
/test_single.fq"
;
unsigned
char
f_id1
=
1
;
unsigned
char
f_id2
=
2
;
...
...
@@ -223,9 +223,9 @@ void test_processAllFiles() {
void
test_processInputFiles
()
{
char
*
fq_1_test
=
(
char
*
)
"../
data
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
data
/test_PE2.fq"
;
char
*
fq_single
=
(
char
*
)
"../
data
/test_single.fq"
;
char
*
fq_1_test
=
(
char
*
)
"../
test/data/unit
/test_PE1.fq"
;
char
*
fq_2_test
=
(
char
*
)
"../
test/data/unit
/test_PE2.fq"
;
char
*
fq_single
=
(
char
*
)
"../
test/data/unit
/test_single.fq"
;
IO_fq_files
s
;
s
.
in_fq_file
=
fq_single
;
...
...
This diff is collapsed.
Click to expand it.
src/unit_test_fqwriter.cpp
+
8
−
8
View file @
674e6528
...
...
@@ -86,18 +86,18 @@ void test_write_PE() {
map_id_backend
[
0
]
=
be_fq1
;
map_id_backend
[
1
]
=
be_fq2
;
be_fq1
->
i_filename
=
(
char
*
)
"../
data
/klebsiella_PE1.fq"
;
be_fq1
->
i_filename
=
(
char
*
)
"../
test/data/unit
/klebsiella_PE1.fq"
;
be_fq1
->
f_id
=
1
;
be_fq2
->
f_id
=
2
;
be_fq2
->
i_filename
=
(
char
*
)
"../
data
/klebsiella_PE2.fq"
;
be_fq1
->
setOutputFile
((
char
*
)
"../
data
/klebsiella_PE1_filtered.fq"
);
be_fq2
->
setOutputFile
((
char
*
)
"../
data
/klebsiella_PE2_filtered.fq"
);
be_fq2
->
i_filename
=
(
char
*
)
"../
test/data/unit
/klebsiella_PE2.fq"
;
be_fq1
->
setOutputFile
((
char
*
)
"../
test/data/unit
/klebsiella_PE1_filtered.fq"
);
be_fq2
->
setOutputFile
((
char
*
)
"../
test/data/unit
/klebsiella_PE2_filtered.fq"
);
writeFilteredFastq
(
map_id_backend
,
2
,
sr
);
// step 4 : re-read output files and check their content.
mode_t
mode
=
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IROTH
;
int
f_pe1
=
open
((
char
*
)
"../
data
/klebsiella_PE1_filtered.fq"
,
O_RDONLY
,
mode
);
int
f_pe1
=
open
((
char
*
)
"../
test/data/unit
/klebsiella_PE1_filtered.fq"
,
O_RDONLY
,
mode
);
assert
(
f_pe1
!=-
1
);
char
*
buf
=
(
char
*
)
malloc
(
FqBaseBackend
::
bufsize
*
sizeof
(
char
));
// test files are very small, bufsize is enough to read them entirely.
assert
(
buf
!=
NULL
);
...
...
@@ -111,7 +111,7 @@ void test_write_PE() {
}
#endif
assert
(
strcmp
(
buf
,
expected_content_PE1
)
==
0
);
int
f_pe2
=
open
((
char
*
)
"../
data
/klebsiella_PE2_filtered.fq"
,
O_RDONLY
,
mode
);
int
f_pe2
=
open
((
char
*
)
"../
test/data/unit
/klebsiella_PE2_filtered.fq"
,
O_RDONLY
,
mode
);
assert
(
f_pe2
!=-
1
);
nread
=
read
(
f_pe2
,
buf
,
FqBaseBackend
::
bufsize
);
assert
(
nread
<
FqBaseBackend
::
bufsize
);
...
...
@@ -126,8 +126,8 @@ void test_write_PE() {
// step5 : remove output files from disk
assert
(
remove
((
char
*
)
"../
data
/klebsiella_PE1_filtered.fq"
)
==
0
);
assert
(
remove
((
char
*
)
"../
data
/klebsiella_PE2_filtered.fq"
)
==
0
);
assert
(
remove
((
char
*
)
"../
test/data/unit
/klebsiella_PE1_filtered.fq"
)
==
0
);
assert
(
remove
((
char
*
)
"../
test/data/unit
/klebsiella_PE2_filtered.fq"
)
==
0
);
}
...
...
This diff is collapsed.
Click to expand it.
src/unit_test_read_utils.cpp
+
3
−
3
View file @
674e6528
...
...
@@ -33,7 +33,7 @@ void test_getReadSingle() {
DnaSeqStr
a_seqs
;
char
dna_read
[
MAX_READ_LENGTH
];
char
*
fq_single2
=
(
char
*
)
"../
data
/test_single2.fq"
;
char
*
fq_single2
=
(
char
*
)
"../
test/data/unit
/test_single2.fq"
;
FqMainBackend
be_fq
=
FqMainBackend
(
&
io_sr
);
// TODO, remove argument from constructor
be_fq
.
openInputFile
(
fq_single2
,
4
);
...
...
@@ -85,8 +85,8 @@ void getDnaStr(FqBaseBackend * fic_map[],rpos my_struct,DnaSeqStr* a_seqs,char *
void
test_getReadPE
()
{
rpos
my_struct1
,
my_struct2
;
char
*
fq_PE1
=
(
char
*
)
"../
data
/test_PE1_2.fq"
;
char
*
fq_PE2
=
(
char
*
)
"../
data
/test_PE2_2.fq"
;
char
*
fq_PE1
=
(
char
*
)
"../
test/data/unit
/test_PE1_2.fq"
;
char
*
fq_PE2
=
(
char
*
)
"../
test/data/unit
/test_PE2_2.fq"
;
srp
io_sr
;
unsigned
int
j
=
0
;
char
dna_read
[
MAX_READ_LENGTH
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment