* tests/fun/l2l/wrap.cc,
* tests/accu/transform_line.cc: avoid warnings.
* tests/core/other/Makefile.am,
* tests/core/other/line_graph_elt_neighborhood.cc,
* tests/core/other/line_graph_elt_window.cc: remove deprecated tests.
* tests/core/other/graph_elt_neighborhood.cc,
* tests/core/other/graph_elt_window.cc: update window declarations.
* tests/make/graph.cc: rename as...
* tests/make/influence_zone_adjacency_graph.cc: ... this.
---
milena/ChangeLog | 17 +++
milena/tests/accu/transform_line.cc | 2 +-
milena/tests/core/other/Makefile.am | 4 -
milena/tests/core/other/graph_elt_neighborhood.cc | 5 +-
milena/tests/core/other/graph_elt_window.cc | 5 +-
.../core/other/line_graph_elt_neighborhood.cc | 115 --------------------
milena/tests/core/other/line_graph_elt_window.cc | 113 -------------------
milena/tests/fun/l2l/wrap.cc | 12 +-
...{graph.cc => influence_zone_adjacency_graph.cc} | 8 +-
9 files changed, 34 insertions(+), 247 deletions(-)
delete mode 100644 milena/tests/core/other/line_graph_elt_neighborhood.cc
delete mode 100644 milena/tests/core/other/line_graph_elt_window.cc
rename milena/tests/make/{graph.cc => influence_zone_adjacency_graph.cc} (89%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 20968b2..13558bc 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,20 @@
+2009-04-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Fix more tests.
+
+ * tests/fun/l2l/wrap.cc,
+ * tests/accu/transform_line.cc: avoid warnings.
+
+ * tests/core/other/Makefile.am,
+ * tests/core/other/line_graph_elt_neighborhood.cc,
+ * tests/core/other/line_graph_elt_window.cc: remove deprecated tests.
+
+ * tests/core/other/graph_elt_neighborhood.cc,
+ * tests/core/other/graph_elt_window.cc: update window declarations.
+
+ * tests/make/graph.cc: rename as...
+ * tests/make/influence_zone_adjacency_graph.cc: ... this.
+
2009-04-14 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Fix tests.
diff --git a/milena/tests/accu/transform_line.cc b/milena/tests/accu/transform_line.cc
index c87a8f2..192c327 100644
--- a/milena/tests/accu/transform_line.cc
+++ b/milena/tests/accu/transform_line.cc
@@ -45,7 +45,7 @@ int main()
for (unsigned dir = 0; dir < 2; ++dir)
{
image2d<unsigned> out = accu::transform_line(accu::meta::count(), ima, len,
dir);
- mln_assertion(out == (pw::cst(3) | ima.domain()));
+ mln_assertion(out == (pw::cst(3u) | ima.domain()));
}
}
diff --git a/milena/tests/core/other/Makefile.am b/milena/tests/core/other/Makefile.am
index 018f1e6..0257f27 100644
--- a/milena/tests/core/other/Makefile.am
+++ b/milena/tests/core/other/Makefile.am
@@ -11,8 +11,6 @@ check_PROGRAMS = \
dpoints_pixter \
graph_elt_neighborhood \
graph_elt_window \
- line_graph_elt_neighborhood \
- line_graph_elt_window \
neighb \
pixel \
pixter1d \
@@ -32,8 +30,6 @@ category_SOURCES = category.cc
dpoints_pixter_SOURCES = dpoints_pixter.cc
graph_elt_neighborhood_SOURCES = graph_elt_neighborhood.cc
graph_elt_window_SOURCES = graph_elt_window.cc
-line_graph_elt_neighborhood_SOURCES = line_graph_elt_neighborhood.cc
-line_graph_elt_window_SOURCES = line_graph_elt_window.cc
neighb_SOURCES = neighb.cc
pixel_SOURCES = pixel.cc
pixter1d_SOURCES = pixter1d.cc
diff --git a/milena/tests/core/other/graph_elt_neighborhood.cc
b/milena/tests/core/other/graph_elt_neighborhood.cc
index aafe485..5c9c0fe 100644
--- a/milena/tests/core/other/graph_elt_neighborhood.cc
+++ b/milena/tests/core/other/graph_elt_neighborhood.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -101,7 +102,7 @@ int main()
mln_psite_(pv_t) p(pg, 1);
// ``Sliding'' neighborhood of a psite of PG.
- typedef graph_elt_neighborhood<G, F> nbh_t;
+ typedef graph_elt_neighborhood<G, pv_t> nbh_t;
nbh_t nbh;
unsigned i = 0;
diff --git a/milena/tests/core/other/graph_elt_window.cc
b/milena/tests/core/other/graph_elt_window.cc
index 62a43e3..86c3228 100644
--- a/milena/tests/core/other/graph_elt_window.cc
+++ b/milena/tests/core/other/graph_elt_window.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -101,7 +102,7 @@ int main()
mln_psite_(pg_t) p(pg, 1);
// ``Sliding'' window of a psite of PG.
- typedef graph_elt_window<G, F> win_t;
+ typedef graph_elt_window<G, pg_t> win_t;
win_t win;
unsigned i = 0;
diff --git a/milena/tests/core/other/line_graph_elt_neighborhood.cc
b/milena/tests/core/other/line_graph_elt_neighborhood.cc
deleted file mode 100644
index cbc7d75..0000000
--- a/milena/tests/core/other/line_graph_elt_neighborhood.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// 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/core/other/line_graph_elt_neighborhood.cc
-///
-/// Tests on mln::line_graph_elt_neighborhood.
-
-#include <vector>
-
-#include <mln/core/alias/point2d.hh>
-#include <mln/core/site_set/p_edges.hh>
-
-#include <mln/util/graph.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-
-
-unsigned fwd_neighb[] = { 0, 2, 4 };
-unsigned bkd_neighb[] = { 4, 2, 0 };
-
-
-int main()
-{
- using namespace mln;
-
- typedef point2d p_t;
-
- /*--------.
- | Graph. |
- `--------*/
-
- /* The graph and its corresponding line graph are as follows:
-
- 0 1 2 3 4 0 1 2 3 4
- .----------- .-----------
- | |
- 0 | 0 2 0 | * *
- 1 | \ / | 1 | 0 1 |
- 2 | 1 | 2 | * 4
- 3 | \ | 3 | 2 |
- 4 | 3-4 4 | *3*
-
- */
-
- // Points associated to vertices.
- typedef fun::i2v::array<p_t> F;
- F points(5);
- points(0) = point2d(0,0); // Point associated to vertex 0.
- points(1) = point2d(2,2); // Point associated to vertex 1.
- points(2) = point2d(0,4); // Point associated to vertex 2.
- points(3) = point2d(4,3); // Point associated to vertex 3.
- points(4) = point2d(4,4); // Point associated to vertex 4.
-
- // Edges.
- typedef mln::util::graph G;
- G g;
-
- // Populate the graph with vertices.
- g.add_vertices(points.size());
-
- // Populate the graph with edges.
- g.add_edge(0, 1);
- g.add_edge(1, 2);
- g.add_edge(1, 3);
- g.add_edge(3, 4);
- g.add_edge(4, 2);
-
- /*-------------------------.
- | Graph and neighborhood. |
- `-------------------------*/
-
- // Line graph psite set.
- typedef p_edges<G, F> pe_t;
- pe_t pe(g, points);
-
- // Line graph point site.
- mln_psite_(pe_t) p(pe, 1);
-
- // ``Sliding'' neighborhood of a psite of PLG.
- typedef line_graph_elt_neighborhood<G, F> nbh_t;
- nbh_t nbh;
-
- unsigned i = 0;
- mln_fwd_niter_(nbh_t) fq(nbh, p);
- for_all(fq)
- mln_assertion(fq.element().id() == fwd_neighb[i++]);
-
- i = 0;
- mln_bkd_niter_(nbh_t) bq(nbh, p);
- for_all(bq)
- mln_assertion(bq.element().id() == bkd_neighb[i++]);
-}
diff --git a/milena/tests/core/other/line_graph_elt_window.cc
b/milena/tests/core/other/line_graph_elt_window.cc
deleted file mode 100644
index 6d6934e..0000000
--- a/milena/tests/core/other/line_graph_elt_window.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// 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/core/other/line_graph_elt_window.cc
-///
-/// Tests on mln::line_graph_elt_window.
-
-#include <vector>
-
-#include <mln/core/alias/point2d.hh>
-#include <mln/core/neighb.hh>
-#include <mln/core/site_set/p_edges.hh>
-#include <mln/core/image/line_graph_elt_window.hh>
-
-#include <mln/util/graph.hh>
-
-unsigned fwd_neighb[] = { 0, 2, 4 };
-unsigned bkd_neighb[] = { 4, 2, 0 };
-
-
-int main()
-{
- using namespace mln;
-
- typedef point2d p_t;
-
- /*--------.
- | Graph. |
- `--------*/
-
- /* The graph and its corresponding line graph are as follows:
-
- 0 1 2 3 4 0 1 2 3 4
- .----------- .-----------
- | |
- 0 | 0 2 0 | * *
- 1 | \ / | 1 | 0 1 |
- 2 | 1 | 2 | * 4
- 3 | \ | 3 | 2 |
- 4 | 3-4 4 | *3*
-
- */
-
- // Points associated to vertices.
- typedef fun::i2v::array<p_t> F;
- F points(5);
- points(0) = point2d(0,0); // Point associated to vertex 0.
- points(1) = point2d(2,2); // Point associated to vertex 1.
- points(2) = point2d(0,4); // Point associated to vertex 2.
- points(3) = point2d(4,3); // Point associated to vertex 3.
- points(4) = point2d(4,4); // Point associated to vertex 4.
-
- // Edges.
- typedef mln::util::graph G;
- G g;
-
- // Populate the graph with vertices.
- g.add_vertices(points.size());
-
- // Populate the graph with edges.
- g.add_edge(0, 1);
- g.add_edge(1, 2);
- g.add_edge(1, 3);
- g.add_edge(3, 4);
- g.add_edge(4, 2);
-
- /*------------------.
- | Graph and window. |
- `------------------*/
-
- // Line graph psite set.
- p_edges<G, F> pe(g, points);
- // Line graph point site.
- p_edges_psite<G, F> p(pe, 1);
- // ``Sliding'' window of a psite of PLG.
- typedef line_graph_elt_window<G, F> win_t;
- win_t win;
-
- unsigned i = 0;
- mln_fwd_qiter_(win_t) fq(win, p);
- for_all(fq)
- mln_assertion(fq.element().id() == fwd_neighb[i++]);
-
- i = 0;
- mln_bkd_qiter_(win_t) bq(win, p);
- for_all(bq)
- mln_assertion(bq.element().id() == bkd_neighb[i++]);
-
-}
diff --git a/milena/tests/fun/l2l/wrap.cc b/milena/tests/fun/l2l/wrap.cc
index 0e92faa..78d339a 100644
--- a/milena/tests/fun/l2l/wrap.cc
+++ b/milena/tests/fun/l2l/wrap.cc
@@ -49,10 +49,10 @@ int main()
l510 = 510,
l511 = 511;
- mln_assertion( f(l0) == 0 );
- mln_assertion( f(l1) == 1 );
- mln_assertion( f(l255) == 255 );
- mln_assertion( f(l256) == 1 );
- mln_assertion( f(l510) == 255 );
- mln_assertion( f(l511) == 1 );
+ mln_assertion(f(l0) == 0u);
+ mln_assertion(f(l1) == 1u);
+ mln_assertion(f(l255) == 255u);
+ mln_assertion(f(l256) == 1u);
+ mln_assertion(f(l510) == 255u);
+ mln_assertion(f(l511) == 1u);
}
diff --git a/milena/tests/make/graph.cc
b/milena/tests/make/influence_zone_adjacency_graph.cc
similarity index 89%
rename from milena/tests/make/graph.cc
rename to milena/tests/make/influence_zone_adjacency_graph.cc
index bb88706..fe4b172 100644
--- a/milena/tests/make/graph.cc
+++ b/milena/tests/make/influence_zone_adjacency_graph.cc
@@ -25,14 +25,14 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/make/graph.cc
+/// \file tests/make/influence_zone_adjacency_graph.cc
///
-/// Tests on mln::make::graph.
+/// Tests on mln::make::influence_zone_adjacency_graph.
#include <mln/make/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/util/graph.hh>
-#include <mln/make/graph.hh>
+#include <mln/make/influence_zone_adjacency_graph.hh>
#include <mln/value/label_8.hh>
@@ -46,7 +46,7 @@ int main()
image2d<value::label_8> ima = make::image2d(vals);
- util::graph g = make::graph(ima, c4(), 4u);
+ util::graph g = make::influence_zone_adjacency_graph(ima, c4(), 4u);
mln_assertion(g.e_nmax() == 7u);
mln_assertion(g.v_nmax() == 5u);
--
1.5.6.5