Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 43548812 authored by David Parsons's avatar David Parsons
Browse files

setup unit tests for Dna_7

parent cbc45792
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
// ****************************************************************************
//
// 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());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment