Commit f9c2e3a9 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Fix few tests.

	* tests/core/other/var.cc: Does nothing if compiled with gcc 3.x.

	* tests/geom/rotate.cc,
	* tests/transform/hough.cc: Fix reference values.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4239 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 141f4850
2009-07-06 Guillaume Lazzara <guillaume.lazzara@lrde.epita.fr>
Fix few tests.
* tests/core/other/var.cc: Does nothing if compiled with gcc 3.x.
* tests/geom/rotate.cc,
* tests/transform/hough.cc: Fix reference values.
2009-07-03 Guillaume Lazzara <guillaume.lazzara@lrde.epita.fr>
 
* mln/geom/rotate.hh: Fix compilation issues.
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -23,6 +24,12 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
/// \file
///
/// Test of macros based on mln_VAR.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/neighb2d.hh>
......@@ -31,6 +38,13 @@
#include <mln/core/var.hh>
// mln_VAR is known not to work with old gcc versions. This test does
// nothing for these compilers.
//
#if (defined(__GNUC__) && __GNUC__ >= 4)
template <typename T>
void test_template()
{
......@@ -125,8 +139,14 @@ void test()
}
}
#endif
int main()
{
#if (defined(__GNUC__) && __GNUC__ >= 4)
test();
test_template<int>();
#endif
}
......@@ -26,17 +26,15 @@
# include <mln/core/image/image2d.hh>
# include <mln/geom/rotate.hh>
# include <mln/make/image.hh>
# include <mln/make/box1d.hh>
# include <mln/data/compare.hh>
int main()
{
using namespace mln;
bool ref_values[][5] = { { 0, 1, 0, 0, 0 },
{ 0, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 0 },
{ 0, 0, 0, 1, 1 },
{ 0, 0, 0, 0, 1 } };
bool ref_values[][5] = { { 0, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 0 } };
bool values[][5] = { { 0, 0, 1, 0, 0 },
{ 0, 0, 1, 0, 0 },
......@@ -45,7 +43,12 @@ int main()
{ 0, 0, 1, 0, 0 } };
image2d<bool> ima = make::image(values);
image2d<bool> ref = make::image(ref_values);
image2d<bool> ref(make::box2d(1,0, 2,4), 0);
for (unsigned i = 0; i < 2; ++i)
for (unsigned j = 0; j < 5; ++j)
ref(ref.point_at_index(i + j + 4 * i)) = ref_values[i][j];
image2d<bool> ima_rot = geom::rotate(ima, 45);
......
......@@ -23,9 +23,9 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
# include <mln/core/image/image2d.hh>
# include <mln/transform/hough.hh>
# include <mln/make/image.hh>
#include <mln/core/image/image2d.hh>
#include <mln/transform/hough.hh>
#include <mln/make/image.hh>
int main()
{
......@@ -48,5 +48,5 @@ int main()
max_p = p;
// Checking angle value.
mln_assertion(max_p.col() == 335);
mln_assertion(max_p.row() == 155);
}
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