* tests/core/other/var.cc: Does nothing if compiled with gcc 3.x.
* tests/geom/rotate.cc,
* tests/transform/hough.cc: Fix reference values.
---
milena/ChangeLog | 9 +++++++++
milena/tests/core/other/var.cc | 22 +++++++++++++++++++++-
milena/tests/geom/rotate.cc | 15 +++++++++------
milena/tests/transform/hough.cc | 8 ++++----
4 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index eab445b..fcbfd26 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,12 @@
+2009-07-06 Guillaume Lazzara <guillaume.lazzara(a)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(a)lrde.epita.fr>
* mln/geom/rotate.hh: Fix compilation issues.
diff --git a/milena/tests/core/other/var.cc b/milena/tests/core/other/var.cc
index cba6425..4e6fa76 100644
--- a/milena/tests/core/other/var.cc
+++ b/milena/tests/core/other/var.cc
@@ -1,4 +1,5 @@
-// 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
+
}
diff --git a/milena/tests/geom/rotate.cc b/milena/tests/geom/rotate.cc
index bd2e1f0..c06aeb2 100644
--- a/milena/tests/geom/rotate.cc
+++ b/milena/tests/geom/rotate.cc
@@ -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);
diff --git a/milena/tests/transform/hough.cc b/milena/tests/transform/hough.cc
index ff343bf..fc691db 100644
--- a/milena/tests/transform/hough.cc
+++ b/milena/tests/transform/hough.cc
@@ -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);
}
--
1.5.6.5