From 193e01608360f6cf98dd7072acbb9431335c9be4 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Fri, 7 May 2010 15:27:55 +0000 Subject: [PATCH] test updated git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1803 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-mo/src/mo.h | 2 +- trunk/paradiseo-mo/test/CMakeLists.txt | 1 + trunk/paradiseo-mo/test/t-moEvalCounter.cpp | 21 +++++++++++++++++++ .../test/t-moRandomNeutralWalk.cpp | 19 +++++++++++++++++ trunk/paradiseo-mo/test/t-moRandomSearch.cpp | 1 + 5 files changed, 43 insertions(+), 1 deletion(-) diff --git a/trunk/paradiseo-mo/src/mo.h b/trunk/paradiseo-mo/src/mo.h index e35fd1290..f74b07fcc 100755 --- a/trunk/paradiseo-mo/src/mo.h +++ b/trunk/paradiseo-mo/src/mo.h @@ -72,7 +72,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/paradiseo-mo/test/CMakeLists.txt b/trunk/paradiseo-mo/test/CMakeLists.txt index eed0a3f31..71c4c1c06 100644 --- a/trunk/paradiseo-mo/test/CMakeLists.txt +++ b/trunk/paradiseo-mo/test/CMakeLists.txt @@ -97,6 +97,7 @@ SET (TEST_LIST t-moDummyExplorer t-moLocalSearchInit t-moSolInit + t-moEvalCounter ) FOREACH (test ${TEST_LIST}) diff --git a/trunk/paradiseo-mo/test/t-moEvalCounter.cpp b/trunk/paradiseo-mo/test/t-moEvalCounter.cpp index e805c42a7..96afb67bd 100644 --- a/trunk/paradiseo-mo/test/t-moEvalCounter.cpp +++ b/trunk/paradiseo-mo/test/t-moEvalCounter.cpp @@ -32,11 +32,32 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include +#include "moTestClass.h" int main(){ std::cout << "[t-moEvalCounter] => START" << std::endl; + evalOneMax eval(4); + bitVector sol; + sol.resize(4); + sol[0]=true; + sol[1]=false; + sol[2]=true; + sol[3]=true; + sol.fitness(3); + bitNeighbor n; + n.index(2); + + moEvalCounter test(eval); + + test(sol,n); + assert(test.value()==1); + assert(n.fitness()==2); + n.index(1); + test(sol,n); + assert(test.value()==2); + assert(n.fitness()==4); std::cout << "[t-moEvalCounter] => OK" << std::endl; diff --git a/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp b/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp index 127f11720..d93cea255 100644 --- a/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp +++ b/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp @@ -31,11 +31,30 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include +#include +#include "moTestClass.h" +#include +#include +#include int main(){ std::cout << "[t-moRandomNeutralWalk] => START" << std::endl; + bitNeighborhood nh(4); + oneMaxEval fullEval; + evalOneMax eval(4); + moTrueContinuator cont; + moSolNeighborComparator sncomp; + + //test du 1er constructeur + moRandomNeutralWalk test1(nh, fullEval, eval, 3); + + //test du 2eme constructeur + moRandomNeutralWalk test2(nh, fullEval, eval, 3, cont); + + //test du 3eme constructeur + moRandomNeutralWalk test3(nh, fullEval, eval, 3, cont, sncomp); std::cout << "[t-moRandomNeutralWalk] => OK" << std::endl; diff --git a/trunk/paradiseo-mo/test/t-moRandomSearch.cpp b/trunk/paradiseo-mo/test/t-moRandomSearch.cpp index 50a486a91..3a196874c 100644 --- a/trunk/paradiseo-mo/test/t-moRandomSearch.cpp +++ b/trunk/paradiseo-mo/test/t-moRandomSearch.cpp @@ -39,6 +39,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr int main(){ std::cout << "[t-moRandomSearch] => START" << std::endl; + oneMaxEval fullEval; dummyInit init; moTrueContinuator cont;