
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-12-03 Matthieu Garrigues <garrigues@lrde.epita.fr> Fix Makefiles. * tests/Makefile.am: Add geom directory. * tests/accu/Makefile.am: Add new tests to the makefile. * tests/geom/Makefile.am: Likewise. * tests/accu/min.cc: Remove debug. * tests/accu/pair.cc: Finish the test. * tests/fi_adaptor.cc: Add documentation. --- Makefile.am | 2 ++ accu/Makefile.am | 24 +++++++++++++++++++++++- accu/min.cc | 3 +-- accu/pair.cc | 17 +++++------------ fi_adaptor.cc | 30 +++++++++++++++++++++--------- geom/Makefile.am | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+), 24 deletions(-) Index: trunk/milena/tests/accu/pair.cc =================================================================== --- trunk/milena/tests/accu/pair.cc (revision 1584) +++ trunk/milena/tests/accu/pair.cc (revision 1585) @@ -33,6 +33,8 @@ #include <mln/core/image2d.hh> #include <mln/value/int_u8.hh> +#include <mln/accu/pair.hh> +#include <mln/accu/max.hh> #include <mln/accu/mean.hh> int main() @@ -40,7 +42,7 @@ using namespace mln; { - accu::pair_<accu::mean<int>, accu::max<int> > mean; + accu::pair_<accu::mean_<int>, accu::max_<int> > mean; mean.take(10); mean.take(9); @@ -54,16 +56,7 @@ mean.take(1); mean.take(0); - mln_assertion(mean.to_result() == 5); - } - - { - mln_accu_with_(accu::mean, int) mean; - - mean.take(10); - mean.take(8); - mean.take(0); - - mln_assertion(mean.to_result() == 6); + mln_assertion(mean.to_result().first == 5); + mln_assertion(mean.to_result().second == 10); } } Index: trunk/milena/tests/accu/min.cc =================================================================== --- trunk/milena/tests/accu/min.cc (revision 1584) +++ trunk/milena/tests/accu/min.cc (revision 1585) @@ -54,8 +54,7 @@ // accu::compute< accu::min >(ima); - std::cout << accu::compute< accu::val<accu::min> >(ima) - << std::endl; + mln_assertion(accu::compute< accu::val<accu::min> >(ima) == 1); // std::cout << accu::compute< accu::min >(ima) // << std::endl; Index: trunk/milena/tests/accu/Makefile.am =================================================================== --- trunk/milena/tests/accu/Makefile.am (revision 1584) +++ trunk/milena/tests/accu/Makefile.am (revision 1585) @@ -4,11 +4,33 @@ check_PROGRAMS = \ all \ +bbox \ +compute \ +count \ +histo \ +max \ +max_h \ +mean \ +median \ min \ - nil +min_h \ +min_max \ +nil \ +pair all_SOURCES = all.cc +bbox_SOURCES = bbox.cc +compute_SOURCES = compute.cc +count_SOURCES = count.cc +histo_SOURCES = histo.cc +max_SOURCES = max.cc +max_h_SOURCES = max_h.cc +mean_SOURCES = mean.cc +median_SOURCES = median.cc min_SOURCES = min.cc +min_h_SOURCES = min_h.cc +min_max_SOURCES = min_max.cc nil_SOURCES = nil.cc +pair_SOURCES = pair.cc TESTS = $(check_PROGRAMS) Index: trunk/milena/tests/geom/Makefile.am =================================================================== --- trunk/milena/tests/geom/Makefile.am (revision 1584) +++ trunk/milena/tests/geom/Makefile.am (revision 1585) @@ -1,3 +1,44 @@ ## Process this file through Automake to create Makefile.in -*- Makefile -*- include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ +bbox \ +max_col \ +max_ind \ +max_row \ +max_sli \ +min_col \ +min_ind \ +min_row \ +min_sli \ +ncols \ +ninds \ +nrows \ +nslis \ +pmin_pmax \ +seed2tiling \ +seed2tiling_roundness \ +shift \ +sym + +bbox_SOURCES = bbox.cc +max_col_SOURCES = max_col.cc +max_ind_SOURCES = max_ind.cc +max_row_SOURCES = max_row.cc +max_sli_SOURCES = max_sli.cc +min_col_SOURCES = min_col.cc +min_ind_SOURCES = min_ind.cc +min_row_SOURCES = min_row.cc +min_sli_SOURCES = min_sli.cc +ncols_SOURCES = ncols.cc +ninds_SOURCES = ninds.cc +nrows_SOURCES = nrows.cc +nslis_SOURCES = nslis.cc +pmin_pmax_SOURCES = pmin_pmax.cc +seed2tiling_SOURCES = seed2tiling.cc +seed2tiling_roundness_SOURCES = seed2tiling_roundness.cc +shift_SOURCES = shift.cc +sym_SOURCES = sym.cc + +TESTS = $(check_PROGRAMS) Index: trunk/milena/tests/Makefile.am =================================================================== --- trunk/milena/tests/Makefile.am (revision 1584) +++ trunk/milena/tests/Makefile.am (revision 1585) @@ -12,6 +12,7 @@ debug \ draw \ fun \ + geom \ histo \ level \ logical \ @@ -289,6 +290,7 @@ fi_adaptor_SOURCES = fi_adaptor.cc fi_adaptor_CPPFLAGS = $(AM_CPPFLAGS) $(FREEIMAGEPLUS_CPPFLAGS) fi_adaptor_LDFLAGS = $(AM_LDFLAGS) $(FREEIMAGEPLUS_LDFLAGS) + endif TESTS = $(check_PROGRAMS) Index: trunk/milena/tests/fi_adaptor.cc =================================================================== --- trunk/milena/tests/fi_adaptor.cc (revision 1584) +++ trunk/milena/tests/fi_adaptor.cc (revision 1585) @@ -48,19 +48,29 @@ using namespace mln; +using namespace mln::value; + int main() { using typename value::int_u8; using typename value::rgb8; - // FIXME: Is this necessary? See FreeImagePlus' documentation. - FreeImage_Initialise(); + { + // FIXME: + // Under Linux or under any *nix OS (i.e. under Unix or MacOSX), you need to call + // FreeImage_Initialise at the beginning of your main function and you need to call + // FreeImage_DeInitialise at the end of this main function (this is not needed when + // using FreeImage as a .SO). + + //FreeImage_Initialise(); win::rectangle2d rect(51, 51); - fi_adaptor< image2d<int_u8> > adaptor; + fi_adaptor< image2d< int_u<8> > > adaptor; adaptor.load("../img/lena.pgm"); + display::save (adaptor); + display::show (adaptor, "xv"); image2d<int_u8> ima(adaptor.domain()); @@ -72,12 +82,14 @@ display::show (adaptor, "xv"); // FIXME: Likewise. - /* A comment here (probably coming from an example of FreeImagePlus' - documentation) used to say: - - call this ONLY when linking with FreeImage as a static library - + /* Check if this statement holds in our case. Maybe we need to involve Libtool in to handle FreeImagePlus properly. */ - FreeImage_DeInitialise(); + //FreeImage_DeInitialise(); + } + + { + + } + }