
"Giovanni" == Giovanni Palma <giovanni@lrde.epita.fr> writes:
Index: olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh1 --- olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh1 Tue, 23 Mar 2004 13:53:56 +0100 palma_g () +++ olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh1 Tue, 23 Mar 2004 12:06:42 +0100 palma_g (oln/k/20_out_olena_ 644) @@ -0,0 +1,28 @@ +// -*- c++ -*- +#include "data.hh" +#include <oln/utils/md5.hh> + +#include "check.hh" +#include <oln/basics2d.hh> +#include <oln/convol/fast_gaussian.hh> +#include <oln/core/behavior.hh> +#include <ntg/all.hh> + +int main() +{ +oln::utils::key::value_type data_key[16] = {0xc, 0xec, 0xc0, 0x4c, 0xf4, 0xd1, 0xab, 0xef, 0x1c, 0xd3, 0x9c, 0xa7, 0x4d, 0xd7, 0x28, 0x92}; + +oln::utils::key key(data_key); + + typedef oln::image2d<ntg:: +int_u8> im_type; + im_type im1(oln::load(rdata("lena256.pgm"))); + if (oln::utils::md5(oln::convol::fast::gaussian(im1, 2, oln::value_behavior<oln_value_type_(im_type)>(0))) == key) + std::cout << "OK" << std::endl; +else + { + std::cout << "FAIL" << std::endl; + return true; + } + return 0; + } Index: olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh0 --- olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh0 Tue, 23 Mar 2004 13:53:56 +0100 palma_g () +++ olena/tests/convol/tests/out_olena_oln_convol_fast_gaussian_hh0 Tue, 23 Mar 2004 12:06:31 +0100 palma_g (oln/k/21_out_olena_ 644) @@ -0,0 +1,28 @@ +// -*- c++ -*- +#include "data.hh" +#include <oln/utils/md5.hh> + +#include "check.hh" +#include <oln/basics2d.hh> +#include <oln/convol/fast_gaussian.hh> +#include <oln/core/behavior.hh> +#include <ntg/all.hh> + +int main() +{ +oln::utils::key::value_type data_key[16] = {0xc, 0xec, 0xc0, 0x4c, 0xf4, 0xd1, 0xab, 0xef, 0x1c, 0xd3, 0x9c, 0xa7, 0x4d, 0xd7, 0x28, 0x92}; + +oln::utils::key key(data_key); + + typedef oln::image2d<ntg:: +int_u8> im_type; + im_type im1(oln::load(rdata("lena256.pgm"))); + if (oln::utils::md5(oln::convol::fast::gaussian(im1, 2, oln::value_behavior<oln_value_type_(im_type)>(0))) == key) + std::cout << "OK" << std::endl; +else + { + std::cout << "FAIL" << std::endl; + return true; + } + return 0; + }
How come the tests are so close (actually, I don't even see the difference!) and not factored? The test suite deserves the same attention as the rest of the code, and repetition has never been a sign of quality in CS. There should be some framework around this, which may build these files.