
"Niels" == Niels Van Vliet <niels@lrde.epita.fr> writes:
Index: olena/tests/morpho/tests/gradient --- olena/tests/morpho/tests/gradient Mon, 12 Apr 2004 12:55:46 +0200 van-vl_n () +++ olena/tests/morpho/tests/gradient Mon, 12 Apr 2004 12:55:35 +0200 van-vl_n (oln/r/1_gradient 644) @@ -0,0 +1,39 @@ +// -*- c++ -*-
Pq ce fichier n'a pas d'extension ? Et attention à la license.
+ +#include <oln/basics2d.hh> +#include <oln/morpho/gradient.hh> +#include <oln/level/compare.hh> +#include <ntg/all.hh> +#include "check.hh" +#include "data.hh" + + +#define OK_OR_FAIL \ + std::cout << "OK" << std::endl; \ + else \ + { \ + std::cout << "FAIL" << std::endl; \ + fail = true; \ + }
Ce genre de macros qu'on retrouve dans tous vos fichiers devraient être collectées dans un header pour les tests. Mais je vois qu'il y a déjà un check.hh...
+ +template<class I> +bool are_not_eq(const oln::abstract::non_vectorial_image_with_dim<2, I> &im) +{ + return + !oln::level::is_equal(oln::morpho::fast::beucher_gradient(im, + oln::win_c8p()), + oln::morpho::beucher_gradient(im, oln::win_c8p())); +} + + +bool +check() +{ + bool fail = false; + + oln::image2d<ntg::int_u8> im8(oln::load(rdata("lena256.pgm"))); + if (are_not_eq(im8) == false) + OK_OR_FAIL; + + return fail; +}