* tests/primitive/extract/Makefile.am: New targets.
* tests/primitive/extract/lines_h_discontinued.cc,
* tests/primitive/extract/lines_v_discontinued.cc: New.
---
scribo/ChangeLog | 9 ++++++
scribo/tests/primitive/extract/Makefile.am | 7 +++-
...nes_discontinued.cc => lines_h_discontinued.cc} | 28 ++-----------------
...nes_discontinued.cc => lines_v_discontinued.cc} | 25 ++---------------
4 files changed, 20 insertions(+), 49 deletions(-)
copy scribo/tests/primitive/extract/{lines_discontinued.cc => lines_h_discontinued.cc}
(69%)
copy scribo/tests/primitive/extract/{lines_discontinued.cc => lines_v_discontinued.cc}
(76%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 60c197c..cddcb15 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add more tests for lines_*_discontinued routines.
+
+ * tests/primitive/extract/Makefile.am: New targets.
+
+ * tests/primitive/extract/lines_h_discontinued.cc,
+ * tests/primitive/extract/lines_v_discontinued.cc: New.
+
2013-03-05 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a new test for lines_discontinued.
diff --git a/scribo/tests/primitive/extract/Makefile.am
b/scribo/tests/primitive/extract/Makefile.am
index 36de362..307dcf5 100644
--- a/scribo/tests/primitive/extract/Makefile.am
+++ b/scribo/tests/primitive/extract/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2011, 2013 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2011, 2013 EPITA Research and Development Laboratory
+# (LRDE).
#
# This file is part of Olena.
#
@@ -23,7 +24,9 @@ EXTRA_DIST = \
alignment_4.ref.pbm \
lines_discontinued.pbm
-check_PROGRAMS = lines_discontinued
+check_PROGRAMS = lines_discontinued \
+ lines_h_discontinued \
+ lines_v_discontinued
if HAVE_MAGICKXX
diff --git a/scribo/tests/primitive/extract/lines_discontinued.cc
b/scribo/tests/primitive/extract/lines_h_discontinued.cc
similarity index 69%
copy from scribo/tests/primitive/extract/lines_discontinued.cc
copy to scribo/tests/primitive/extract/lines_h_discontinued.cc
index c8f4013..73d457d 100644
--- a/scribo/tests/primitive/extract/lines_discontinued.cc
+++ b/scribo/tests/primitive/extract/lines_h_discontinued.cc
@@ -31,7 +31,7 @@
#include <mln/io/pbm/load.hh>
#include <mln/value/label_8.hh>
#include <mln/make/box2d.hh>
-#include <scribo/primitive/extract/lines_discontinued.hh>
+#include <scribo/primitive/extract/lines_h_discontinued.hh>
#include "tests/data.hh"
@@ -49,11 +49,10 @@ int main()
// Horizontal
{
- win::hline2d win(51);
V nlines;
component_set<I>
- comps = primitive::extract::lines_discontinued(input, c4(), nlines,
- win, 3);
+ comps = primitive::extract::lines_h_discontinued(input, c4(), nlines,
+ 51, 3);
mln_assertion(comps.nelements() == 2);
@@ -66,26 +65,5 @@ int main()
mln_assertion(comps(2).card() == 240);
}
- // Vertical
- {
- win::vline2d win(51);
- V nlines;
- component_set<I>
- comps = primitive::extract::lines_discontinued(input, c4(), nlines,
- win, 3);
-
- mln_assertion(comps.nelements() == 3);
- mln_assertion(comps(1).bbox() == make::box2d(8, 23, 186, 26));
- mln_assertion(comps(1).mass_center() == point2d(97, 25));
- mln_assertion(comps(1).card() == 716);
-
- mln_assertion(comps(2).bbox() == make::box2d(42, 98, 162, 100));
- mln_assertion(comps(2).mass_center() == point2d(102, 99));
- mln_assertion(comps(2).card() == 363);
-
- mln_assertion(comps(3).bbox() == make::box2d(57, 137, 173, 144));
- mln_assertion(comps(3).mass_center() == point2d(115, 141));
- mln_assertion(comps(3).card() == 936);
- }
}
diff --git a/scribo/tests/primitive/extract/lines_discontinued.cc
b/scribo/tests/primitive/extract/lines_v_discontinued.cc
similarity index 76%
copy from scribo/tests/primitive/extract/lines_discontinued.cc
copy to scribo/tests/primitive/extract/lines_v_discontinued.cc
index c8f4013..9b1e7b0 100644
--- a/scribo/tests/primitive/extract/lines_discontinued.cc
+++ b/scribo/tests/primitive/extract/lines_v_discontinued.cc
@@ -31,7 +31,7 @@
#include <mln/io/pbm/load.hh>
#include <mln/value/label_8.hh>
#include <mln/make/box2d.hh>
-#include <scribo/primitive/extract/lines_discontinued.hh>
+#include <scribo/primitive/extract/lines_v_discontinued.hh>
#include "tests/data.hh"
@@ -47,32 +47,13 @@ int main()
typedef value::label_8 V;
typedef image2d<V> I;
- // Horizontal
- {
- win::hline2d win(51);
- V nlines;
- component_set<I>
- comps = primitive::extract::lines_discontinued(input, c4(), nlines,
- win, 3);
-
- mln_assertion(comps.nelements() == 2);
-
- mln_assertion(comps(1).bbox() == make::box2d(21, 37, 24, 176));
- mln_assertion(comps(1).mass_center() == point2d(23, 107));
- mln_assertion(comps(1).card() == 560);
-
- mln_assertion(comps(2).bbox() == make::box2d(94, 32, 97, 91));
- mln_assertion(comps(2).mass_center() == point2d(96, 62));
- mln_assertion(comps(2).card() == 240);
- }
-
// Vertical
{
win::vline2d win(51);
V nlines;
component_set<I>
- comps = primitive::extract::lines_discontinued(input, c4(), nlines,
- win, 3);
+ comps = primitive::extract::lines_v_discontinued(input, c4(), nlines,
+ 51, 3);
mln_assertion(comps.nelements() == 3);
--
1.7.2.5