Test des Neighborhoods ajouté

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1665 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-01-21 15:29:03 +00:00
commit 88afa96663
8 changed files with 164 additions and 14 deletions

View file

@ -0,0 +1,43 @@
#include <neighborhood/moBitNeighborhood.h>
#include <cstdlib>
#include <cassert>
int main(){
std::cout << "[t-moBitNeighborhood] => START" << std::endl;
//init sol
eoBit<int> sol;
sol.push_back(true);
sol.push_back(false);
sol.push_back(true);
moBitNeighbor<int> neighbor;
//verif du constructeur vide
moBitNeighborhood<moBitNeighbor<int> > test;
assert(test.position()==0);
//verif du hasneighbor
assert(test.hasNeighbor(sol));
//verif de init
test.init(sol, neighbor);
assert(neighbor.index()==0);
assert(test.position()==0);
//verif du next
test.next(sol, neighbor);
assert(neighbor.index()==1);
assert(test.position()==1);
//verif du cont
test.next(sol, neighbor);
assert(test.cont(sol));
test.next(sol, neighbor);
assert(!test.cont(sol));
std::cout << "[t-moBitNeighborhood] => OK" << std::endl;
return EXIT_SUCCESS;
}