* mln/morpho/reconstruction/by_dilation/union_find.hh,
* mln/morpho/reconstruction/by_erosion/union_find.hh
(union_find_dispatch(image::kind::logic, Image, Image, Neighborhood)):
Here.
* tests/morpho/reconstruction/by_dilation/union_find.cc,
* tests/morpho/reconstruction/by_erosion/union_find.cc:
Rename as...
* tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc,
* tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc:
...these.
* tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc,
* tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc:
New tests.
* tests/morpho/reconstruction/by_dilation/Makefile.am,
* tests/morpho/reconstruction/by_erosion/Makefile.am:
Adjust.
(check_PROGRAMS): Add union_find_on_sets.
(union_find_on_sets_SOURCES): New.
(XFAIL_TESTS): New. Add union_find_on_sets.
---
milena/ChangeLog | 24 ++++++++++++++++++++
.../reconstruction/by_dilation/union_find.hh | 17 +++++++++++++-
.../morpho/reconstruction/by_erosion/union_find.hh | 17 +++++++++++++-
.../morpho/reconstruction/by_dilation/Makefile.am | 14 ++++++-----
.../{union_find.cc => union_find_on_functions.cc} | 1 +
.../{union_find.cc => union_find_on_sets.cc} | 12 +++++-----
.../morpho/reconstruction/by_erosion/Makefile.am | 14 ++++++-----
.../{union_find.cc => union_find_on_functions.cc} | 1 +
.../{union_find.cc => union_find_on_sets.cc} | 10 ++++----
9 files changed, 85 insertions(+), 25 deletions(-)
copy milena/tests/morpho/reconstruction/by_dilation/{union_find.cc =>
union_find_on_functions.cc} (97%)
rename milena/tests/morpho/reconstruction/by_dilation/{union_find.cc =>
union_find_on_sets.cc} (87%)
copy milena/tests/morpho/reconstruction/by_erosion/{union_find.cc =>
union_find_on_functions.cc} (97%)
rename milena/tests/morpho/reconstruction/by_erosion/{union_find.cc =>
union_find_on_sets.cc} (87%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b9ba16d..77e5cc3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,27 @@
+2010-12-10 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Ensure non implemented reconstructions on sets abort at run time.
+
+ * mln/morpho/reconstruction/by_dilation/union_find.hh,
+ * mln/morpho/reconstruction/by_erosion/union_find.hh
+ (union_find_dispatch(image::kind::logic, Image, Image, Neighborhood)):
+ Here.
+ * tests/morpho/reconstruction/by_dilation/union_find.cc,
+ * tests/morpho/reconstruction/by_erosion/union_find.cc:
+ Rename as...
+ * tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc,
+ * tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc:
+ ...these.
+ * tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc,
+ * tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc:
+ New tests.
+ * tests/morpho/reconstruction/by_dilation/Makefile.am,
+ * tests/morpho/reconstruction/by_erosion/Makefile.am:
+ Adjust.
+ (check_PROGRAMS): Add union_find_on_sets.
+ (union_find_on_sets_SOURCES): New.
+ (XFAIL_TESTS): New. Add union_find_on_sets.
+
2010-11-29 Roland Levillain <roland(a)lrde.epita.fr>
Work around g++ 4.5 deficiencies to compile Milena.
diff --git a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
index 4e1d675..59f15e4 100644
--- a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
+++ b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,7 +27,11 @@
#ifndef MLN_MORPHO_RECONSTRUCTION_BY_DILATION_UNION_FIND_HH
# define MLN_MORPHO_RECONSTRUCTION_BY_DILATION_UNION_FIND_HH
+# include <cstdlib>
+
+# include <iostream>
# include <vector>
+
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
@@ -221,6 +226,16 @@ namespace mln
const Neighborhood<N>& nbh)
{
// FIXME: Not yet implemented.
+ std::cerr
+ << __FILE__ << ":" << __LINE__ << ":
error:\n"
+ "mln::morpho::reconstruction::by_dilation::internal::\n"
+ " union_find_dispatch(mln::trait::image::kind::logic,\n"
+ " const mln::Image<I>&,\n"
+ " const mln::Image<J>&,\n"
+ " const mln::Neighborhood<N>&)\n"
+ "not implemented."
+ << std::endl;
+ std::abort();
}
template <typename I, typename J, typename N>
diff --git a/milena/mln/morpho/reconstruction/by_erosion/union_find.hh
b/milena/mln/morpho/reconstruction/by_erosion/union_find.hh
index 27869a2..ebce224 100644
--- a/milena/mln/morpho/reconstruction/by_erosion/union_find.hh
+++ b/milena/mln/morpho/reconstruction/by_erosion/union_find.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,7 +27,11 @@
#ifndef MLN_MORPHO_RECONSTRUCTION_BY_EROSION_UNION_FIND_HH
# define MLN_MORPHO_RECONSTRUCTION_BY_EROSION_UNION_FIND_HH
+# include <cstdlib>
+
+# include <iostream>
# include <vector>
+
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
@@ -219,6 +224,16 @@ namespace mln
const Neighborhood<N>& nbh)
{
// FIXME: Not yet implemented.
+ std::cerr
+ << __FILE__ << ":" << __LINE__ << ":
error:\n"
+ "mln::morpho::reconstruction::by_erosion::internal::\n"
+ " union_find_dispatch(mln::trait::image::kind::logic,\n"
+ " const mln::Image<I>&,\n"
+ " const mln::Image<J>&,\n"
+ " const mln::Neighborhood<N>&)\n"
+ "not implemented."
+ << std::endl;
+ std::abort();
}
template <typename I, typename J, typename N>
diff --git a/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
b/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
index 48f1460..b1a78b9 100644
--- a/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
+++ b/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -16,12 +16,14 @@
include $(top_srcdir)/milena/tests/tests.mk
-
check_PROGRAMS = \
- union_find
-
-
-union_find_SOURCES = union_find.cc
+ union_find_on_functions \
+ union_find_on_sets
+union_find_on_functions_SOURCES = union_find_on_functions.cc
+union_find_on_sets_SOURCES = union_find_on_sets.cc
TESTS = $(check_PROGRAMS)
+
+# Reconstruction by dilation on sets in not implemented yet.
+XFAIL_TESTS = union_find_on_sets
diff --git a/milena/tests/morpho/reconstruction/by_dilation/union_find.cc
b/milena/tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc
similarity index 97%
copy from milena/tests/morpho/reconstruction/by_dilation/union_find.cc
copy to milena/tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc
index b5125d4..094b9d4 100644
--- a/milena/tests/morpho/reconstruction/by_dilation/union_find.cc
+++ b/milena/tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc
@@ -50,6 +50,7 @@ int main()
mln_assertion(out == lena);
}
+ // FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
diff --git a/milena/tests/morpho/reconstruction/by_dilation/union_find.cc
b/milena/tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc
similarity index 87%
rename from milena/tests/morpho/reconstruction/by_dilation/union_find.cc
rename to milena/tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc
index b5125d4..90946bf 100644
--- a/milena/tests/morpho/reconstruction/by_dilation/union_find.cc
+++ b/milena/tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -27,8 +27,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/pw/all.hh>
-#include <mln/io/pgm/load.hh>
-#include <mln/value/int_u8.hh>
+#include <mln/io/pbm/load.hh>
#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_dilation/union_find.hh>
@@ -42,15 +41,16 @@ int main()
using namespace mln;
using namespace morpho::reconstruction::by_dilation;
- image2d<value::int_u8> lena, lena_2, out;
- io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
+ image2d<bool> lena, lena_2, out;
+ io::pbm::load(lena, MLN_IMG_DIR "/tiny.pbm");
{
out = union_find(lena, lena, c4());
mln_assertion(out == lena);
}
- {
+ // FIXME: Is this part really meaningful as-is?
+ {
initialize(lena_2, lena);
data::fill(lena_2, lena);
out = union_find(lena_2, lena, c4());
diff --git a/milena/tests/morpho/reconstruction/by_erosion/Makefile.am
b/milena/tests/morpho/reconstruction/by_erosion/Makefile.am
index 48f1460..74449d1 100644
--- a/milena/tests/morpho/reconstruction/by_erosion/Makefile.am
+++ b/milena/tests/morpho/reconstruction/by_erosion/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -16,12 +16,14 @@
include $(top_srcdir)/milena/tests/tests.mk
-
check_PROGRAMS = \
- union_find
-
-
-union_find_SOURCES = union_find.cc
+ union_find_on_functions \
+ union_find_on_sets
+union_find_on_functions_SOURCES = union_find_on_functions.cc
+union_find_on_sets_SOURCES = union_find_on_sets.cc
TESTS = $(check_PROGRAMS)
+
+# Reconstruction by erosion on sets in not implemented yet.
+XFAIL_TESTS = union_find_on_sets
diff --git a/milena/tests/morpho/reconstruction/by_erosion/union_find.cc
b/milena/tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc
similarity index 97%
copy from milena/tests/morpho/reconstruction/by_erosion/union_find.cc
copy to milena/tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc
index ff7156b..a7bb01a 100644
--- a/milena/tests/morpho/reconstruction/by_erosion/union_find.cc
+++ b/milena/tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc
@@ -50,6 +50,7 @@ int main()
mln_assertion(out == lena);
}
+ // FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
diff --git a/milena/tests/morpho/reconstruction/by_erosion/union_find.cc
b/milena/tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc
similarity index 87%
rename from milena/tests/morpho/reconstruction/by_erosion/union_find.cc
rename to milena/tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc
index ff7156b..9c521ac 100644
--- a/milena/tests/morpho/reconstruction/by_erosion/union_find.cc
+++ b/milena/tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -27,8 +27,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/pw/all.hh>
-#include <mln/io/pgm/load.hh>
-#include <mln/value/int_u8.hh>
+#include <mln/io/pbm/load.hh>
#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_erosion/union_find.hh>
@@ -42,14 +41,15 @@ int main()
using namespace mln;
using namespace morpho::reconstruction::by_erosion;
- image2d<value::int_u8> lena, lena_2, out;
- io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
+ image2d<bool> lena, lena_2, out;
+ io::pbm::load(lena, MLN_IMG_DIR "/tiny.pbm");
{
out = union_find(lena, lena, c4());
mln_assertion(out == lena);
}
+ // FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
--
1.5.6.5