Commit 4609993b authored by Michaël Roynard's avatar Michaël Roynard
Browse files

Re-enable part of filter unit test

parent e6a5e473
...@@ -28,12 +28,10 @@ TEST(View, filter_readonly) ...@@ -28,12 +28,10 @@ TEST(View, filter_readonly)
mln_foreach_new (auto&& pix, ima.new_pixels()) mln_foreach_new (auto&& pix, ima.new_pixels())
{ {
(void)pix; if (pix.val() > 10)
// FIXME: ASSERT_EQ(pix.val(), x(pix.point()));
// if (pix.val() > 10) else
// ASSERT_EQ(pix.val(), x(pix.point())); ASSERT_EQ(pix.val(), x.at(pix.point()));
// else
// ASSERT_EQ(pix.val(), x.at(pix.point()));
} }
mln_foreach_new (auto&& pix, x.new_pixels()) mln_foreach_new (auto&& pix, x.new_pixels())
...@@ -57,7 +55,7 @@ TEST(View, filter_writable) ...@@ -57,7 +55,7 @@ TEST(View, filter_writable)
ASSERT_TRUE(mln::experimental::all(ima <= 10)); ASSERT_TRUE(mln::experimental::all(ima <= 10));
} }
/*
TEST(View, filter_twice) TEST(View, filter_twice)
{ {
using namespace mln; using namespace mln;
...@@ -67,19 +65,23 @@ TEST(View, filter_twice) ...@@ -67,19 +65,23 @@ TEST(View, filter_twice)
image2d<int> ima(dom); image2d<int> ima(dom);
iota(ima, 0); iota(ima, 0);
auto x = view::filter(ima, [](int v) { return v > 10; }); auto u = view::filter(ima, [](int v) { return v > 10 && v < 15; });
auto u = view::filter(x, [](int v) { return v < 15; });
ASSERT_TRUE(mln::experimental::all(land(u > 10, u < 15))); // FIXME:
// auto x = view::filter(ima, [](int v) { return v > 10; });
// auto u = view::filter(x, [](int v) { return v < 15; });
// FIXME:
// ASSERT_TRUE(mln::experimental::all(land(u > 10, u < 15)));
mln_foreach_new (auto&& pix, ima.new_pixels()) mln_foreach_new (auto&& pix, ima.new_pixels())
{ {
(void)pix; if (pix.val() > 10 and pix.val() < 15)
ASSERT_EQ(pix.val(), u(pix.point()));
else
ASSERT_EQ(pix.val(), u.at(pix.point()));
// FIXME: // FIXME:
// if (pix.val() > 10 and pix.val() < 15)
// ASSERT_EQ(pix.val(), u(pix.point()));
// else
// ASSERT_EQ(pix.val(), u.at(pix.point()));
// ASSERT_TRUE(!u.domain().has(pix.point())); // ASSERT_TRUE(!u.domain().has(pix.point()));
} }
...@@ -94,17 +96,13 @@ TEST(View, filter_twice) ...@@ -94,17 +96,13 @@ TEST(View, filter_twice)
{ {
mln_foreach_new ((auto [old_v, new_v]), mln::ranges::view::zip(before.new_values(), u.new_values())) mln_foreach_new ((auto [old_v, new_v]), mln::ranges::view::zip(before.new_values(), u.new_values()))
{ {
(void)old_v; if (old_v > 10 && old_v < 15)
(void)new_v; ASSERT_EQ(1, new_v);
// FIXME: else
// if (old_v > 10 && old_v < 15) ASSERT_EQ(old_v, new_v);
// ASSERT_EQ(1, new_v);
// else
// ASSERT_EQ(old_v, new_v);
} }
} }
mln_foreach_new (auto&& px, u.new_pixels()) mln_foreach_new (auto&& px, u.new_pixels())
ASSERT_EQ(px.val(), ima(px.point())); ASSERT_EQ(px.val(), ima(px.point()));
} }
*/
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment