olena-2.0-43-g8765935 Improve io::dump tests with floating values.

* tests/io/dump/Makefile.am, * tests/io/dump/dump.cc: Here. --- milena/ChangeLog | 7 +++++++ milena/tests/io/dump/Makefile.am | 4 +++- milena/tests/io/dump/dump.cc | 20 +++++++++++++++++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index a628305..ecf9a42 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,10 @@ +2011-11-24 Guillaume Lazzara <z@lrde.epita.fr> + + Improve io::dump tests with floating values. + + * tests/io/dump/Makefile.am, + * tests/io/dump/dump.cc: Here. + 2011-11-23 Guillaume Lazzara <z@lrde.epita.fr> New routine in Milena. diff --git a/milena/tests/io/dump/Makefile.am b/milena/tests/io/dump/Makefile.am index dedd818..eb2f606 100644 --- a/milena/tests/io/dump/Makefile.am +++ b/milena/tests/io/dump/Makefile.am @@ -1,4 +1,5 @@ -# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE). +# Copyright (C) 2009, 2010, 2011 EPITA Research and Development +# Laboratory (LRDE). # # This file is part of Olena. # @@ -25,6 +26,7 @@ TESTS = $(check_PROGRAMS) MOSTLYCLEANFILES = \ dump-bool.dump \ + dump-double.dump \ dump-float.dump \ dump-int_u8.dump \ dump-rgb8.dump \ diff --git a/milena/tests/io/dump/dump.cc b/milena/tests/io/dump/dump.cc index f8b8f66..598237a 100644 --- a/milena/tests/io/dump/dump.cc +++ b/milena/tests/io/dump/dump.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -85,8 +86,8 @@ int main() /// Value: float { - float data[4] = { 5, 1, - 1, 9 }; + float data[4] = { 5.2, 1.4, + mln_min(float), mln_max(float) }; image2d<float> pic = make::image2d(data); io::dump::save(pic, "dump-float.dump"); image2d<float> pic2; @@ -96,6 +97,19 @@ int main() mln_assertion(pic == pic2); } + /// Value: double + { + double data[4] = { 5.2, 1.4, + mln_min(double), mln_max(double) }; + image2d<double> pic = make::image2d(data); + io::dump::save(pic, "dump-double.dump"); + image2d<double> pic2; + io::dump::load(pic2, "dump-double.dump"); + + mln_assertion(pic.domain() == pic2.domain()); + mln_assertion(pic == pic2); + } + /// Value: rgb8 { -- 1.7.2.5
participants (1)
-
Guillaume Lazzara