Commit efa4d420 authored by Guillaume Duhamel's avatar Guillaume Duhamel
Browse files

Update level tree test.

	* tests/border/adjust.cc: New file to test adjsut.
	* tests/border/find.cc: New.

	Update
	* tests/border/get.cc,
	* tests/border/resize.cc: Update these tests.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1497 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 905f8bff
2007-11-19 Guillaume Duhamel <guillaume.duhamel@lrde.epita.fr>
Update level tree test.
* tests/border/adjust.cc: New file to test adjsut.
* tests/border/find.cc: New.
Update
* tests/border/get.cc,
* tests/border/resize.cc: Update these tests.
2007-11-16 Guillaume Duhamel <guillaume.duhamel@lrde.epita.fr>
Add border subdirectory in test and add/update test.
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library 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 library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file tests/border/adjust.cc
*
* \brief Tests on mln::border::adjust.
*/
#include <mln/core/image2d.hh>
#include <mln/border/get.hh>
#include <mln/border/adjust.hh>
int main()
{
using namespace mln;
typedef image2d<int> I;
I ima(3,3, 51);
border::adjust(ima, 51);
mln_assertion(border::get(ima) == 51);
border::adjust(ima, 2);
mln_assertion(border::get(ima) == 51);
}
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library 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 library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file tests/border/find.cc
*
* \brief Tests on mln::border::find.
*/
#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/debug/iota.hh>
#include <mln/border/find.hh>
#include <mln/core/clone.hh>
int main()
{
using namespace mln;
image2d<int> ima(3, 3, 51);
debug::iota(ima);
box2d b = make::box2d(2,2);
mln_assertion(border::find( clone(ima | b)) == 51);
}
......@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file tests/border_get.cc
/*! \file tests/border/get.cc
*
* \brief Tests on mln::border::get.
*/
......
......@@ -32,11 +32,9 @@
#include <mln/core/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/value/int_u8.hh>
#include <mln/border/resize.hh>
#include <mln/debug/println_with_border.hh>
#include <mln/border/fill.hh>
#include <mln/border/get.hh>
using namespace mln;
......@@ -46,28 +44,10 @@ main (void)
unsigned border = 1;
unsigned new_border = 3;
std::cout << std::endl
<< "Test 2d resize"
<< std::endl
<< std::endl;
image2d<value::int_u8> ima(3, 2, border);
debug::iota(ima);
border::fill(ima, 8);
std::cout << "before resize ("
<< border
<< ")"
<< std::endl;
debug::println_with_border(ima);
std::cout << std::endl;
mln_assertion(border::get(ima) == border);
border::resize (ima, new_border);
std::cout << "after resize ("
<< new_border
<< ")"
<< std::endl;
debug::println_with_border(ima);
std::cout << std::endl;
mln_assertion(border::get(ima) == new_border);
border::resize (ima, border);
mln_assertion(border::get(ima) == border);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment