* tests/labeling/compute.cc: use label8 instead of int_u8 as labeled
image value type.
* tests/unit_test/Makefile.am: update unit tests list.
* tests/unit_test/mln_fun_l2l_all.cc,
* tests/unit_test/mln_fun_l2l_essential.cc,
* tests/unit_test/mln_morpho_tree_all.cc,
* tests/unit_test/mln_morpho_tree_compute_parent.cc,
* tests/unit_test/mln_morpho_tree_data.cc,
* tests/unit_test/mln_morpho_tree_max.cc,
* tests/unit_test/mln_morpho_tree_utils.cc,
* tests/unit_test/mln_util_line_graph.cc: new unit tests.
* tests/unit_test/mln_util_dual_graph.cc: delete. Dual_graph does not
exist anymore.
---
milena/ChangeLog | 21 ++++++++++++++++++++
milena/tests/labeling/compute.cc | 21 +++++++++++++++----
milena/tests/unit_test/Makefile.am | 18 +++++++++++++++-
milena/tests/unit_test/mln_fun_l2l_all.cc | 8 +++++++
milena/tests/unit_test/mln_fun_l2l_essential.cc | 8 +++++++
milena/tests/unit_test/mln_morpho_tree_all.cc | 8 +++++++
.../unit_test/mln_morpho_tree_compute_parent.cc | 8 +++++++
milena/tests/unit_test/mln_morpho_tree_data.cc | 8 +++++++
milena/tests/unit_test/mln_morpho_tree_max.cc | 8 +++++++
milena/tests/unit_test/mln_morpho_tree_utils.cc | 8 +++++++
milena/tests/unit_test/mln_util_dual_graph.cc | 8 -------
milena/tests/unit_test/mln_util_line_graph.cc | 8 +++++++
12 files changed, 117 insertions(+), 15 deletions(-)
create mode 100644 milena/tests/unit_test/mln_fun_l2l_all.cc
create mode 100644 milena/tests/unit_test/mln_fun_l2l_essential.cc
create mode 100644 milena/tests/unit_test/mln_morpho_tree_all.cc
create mode 100644 milena/tests/unit_test/mln_morpho_tree_compute_parent.cc
create mode 100644 milena/tests/unit_test/mln_morpho_tree_data.cc
create mode 100644 milena/tests/unit_test/mln_morpho_tree_max.cc
create mode 100644 milena/tests/unit_test/mln_morpho_tree_utils.cc
delete mode 100644 milena/tests/unit_test/mln_util_dual_graph.cc
create mode 100644 milena/tests/unit_test/mln_util_line_graph.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c2dc31d..7091654 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,26 @@
2008-11-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Update unit_tests and labeling::compute test.
+
+ * tests/labeling/compute.cc: use label8 instead of int_u8 as labeled
+ image value type.
+
+ * tests/unit_test/Makefile.am: update unit tests list.
+
+ * tests/unit_test/mln_fun_l2l_all.cc,
+ * tests/unit_test/mln_fun_l2l_essential.cc,
+ * tests/unit_test/mln_morpho_tree_all.cc,
+ * tests/unit_test/mln_morpho_tree_compute_parent.cc,
+ * tests/unit_test/mln_morpho_tree_data.cc,
+ * tests/unit_test/mln_morpho_tree_max.cc,
+ * tests/unit_test/mln_morpho_tree_utils.cc,
+ * tests/unit_test/mln_util_line_graph.cc: new unit tests.
+
+ * tests/unit_test/mln_util_dual_graph.cc: delete. Dual_graph does not
+ exist anymore.
+
+2008-11-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Upgrade tutorial.
* Doxyfile.in: add new path to included files.
diff --git a/milena/tests/labeling/compute.cc b/milena/tests/labeling/compute.cc
index af003a6..1d26ab1 100644
--- a/milena/tests/labeling/compute.cc
+++ b/milena/tests/labeling/compute.cc
@@ -42,6 +42,7 @@
int main()
{
using namespace mln;
+ using value::label8;
using value::int_u8;
int_u8 vals[6][5] = {
@@ -53,29 +54,39 @@ int main()
{2, 0, 0, 0, 0}
};
image2d<int_u8> ima = make::image(vals);
- int_u8 nlabels = 3;
+
+ label8 lblvals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {2, 2, 0, 3, 0},
+ {2, 0, 3, 3, 3},
+ {2, 0, 0, 0, 0}
+ };
+ image2d<label8> lbl = make::image(lblvals);
+ label8 nlabels = 3;
accu::sum<int_u8> sum;
- util::array<float> sums = labeling::compute(sum, ima, ima, nlabels);
+ util::array<float> sums = labeling::compute(sum, ima, lbl, nlabels);
mln_assertion(sums[0] == 0);
mln_assertion(sums[1] == 4);
mln_assertion(sums[2] == 8);
mln_assertion(sums[3] == 12);
- sums = labeling::compute(accu::meta::sum(), ima, ima, nlabels);
+ sums = labeling::compute(accu::meta::sum(), ima, lbl, nlabels);
mln_assertion(sums[0] == 0);
mln_assertion(sums[1] == 4);
mln_assertion(sums[2] == 8);
mln_assertion(sums[3] == 12);
accu::count<mln_site_(image2d<int_u8>)> count;
- util::array<unsigned int> counts = labeling::compute(count, ima, nlabels);
+ util::array<unsigned int> counts = labeling::compute(count, lbl, nlabels);
mln_assertion(counts[0] == 18);
mln_assertion(counts[1] == 4);
mln_assertion(counts[2] == 4);
mln_assertion(counts[3] == 4);
- counts = labeling::compute(accu::meta::count(), ima, nlabels);
+ counts = labeling::compute(accu::meta::count(), lbl, nlabels);
mln_assertion(counts[0] == 18);
mln_assertion(counts[1] == 4);
mln_assertion(counts[2] == 4);
diff --git a/milena/tests/unit_test/Makefile.am b/milena/tests/unit_test/Makefile.am
index e1c7897..3c30dc5 100644
--- a/milena/tests/unit_test/Makefile.am
+++ b/milena/tests/unit_test/Makefile.am
@@ -68,7 +68,6 @@ mln_registration_registration\
mln_registration_essential\
mln_registration_icp\
mln_util_graph\
-mln_util_dual_graph\
mln_util_max\
mln_util_lazy_set\
mln_util_set\
@@ -95,6 +94,7 @@ mln_util_ignore\
mln_util_greater_psite\
mln_util_timer\
mln_util_yes\
+mln_util_line_graph\
mln_util_ord\
mln_util_tree_fast_to_image\
mln_util_tree\
@@ -217,6 +217,8 @@ mln_fun_i2v_array\
mln_fun_i2v_all_to\
mln_fun_i2v_essential\
mln_fun_l2l_relabel\
+mln_fun_l2l_all\
+mln_fun_l2l_essential\
mln_fun_x2x_composed\
mln_fun_x2x_all\
mln_fun_x2x_translation\
@@ -577,6 +579,11 @@ mln_morpho_closing_area_on_vertices\
mln_morpho_closing_volume\
mln_morpho_minus\
mln_morpho_gradient\
+mln_morpho_tree_max\
+mln_morpho_tree_compute_parent\
+mln_morpho_tree_all\
+mln_morpho_tree_utils\
+mln_morpho_tree_data\
mln_morpho_opening_area_on_vertices\
mln_morpho_min\
mln_morpho_closing\
@@ -1066,7 +1073,6 @@ mln_registration_registration_SOURCES =
mln_registration_registration.cc
mln_registration_essential_SOURCES = mln_registration_essential.cc
mln_registration_icp_SOURCES = mln_registration_icp.cc
mln_util_graph_SOURCES = mln_util_graph.cc
-mln_util_dual_graph_SOURCES = mln_util_dual_graph.cc
mln_util_max_SOURCES = mln_util_max.cc
mln_util_lazy_set_SOURCES = mln_util_lazy_set.cc
mln_util_set_SOURCES = mln_util_set.cc
@@ -1093,6 +1099,7 @@ mln_util_ignore_SOURCES = mln_util_ignore.cc
mln_util_greater_psite_SOURCES = mln_util_greater_psite.cc
mln_util_timer_SOURCES = mln_util_timer.cc
mln_util_yes_SOURCES = mln_util_yes.cc
+mln_util_line_graph_SOURCES = mln_util_line_graph.cc
mln_util_ord_SOURCES = mln_util_ord.cc
mln_util_tree_fast_to_image_SOURCES = mln_util_tree_fast_to_image.cc
mln_util_tree_SOURCES = mln_util_tree.cc
@@ -1215,6 +1222,8 @@ mln_fun_i2v_array_SOURCES = mln_fun_i2v_array.cc
mln_fun_i2v_all_to_SOURCES = mln_fun_i2v_all_to.cc
mln_fun_i2v_essential_SOURCES = mln_fun_i2v_essential.cc
mln_fun_l2l_relabel_SOURCES = mln_fun_l2l_relabel.cc
+mln_fun_l2l_all_SOURCES = mln_fun_l2l_all.cc
+mln_fun_l2l_essential_SOURCES = mln_fun_l2l_essential.cc
mln_fun_x2x_composed_SOURCES = mln_fun_x2x_composed.cc
mln_fun_x2x_all_SOURCES = mln_fun_x2x_all.cc
mln_fun_x2x_translation_SOURCES = mln_fun_x2x_translation.cc
@@ -1575,6 +1584,11 @@ mln_morpho_closing_area_on_vertices_SOURCES =
mln_morpho_closing_area_on_vertice
mln_morpho_closing_volume_SOURCES = mln_morpho_closing_volume.cc
mln_morpho_minus_SOURCES = mln_morpho_minus.cc
mln_morpho_gradient_SOURCES = mln_morpho_gradient.cc
+mln_morpho_tree_max_SOURCES = mln_morpho_tree_max.cc
+mln_morpho_tree_compute_parent_SOURCES = mln_morpho_tree_compute_parent.cc
+mln_morpho_tree_all_SOURCES = mln_morpho_tree_all.cc
+mln_morpho_tree_utils_SOURCES = mln_morpho_tree_utils.cc
+mln_morpho_tree_data_SOURCES = mln_morpho_tree_data.cc
mln_morpho_opening_area_on_vertices_SOURCES = mln_morpho_opening_area_on_vertices.cc
mln_morpho_min_SOURCES = mln_morpho_min.cc
mln_morpho_closing_SOURCES = mln_morpho_closing.cc
diff --git a/milena/tests/unit_test/mln_fun_l2l_all.cc
b/milena/tests/unit_test/mln_fun_l2l_all.cc
new file mode 100644
index 0000000..b3b931f
--- /dev/null
+++ b/milena/tests/unit_test/mln_fun_l2l_all.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/fun/l2l/all.hh.
+// Generated file, do not modify.
+#include <mln/fun/l2l/all.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_fun_l2l_essential.cc
b/milena/tests/unit_test/mln_fun_l2l_essential.cc
new file mode 100644
index 0000000..4fe07d2
--- /dev/null
+++ b/milena/tests/unit_test/mln_fun_l2l_essential.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/fun/l2l/essential.hh.
+// Generated file, do not modify.
+#include <mln/fun/l2l/essential.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_morpho_tree_all.cc
b/milena/tests/unit_test/mln_morpho_tree_all.cc
new file mode 100644
index 0000000..8518c2c
--- /dev/null
+++ b/milena/tests/unit_test/mln_morpho_tree_all.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/morpho/tree/all.hh.
+// Generated file, do not modify.
+#include <mln/morpho/tree/all.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_morpho_tree_compute_parent.cc
b/milena/tests/unit_test/mln_morpho_tree_compute_parent.cc
new file mode 100644
index 0000000..34782a5
--- /dev/null
+++ b/milena/tests/unit_test/mln_morpho_tree_compute_parent.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/morpho/tree/compute_parent.hh.
+// Generated file, do not modify.
+#include <mln/morpho/tree/compute_parent.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_morpho_tree_data.cc
b/milena/tests/unit_test/mln_morpho_tree_data.cc
new file mode 100644
index 0000000..8f0a079
--- /dev/null
+++ b/milena/tests/unit_test/mln_morpho_tree_data.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/morpho/tree/data.hh.
+// Generated file, do not modify.
+#include <mln/morpho/tree/data.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_morpho_tree_max.cc
b/milena/tests/unit_test/mln_morpho_tree_max.cc
new file mode 100644
index 0000000..338d5e5
--- /dev/null
+++ b/milena/tests/unit_test/mln_morpho_tree_max.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/morpho/tree/max.hh.
+// Generated file, do not modify.
+#include <mln/morpho/tree/max.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_morpho_tree_utils.cc
b/milena/tests/unit_test/mln_morpho_tree_utils.cc
new file mode 100644
index 0000000..bb5a0f2
--- /dev/null
+++ b/milena/tests/unit_test/mln_morpho_tree_utils.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/morpho/tree/utils.hh.
+// Generated file, do not modify.
+#include <mln/morpho/tree/utils.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_util_dual_graph.cc
b/milena/tests/unit_test/mln_util_dual_graph.cc
deleted file mode 100644
index 6b2e34f..0000000
--- a/milena/tests/unit_test/mln_util_dual_graph.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-// Unit test for mln/util/dual_graph.hh.
-// Generated file, do not modify.
-#include <mln/util/dual_graph.hh>
-
-int main()
-{
- // Nothing.
-}
diff --git a/milena/tests/unit_test/mln_util_line_graph.cc
b/milena/tests/unit_test/mln_util_line_graph.cc
new file mode 100644
index 0000000..4882ef6
--- /dev/null
+++ b/milena/tests/unit_test/mln_util_line_graph.cc
@@ -0,0 +1,8 @@
+// Unit test for mln/util/line_graph.hh.
+// Generated file, do not modify.
+#include <mln/util/line_graph.hh>
+
+int main()
+{
+ // Nothing.
+}
--
1.5.6.5