proto-1.0 182: Fix tests of apply2, pw::apply and level::fill

https://svn.lrde.epita.fr/svn/oln/prototypes/proto-1.0 ChangeLog | 16 ++++++++++++++++ oln/makefile.src | 13 ++++++------- tests/core/tests/apply-binary | 12 ++++++------ tests/level/tests/fill | 2 +- tests/pw/tests/apply | 18 ------------------ tests/pw/tests/apply-binary | 4 ++-- tests/pw/tests/apply-unary | 2 +- 7 files changed, 32 insertions(+), 35 deletions(-) Index: olena/ChangeLog from Roland Levillain <roland@lrde.epita.fr> Fix tests of apply2, pw::apply and level::fill. * tests/core/tests/apply-binary (check): Adjust calls to oln::apply2. * olena/tests/pw/tests/apply: Rename as... * olena/tests/pw/tests/apply-unary: ...this. (check): s/p_lit/p_literal/. * olena/tests/pw/tests/apply-binary (check): Likewise. * tests/level/tests/fill (check): s/for_all/for_all_p/ * oln/makefile.src (OLN_DEP): Remove arith/cmp.hh, arith/logic.hh, arith/max.hh, arith/min.hh, arith/ops.hh and funobj/meta.hh. Add level/arith.hh, level/logic.hh, ops/arith.hh, ops/cmp.hh and ops/logic.hh. Index: olena/tests/pw/tests/apply-unary --- olena/tests/pw/tests/apply-unary (revision 181) +++ olena/tests/pw/tests/apply-unary (working copy) @@ -11,7 +11,7 @@ bool check() { any_point p; - pw::literal<int> pv1 (p_lit(42)); + pw::literal<int> pv1 (p_literal(42)); int res = p_apply(mlc::make_unary_fun(std::negate<int>()), pv1)(p); return !(res == -42); Index: olena/tests/pw/tests/apply --- olena/tests/pw/tests/apply (revision 181) +++ olena/tests/pw/tests/apply (working copy) @@ -1,18 +0,0 @@ - // -*- C++ -*- -#include <iostream> - -#include <cmath> -#include <oln/core/pw/apply.hh> -#include <oln/core/pw/literal.hh> -#include <oln/core/any/point.hh> - -using namespace oln; - -bool check() -{ - any_point p; - pw::literal<int> pv1 (p_lit(42)); - - int res = p_apply(mlc::make_unary_fun(std::negate<int>()), pv1)(p); - return !(res == -42); -} Index: olena/tests/pw/tests/apply-binary --- olena/tests/pw/tests/apply-binary (revision 181) +++ olena/tests/pw/tests/apply-binary (working copy) @@ -12,8 +12,8 @@ { any_point p; - pw::literal<int> pv1 (p_lit(1)); - pw::literal<int> pv2 (p_lit(2)); + pw::literal<int> pv1 (p_literal(1)); + pw::literal<int> pv2 (p_literal(2)); int res = p_apply(mlc::make_binary_fun(std::plus<int>()), pv1, pv2)(p); return not (res == 3); Index: olena/tests/level/tests/fill --- olena/tests/level/tests/fill (revision 181) +++ olena/tests/level/tests/fill (working copy) @@ -42,7 +42,7 @@ oln::level::fill(im, 51); oln::fwd_piter2d it(im.size()); - for_all(it) + for_all_p(it) if (im[it] != 51) return true; Index: olena/tests/core/tests/apply-binary --- olena/tests/core/tests/apply-binary (revision 181) +++ olena/tests/core/tests/apply-binary (working copy) @@ -47,28 +47,28 @@ oln::image2d<int> ima3(10, 10); oln::level::fill(ima3, 12); - // oln::apply, with a hand-made mlc::abstract::binary_function. + // oln::apply2, with a hand-made mlc::abstract::binary_function. { oln::image2d<int> ima; - ima = oln::apply(f_mult(), ima1, ima2); + ima = oln::apply2(f_mult(), ima1, ima2); if (!oln::level::is_equal(ima, ima3)) return true; } - // oln::apply, with a mlc::binary_function built using the helper + // oln::apply2, with a mlc::binary_function built using the helper // function mlc::make_binary_fun on a classic function. { oln::image2d<int> ima; - ima = oln::apply(mlc::make_binary_fun(mult), ima1, ima2); + ima = oln::apply2(mlc::make_binary_fun(mult), ima1, ima2); if (!oln::level::is_equal(ima, ima3)) return true; } - // oln::apply, with a mlc::binary_function built using the helper + // oln::apply2, with a mlc::binary_function built using the helper // function mlc::make_binary_fun on a std::binary_function. { oln::image2d<int> ima; ima = - oln::apply(mlc::make_binary_fun(std::multiplies<int>()), ima1, ima2); + oln::apply2(mlc::make_binary_fun(std::multiplies<int>()), ima1, ima2); if (!oln::level::is_equal(ima, ima3)) return true; } Index: olena/oln/makefile.src --- olena/oln/makefile.src (revision 181) +++ olena/oln/makefile.src (working copy) @@ -6,12 +6,6 @@ OLN_DEP = \ all.hh \ \ - arith/cmp.hh \ - arith/logic.hh \ - arith/max.hh \ - arith/min.hh \ - arith/ops.hh \ - \ basics1d.hh \ basics2d.hh \ basics3d.hh \ @@ -137,7 +131,6 @@ funobj/cmp.hh \ funobj/invert.hh \ funobj/logic.hh \ - funobj/meta.hh \ \ io/gz_stream.hh \ io/read_image_2d_pnm.hh \ @@ -146,8 +139,14 @@ io/write_image_2d_pnm.hh \ io/write_image.hh \ \ + level/arith.hh \ level/compare.hh \ level/fill.hh \ + level/logic.hh \ + \ + ops/arith.hh \ + ops/cmp.hh \ + ops/logic.hh \ \ morpho/closing.hh \ morpho/dilation.hh \
participants (1)
-
Roland Levillain