https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix access to images in tests.
* tests/data.hh: New file.
* tests/io_pnm: Include it.
(main): Use rdata to compute the path to loaded images.
* tests/window2d.cc: Likewise.
Add copyright header.
* tests/Makefile.am (AM_CPPFLAGS): Add -I$(srcdir)/check and
-DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\".
(noinst_HEADERS): New.
Add data.hh
* tests/check/Makefile.am (EXTRA_DIST): Add Makefile.flags.
Makefile.am | 7 ++++++-
check/Makefile.am | 8 ++++----
data.hh | 15 +++++++++++++++
io_pnm.cc | 7 +++++--
window2d.cc | 32 +++++++++++++++++++++++++++++++-
5 files changed, 61 insertions(+), 8 deletions(-)
Index: tests/window2d.cc
--- tests/window2d.cc (revision 630)
+++ tests/window2d.cc (working copy)
@@ -1,8 +1,38 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// 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.
+
+/// Test oln::window2d.
+
#include <oln/basics2d.hh>
#include <oln/debug/print.hh>
#include <oln/io/pnm.hh>
#include <oln/morpher/add_neighborhood.hh>
+#include "data.hh"
namespace test
{
@@ -29,7 +59,7 @@
{
using namespace oln;
- image2d<unsigned char> ima = io::load_pgm("../img/lena32.pgm");
+ image2d<unsigned char> ima = io::load_pgm(rdata("lena32.pgm"));
debug::println(ima);
window2d win;
Index: tests/io_pnm.cc
--- tests/io_pnm.cc (revision 630)
+++ tests/io_pnm.cc (working copy)
@@ -28,12 +28,15 @@
/// Test oln::io_pnm.cc.
#include <cassert>
+
#include <oln/basics2d.hh>
#include <oln/io/pnm.hh>
+#include "data.hh"
+
int
main()
{
- oln::image2d<bool> ima = oln::io::load_pbm("../img/chien.pbm");
- oln::image2d<unsigned char> ima2 = oln::io::load_pgm("../img/lena32.pgm");
+ oln::image2d<bool> ima = oln::io::load_pbm(rdata("chien.pbm"));
+ oln::image2d<unsigned char> ima2 = oln::io::load_pgm(rdata("lena32.pgm"));
}
Index: tests/data.hh
--- tests/data.hh (revision 0)
+++ tests/data.hh (revision 0)
@@ -0,0 +1,15 @@
+// FIXME: Should be compiled in libolncheck, as in Olena 0.10.
+// (This is temporary.)
+
+#ifndef OLN_TESTS_DATA_HH
+# define OLN_TESTS_DATA_HH
+
+#include <iostream>
+
+std::string
+rdata(const std::string& file)
+{
+ return OLN_IMG_DIR "/" + file;
+}
+
+#endif // ! OLN_TESTS_DATA_HH
Index: tests/Makefile.am
--- tests/Makefile.am (revision 630)
+++ tests/Makefile.am (working copy)
@@ -2,9 +2,13 @@
SUBDIRS = check sanity
+# FIXME: Revamp (see Olena 0.10's test suite).
+
AM_CPPFLAGS = \
+ -I$(srcdir)/check \
-I$(top_srcdir)/olena -I$(top_srcdir)/extended \
- -I$(top_srcdir)/static -I$(top_srcdir)/metalic
+ -I$(top_srcdir)/static -I$(top_srcdir)/metalic \
+ -DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\"
# FIXME: Add
#
@@ -16,6 +20,7 @@
TESTS_CXXFLAGS = @TESTS_CXXFLAGS@
CXXFLAGS += $(TESTS_CXXFLAGS)
+noinst_HEADERS = data.hh
check_PROGRAMS = \
dpoint2d \
Index: tests/check/Makefile.am
--- tests/check/Makefile.am (revision 630)
+++ tests/check/Makefile.am (working copy)
@@ -1,10 +1,11 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
-# FIXME: To be enabled when the test suite mechanism is available.
+## FIXME: To be (fully) enabled when the test suite mechanism is available.
# include Makefile.flags
-# AM_CPPFLAGS += -DCXX=\""$(CXX)"\" \
+# AM_CPPFLAGS +=
+# -DCXX=\""$(CXX)"\" \
# -DCPPFLAGS=\""$(CPPFLAGS)"\" \
# -DCXXFLAGS=\""$(CXXFLAGS)"\" \
# -DOLN_EXTRA_CPPFLAGS=\""$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)"\" \
@@ -30,5 +31,4 @@
# data.cc \
# $(COMMON_CHECK_SOURCES)
-
-# EXTRA_DIST = Makefile.flags Makefile.check Makefile.runtests
+EXTRA_DIST = Makefile.flags # Makefile.check Makefile.runtests
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix explicit instantiations of oln::bbox_.
* oln/basics1d.hh (bbox_<point1d>): Move explicit
instantiation...
* oln/core/1d/bbox1d.hh: ...here (new file).
* oln/core/1d/image1d.hh: Include it.
* oln/basics2d.hh (bbox_<point2d>): Move explicit
instantiation...
* oln/core/2d/bbox2d.hh: ...here (new file).
* oln/core/2d/image2d.hh: Include it.
* oln/core/3d/bbox3d.hh: New file.
* oln/basics3d.hh, oln/core/3d/image3d.hh: Include it.
* oln/Makefile.am (nobase_oln_HEADERS): Add core/1d/bbox1d.hh,
core/2d/bbox2d.hh and core/3d/bbox3d.hh.
* oln/core/2d/array2d.hh: Aesthetic changes.
Makefile.am | 3 +++
basics1d.hh | 7 +------
basics2d.hh | 7 +------
basics3d.hh | 2 +-
core/1d/bbox1d.hh | 45 +++++++++++++++++++++++++++++++++++++++++++++
core/1d/image1d.hh | 5 +++--
core/2d/bbox2d.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
core/2d/image2d.hh | 5 +++--
core/3d/bbox3d.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
core/3d/image3d.hh | 13 ++++++-------
10 files changed, 155 insertions(+), 24 deletions(-)
Index: oln/basics1d.hh
--- oln/basics1d.hh (revision 625)
+++ oln/basics1d.hh (working copy)
@@ -38,13 +38,8 @@
# include <oln/core/1d/dpoint1d.hh>
# include <oln/core/gen/bbox.hh>
-// FIXME: Inexplicably, this explicit instantiation is required to
-// have topo_lbbox_<point1d> work. See if we can get rid of it.
-namespace oln {
- template class bbox_<point1d>;
-}
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/1d/bbox1d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
# include <oln/core/gen/bkd_piter_bbox.hh>
Index: oln/core/1d/bbox1d.hh
--- oln/core/1d/bbox1d.hh (revision 0)
+++ oln/core/1d/bbox1d.hh (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// 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.
+
+#ifndef OLN_CORE_1D_BBOX1D_HH
+# define OLN_CORE_1D_BBOX1D_HH
+
+# include <oln/core/1d/aliases.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point1d> work. See if we can get rid of it.
+ template class bbox_<point1d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_1D_BBOX1D_HH
Index: oln/core/1d/image1d.hh
--- oln/core/1d/image1d.hh (revision 625)
+++ oln/core/1d/image1d.hh (working copy)
@@ -30,10 +30,11 @@
# define OLN_CORE_1D_IMAGE1D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/1d/array1d.hh>
-# include <oln/core/1d/point1d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/1d/array1d.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/1d/bbox1d.hh>
// For topo1d.
# include <oln/core/1d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 625)
+++ oln/basics2d.hh (working copy)
@@ -38,13 +38,8 @@
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/gen/bbox.hh>
-// FIXME: Inexplicably, this explicit instantiation is required to
-// have topo_lbbox_<point2d> work. See if we can get rid of it.
-namespace oln {
- template class bbox_<point2d>;
-}
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/2d/bbox2d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
# include <oln/core/gen/bkd_piter_bbox.hh>
Index: oln/core/2d/bbox2d.hh
--- oln/core/2d/bbox2d.hh (revision 0)
+++ oln/core/2d/bbox2d.hh (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// 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.
+
+#ifndef OLN_CORE_2D_BBOX2D_HH
+# define OLN_CORE_2D_BBOX2D_HH
+
+# include <oln/core/2d/aliases.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ typedef bbox_<point2d> bbox2d;
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point2d> work. See if we can get rid of it.
+ template class bbox_<point2d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_2D_BBOX2D_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 625)
+++ oln/core/2d/image2d.hh (working copy)
@@ -30,10 +30,11 @@
# define OLN_CORE_2D_IMAGE2D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/2d/array2d.hh>
-# include <oln/core/2d/point2d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/2d/array2d.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/2d/bbox2d.hh>
// For topo2d.
# include <oln/core/2d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
Index: oln/core/3d/bbox3d.hh
--- oln/core/3d/bbox3d.hh (revision 0)
+++ oln/core/3d/bbox3d.hh (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// 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.
+
+#ifndef OLN_CORE_3D_BBOX3D_HH
+# define OLN_CORE_3D_BBOX3D_HH
+
+# include <oln/core/3d/aliases.hh>
+# include <oln/core/3d/point3d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ typedef bbox_<point3d> bbox3d;
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point3d> work. See if we can get rid of it.
+ template class bbox_<point3d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_3D_BBOX3D_HH
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 625)
+++ oln/basics3d.hh (working copy)
@@ -39,8 +39,8 @@
# include <oln/core/3d/dpoint3d.hh>
# include <oln/core/gen/bbox.hh>
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/3d/bbox3d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 625)
+++ oln/core/3d/image3d.hh (working copy)
@@ -30,22 +30,21 @@
# define OLN_CORE_3D_IMAGE3D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/3d/array3d.hh>
-# include <oln/core/3d/point3d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/3d/array3d.hh>
+# include <oln/core/3d/point3d.hh>
+# include <oln/core/3d/bbox3d.hh>
// For topo3d.
# include <oln/core/3d/aliases.hh>
+// For fwd_piter and bkd_piter virtual types.
+// FIXME: Really necessary?
+# include <oln/core/fwd_piter.hh>
namespace oln
{
- // FIXME: Inexplicably, this explicit instantiation is required to
- // have topo_lbbox_<point3d> work. See if we can get rid of it.
- template class bbox_<point3d>;
-
-
// Forward declaration.
template <typename T> class image3d;
Index: oln/Makefile.am
--- oln/Makefile.am (revision 625)
+++ oln/Makefile.am (working copy)
@@ -7,6 +7,7 @@
\
core/1d/aliases.hh \
core/1d/array1d.hh \
+ core/1d/bbox1d.hh \
core/1d/dpoint1d.hh \
core/1d/grid1d.hh \
core/1d/image1d.hh \
@@ -15,6 +16,7 @@
\
core/2d/aliases.hh \
core/2d/array2d.hh \
+ core/2d/bbox2d.hh \
core/2d/dpoint2d.hh \
core/2d/grid2d.hh \
core/2d/image2d.hh \
@@ -23,6 +25,7 @@
\
core/3d/aliases.hh \
core/3d/array3d.hh \
+ core/3d/bbox3d.hh \
core/3d/dpoint3d.hh \
core/3d/grid3d.hh \
core/3d/image3d.hh \
Index: oln/core/2d/array2d.hh