Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aevol-eukaryotes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
LUISELLI Juliette
aevol-eukaryotes
Commits
43548812
Commit
43548812
authored
1 year ago
by
David Parsons
Browse files
Options
Downloads
Patches
Plain Diff
setup unit tests for Dna_7
parent
cbc45792
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/gtest/CMakeLists.txt
+1
-0
1 addition, 0 deletions
test/gtest/CMakeLists.txt
test/gtest/DnaTest.cpp
+105
-0
105 additions, 0 deletions
test/gtest/DnaTest.cpp
with
106 additions
and
0 deletions
test/gtest/CMakeLists.txt
+
1
−
0
View file @
43548812
...
@@ -16,6 +16,7 @@ set(test_libs
...
@@ -16,6 +16,7 @@ set(test_libs
# List of all the tests
# List of all the tests
set
(
TESTS
set
(
TESTS
SampleTest
SampleTest
DnaTest
IndividualTest
IndividualTest
JumpingMTTest
JumpingMTTest
TranscriptionTranslationTest
TranscriptionTranslationTest
...
...
This diff is collapsed.
Click to expand it.
test/gtest/DnaTest.cpp
0 → 100644
+
105
−
0
View file @
43548812
// ****************************************************************************
//
// Aevol - An in silico experimental evolution platform
//
// ****************************************************************************
//
// Copyright: See the AUTHORS file provided with the package or <www.aevol.fr>
// Web: http://www.aevol.fr/
// E-mail: See <http://www.aevol.fr/contact/>
// Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//*****************************************************************************
// =================================================================
// Includes
// =================================================================
#include
<gtest/gtest.h>
#include
<array>
#include
<memory>
#include
<string>
#include
"Dna_7.h"
#include
"macros.h"
using
namespace
aevol
;
//############################################################################
// #
// Class IndividualTest #
// #
//############################################################################
class
DnaTest
:
public
testing
::
Test
{
protected:
virtual
void
SetUp
(
void
);
virtual
void
TearDown
(
void
);
std
::
string
genome1
;
Dna_7
*
dna1
;
};
// ===========================================================================
// Public Methods
// ===========================================================================
void
DnaTest
::
SetUp
(
void
)
{
// Build ad-hoc dna
//
// dna1: AS + prom + AS + AG + AS + term + AS + prom + AS
//
// AS = Arbitrary Sequence
// AG = Arbitrary Gene
// Do not modify the sequences !
// Define arbitrary sequences
std
::
array
<
std
::
string
,
5
>
as
=
{
"0011"
,
"11101"
,
"110011"
,
"11000"
,
"000101"
};
// Define an arbitrary gene
std
::
string
gene
=
std
::
string
(
SHINE_DAL_SEQ
)
+
"0011000100110110010001"
;
// Define an arbitrary terminator
std
::
string
term
=
"01000001101"
;
// Define a few arbitrary promoters
std
::
array
<
std
::
string
,
2
>
prom
=
{
"0101010001110110010110"
,
// dist from consensus: 2 => basal level: 0.6
"0101011001110010010010"
// dist from consensus: 1 => basal level: 0.8
};
// Build dna1
genome1
=
as
[
0
]
+
prom
[
0
]
+
as
[
1
]
+
gene
+
as
[
2
]
+
term
+
as
[
3
]
+
prom
[
1
]
+
as
[
4
];
dna1
=
Dna_7
::
make_from_sequence
(
genome1
.
c_str
(),
genome1
.
size
());
}
void
DnaTest
::
TearDown
()
{
Dna_7
::
release
(
std
::
move
(
dna1
));
}
TEST_F
(
DnaTest
,
TestDna
)
{
// Check genome size
EXPECT_EQ
(
genome1
.
size
(),
dna1
->
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