[PATCH 04/31] Add I/O tests.

* tests/io/Makefile.am: Update for dicom and IM. * tests/io/dicom/Makefile.am: New Makefile for dicom. * tests/io/dicom/dicom.cc: New test. * tests/io/magick/Makefile.am: New Makefile for IM. * tests/io/magick/magick.cc: New test. --- milena/ChangeLog | 9 +++++ milena/tests/io/Makefile.am | 2 + milena/tests/io/dicom/Makefile.am | 10 ++++++ milena/tests/io/dicom/dicom.cc | 50 ++++++++++++++++++++++++++++++ milena/tests/io/magick/Makefile.am | 10 ++++++ milena/tests/io/magick/magick.cc | 60 ++++++++++++++++++++++++++++++++++++ 6 files changed, 141 insertions(+), 0 deletions(-) create mode 100644 milena/tests/io/dicom/Makefile.am create mode 100644 milena/tests/io/dicom/dicom.cc create mode 100644 milena/tests/io/magick/Makefile.am create mode 100644 milena/tests/io/magick/magick.cc diff --git a/milena/ChangeLog b/milena/ChangeLog index ff6c707..a8a37ed 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,12 @@ +2009-05-06 Fabien Freling <fabien.freling@lrde.epita.fr> + + Add I/O tests. + * tests/io/Makefile.am: Update for dicom and IM. + * tests/io/dicom/Makefile.am: New Makefile for dicom. + * tests/io/dicom/dicom.cc: New test. + * tests/io/magick/Makefile.am: New Makefile for IM. + * tests/io/magick/magick.cc: New test. + 2009-05-06 Guillaume Lazzara <lazzara@lrde.epita.fr> Add adjacency matrix. diff --git a/milena/tests/io/Makefile.am b/milena/tests/io/Makefile.am index cc4a0f8..760d591 100644 --- a/milena/tests/io/Makefile.am +++ b/milena/tests/io/Makefile.am @@ -3,8 +3,10 @@ include $(top_srcdir)/milena/tests/tests.mk SUBDIRS = \ + dicom \ dump \ fits \ + magick \ off \ pbm \ pfm \ diff --git a/milena/tests/io/dicom/Makefile.am b/milena/tests/io/dicom/Makefile.am new file mode 100644 index 0000000..07646c8 --- /dev/null +++ b/milena/tests/io/dicom/Makefile.am @@ -0,0 +1,10 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ + dicom + +dicom_SOURCES = dicom.cc + +TESTS = $(check_PROGRAMS) diff --git a/milena/tests/io/dicom/dicom.cc b/milena/tests/io/dicom/dicom.cc new file mode 100644 index 0000000..ada15f8 --- /dev/null +++ b/milena/tests/io/dicom/dicom.cc @@ -0,0 +1,50 @@ +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/io/dicom/dicom.cc +/// +/// Test on mln::io::dicom::*. + +#include <mln/core/image/image2d.hh> +#include <mln/io/dicom/load.hh> +#include <mln/io/dump/save.hh> + +#include <mln/level/compare.hh> + +#include <mln/value/int_u12.hh> + +#include "tests/data.hh" + +#include <mln/debug/println.hh> + +int main() +{ + using namespace mln; + + return 0; +} + diff --git a/milena/tests/io/magick/Makefile.am b/milena/tests/io/magick/Makefile.am new file mode 100644 index 0000000..1c7308d --- /dev/null +++ b/milena/tests/io/magick/Makefile.am @@ -0,0 +1,10 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ + magick + +magick_SOURCES = magick.cc + +TESTS = $(check_PROGRAMS) diff --git a/milena/tests/io/magick/magick.cc b/milena/tests/io/magick/magick.cc new file mode 100644 index 0000000..d6145fc --- /dev/null +++ b/milena/tests/io/magick/magick.cc @@ -0,0 +1,60 @@ +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/io/magick/magick.cc +/// +/// Test on mln::io::magick::*. + +#include <mln/core/image/image2d.hh> +#include <mln/io/magick/load.hh> +#include <mln/io/ppm/save.hh> + +#include <mln/level/compare.hh> + +#include <mln/value/int_u8.hh> +#include <mln/value/rgb8.hh> + +#include "tests/data.hh" + +#include <mln/debug/println.hh> + +int main() +{ + using namespace mln; + + { + image2d<value::rgb8> lena_im; + io::magick::load(lena_im, "lena.png"); + + image2d<value::rgb8> lena_mln; + io::ppm::load(lena_mln, "lena.ppm"); + + mln_assertion(lena_im.domain() == lena_mln.domain()); + mln_assertion(lena_im == lena_mln); + } +} + -- 1.6.1.2
participants (1)
-
Roland Levillain