* tests/io/magick/Makefile.am,
* tests/io/magick/save.cc: add a new test.
* tests/io/magick/load.cc: Read files from the right directory.
---
milena/ChangeLog | 9 +++++++++
milena/tests/io/magick/Makefile.am | 4 +++-
milena/tests/io/magick/load.cc | 11 ++++++-----
milena/tests/io/magick/{load.cc => save.cc} | 23 ++++++++++++++---------
4 files changed, 32 insertions(+), 15 deletions(-)
copy milena/tests/io/magick/{load.cc => save.cc} (78%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 40f9f88..c6701bf 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2009-05-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Improve io::magick tests.
+
+ * tests/io/magick/Makefile.am,
+ * tests/io/magick/save.cc: add a new test.
+
+ * tests/io/magick/load.cc: Read files from the right directory.
+
+2009-05-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Add hough transform.
* mln/transform/hough.hh: new routine.
diff --git a/milena/tests/io/magick/Makefile.am b/milena/tests/io/magick/Makefile.am
index e6bab71..20fe5ef 100644
--- a/milena/tests/io/magick/Makefile.am
+++ b/milena/tests/io/magick/Makefile.am
@@ -7,8 +7,10 @@ include $(top_srcdir)/milena/tests/tests.mk
AM_LDFLAGS = -lMagick++
check_PROGRAMS = \
- load
+ load \
+ save
load_SOURCES = load.cc
+save_SOURCES = save.cc
TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/io/magick/load.cc b/milena/tests/io/magick/load.cc
index dcf13ce..5ef0161 100644
--- a/milena/tests/io/magick/load.cc
+++ b/milena/tests/io/magick/load.cc
@@ -30,24 +30,25 @@
/// Test on mln::io::magick::load.
#include <mln/core/image/image2d.hh>
-#include <mln/value/rgb8.hh>
-#include <mln/io/ppm/load.hh>
+
#include <mln/level/compare.hh>
#include <mln/io/magick/load.hh>
+#include <mln/io/ppm/load.hh>
-#include "tests/data.hh"
+#include <mln/value/rgb8.hh>
+#include "tests/data.hh"
int main()
{
using namespace mln;
image2d<value::rgb8> lena_ppm;
- io::ppm::load(lena_ppm, "lena.ppm");
+ io::ppm::load(lena_ppm, MLN_IMG_DIR "/tiny.ppm");
image2d<value::rgb8> lena_png;
- io::magick::load(lena_png, "lena.png");
+ io::magick::load(lena_png, MLN_TESTS_IMG_DIR "/tiny.png");
mln_assertion(lena_png == lena_ppm);
}
diff --git a/milena/tests/io/magick/load.cc b/milena/tests/io/magick/save.cc
similarity index 78%
copy from milena/tests/io/magick/load.cc
copy to milena/tests/io/magick/save.cc
index dcf13ce..5bf5d40 100644
--- a/milena/tests/io/magick/load.cc
+++ b/milena/tests/io/magick/save.cc
@@ -25,30 +25,35 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/io/magick/load.cc
+/// \file tests/io/magick/save.cc
///
-/// Test on mln::io::magick::load.
+/// Test on mln::io::magick::save.
#include <mln/core/image/image2d.hh>
-#include <mln/value/rgb8.hh>
+#include <mln/io/magick/load.hh>
+#include <mln/io/magick/save.hh>
#include <mln/io/ppm/load.hh>
+
#include <mln/level/compare.hh>
#include <mln/io/magick/load.hh>
#include "tests/data.hh"
-
int main()
{
using namespace mln;
- image2d<value::rgb8> lena_ppm;
- io::ppm::load(lena_ppm, "lena.ppm");
+ image2d<value::rgb8> lena_mln;
+ io::ppm::load(lena_mln, MLN_IMG_DIR "/tiny.ppm");
+
+ io::magick::save(lena_mln, "tiny.png");
+
+ image2d<value::rgb8> lena_im;
+ io::magick::load(lena_im, "tiny.png");
- image2d<value::rgb8> lena_png;
- io::magick::load(lena_png, "lena.png");
+ mln_assertion(lena_im.domain() == lena_mln.domain());
+ mln_assertion(lena_im == lena_mln);
- mln_assertion(lena_png == lena_ppm);
}
--
1.5.6.5
Show replies by date