29 #include <mln/make/detachment.hh>
31 #include "tests/core/image/complex_image.hh"
37 typedef mln::bin_2complex_image2d I;
38 typedef mln_psite_(I) P;
42 mln::complex_lower_higher_neighborhood<I::dim, mln_geom_(I)> adj_nbh;
62 I ima = make_test_bin_2complex_image2d();
65 P v0(ima.domain(), 0, 0);
66 P v1(ima.domain(), 0, 1);
67 P e0(ima.domain(), 1, 0);
68 P e2(ima.domain(), 1, 2);
69 P t0(ima.domain(), 2, 0);
83 mln::p_set<P> detach_t0 = mln::make::detachment(ima, t0, adj_nbh);
84 mln_assertion(detach_t0.
nsites() == 4);
85 mln_assertion(detach_t0.has(t0));
86 mln_assertion(detach_t0.has(e0));
87 mln_assertion(detach_t0.has(e2));
88 mln_assertion(detach_t0.has(v1));
92 mln::p_set<P> detach_e0 = mln::make::detachment(ima, e0, adj_nbh);
93 mln_assertion(detach_e0.nsites() == 0);
96 mln::p_set<P> detach_v0 = mln::make::detachment(ima, v0, adj_nbh);
97 mln_assertion(detach_v0.nsites() == 0);