
* tests/io/off/load_save_bin.cc: New test. * tests/io/off/Makefile.am (check_PROGRAMS): Add load_save_bin. (load_save_bin_SOURCES): New. --- milena/ChangeLog | 8 +++++ milena/tests/io/off/Makefile.am | 4 ++- milena/tests/io/off/load_save_bin.cc | 50 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletions(-) create mode 100644 milena/tests/io/off/load_save_bin.cc diff --git a/milena/ChangeLog b/milena/ChangeLog index 50ba108..00d6b64 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -24,6 +24,14 @@ 2008-10-22 Roland Levillain <roland@lrde.epita.fr> + Exercise mln::io::off:save. + + * tests/io/off/load_save_bin.cc: New test. + * tests/io/off/Makefile.am (check_PROGRAMS): Add load_save_bin. + (load_save_bin_SOURCES): New. + +2008-10-22 Roland Levillain <roland@lrde.epita.fr> + Add a routine to save a complex-based image to an OFF file. * mln/io/off/save.hh: New. diff --git a/milena/tests/io/off/Makefile.am b/milena/tests/io/off/Makefile.am index 4b592ce..30f4824 100644 --- a/milena/tests/io/off/Makefile.am +++ b/milena/tests/io/off/Makefile.am @@ -3,8 +3,10 @@ include $(top_srcdir)/milena/tests/tests.mk check_PROGRAMS = \ - load_bin + load_bin \ + load_save_bin load_bin_SOURCES = load_bin.cc +load_save_bin_SOURCES = load_save_bin.cc TESTS = $(check_PROGRAMS) diff --git a/milena/tests/io/off/load_save_bin.cc b/milena/tests/io/off/load_save_bin.cc new file mode 100644 index 0000000..2dbbdcb --- /dev/null +++ b/milena/tests/io/off/load_save_bin.cc @@ -0,0 +1,50 @@ +// Copyright (C) 2008 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/off/load_save_bin.cc +/// \brief Test mln::io::off::load with and mln::io::off::save with an +/// mln::bin_2complex_image3df. + +#include <algorithm> +#include <iterator> +#include <iostream> + +#include <mln/io/off/load.hh> +#include <mln/io/off/save.hh> + +#include "tests/data.hh" + + +int main() +{ + using namespace mln; + + typedef bin_2complex_image3df ima_t; + ima_t ima; + io::off::load(ima, MLN_MESH_DIR "/tetrahedron.off"); + io::off::save(ima, "out.off"); +} -- 1.6.0.1