https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add simple tests for point2d and dpoint2d.
* tests/dpoint2d.cc, tests/point2d.cc: New tests.
* tests/image_entry.cc: Fix comments.
* tests/Makefile.am (check_PROGRAMS): Add dpoint2d and point2d.
(dpoint2d_SOURCES, point2d_SOURCES): New.
Makefile.am | 4 ++++
dpoint2d.cc | 47 +++++++++++++++++++++++++++++++++++++++++++++++
image_entry.cc | 6 ++----
point2d.cc | 43 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 96 insertions(+), 4 deletions(-)
Index: tests/point2d.cc
--- tests/point2d.cc (revision 0)
+++ tests/point2d.cc (revision 0)
@@ -0,0 +1,43 @@
+// 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.
+
+#include <mlc/assert.hh>
+#include <mlc/cmp.hh>
+// FIXME: Don't include oln/basics2d.hh, which is too big.
+// (Fix.)
+#include <oln/basics2d.hh>
+
+
+int
+main()
+{
+ typedef oln::point2d_<int> point2d;
+ typedef oln:: stc_get_supers(point2d) point2d_super_type;
+ mlc::assert_<
+ mlc_eq( point2d_super_type, oln::internal::point_nd< point2d > )
+ >::check();
+}
Index: tests/image_entry.cc
--- tests/image_entry.cc (revision 600)
+++ tests/image_entry.cc (working copy)
@@ -25,15 +25,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// Test oln::abstract::image_entry.
+/// Test oln::image_entry.
-// FIXME: Check also with a (possibly fake) ntg::int_u<1, B> type, to
-// stress image_typeness.hh. This might be done in another test, of
-// course.
#include <oln/basics2d.hh>
#include <oln/core/image_entry.hh>
+
namespace my
{
// Forward declaration.
Index: tests/dpoint2d.cc
--- tests/dpoint2d.cc (revision 0)
+++ tests/dpoint2d.cc (revision 0)
@@ -0,0 +1,47 @@
+// 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::image_entry.
+
+#include <mlc/assert.hh>
+#include <mlc/cmp.hh>
+// // FIXME: Fix oln/basics2d.hh!
+// #include <oln/core/2d/point2d.hh>
+// namespace oln { template class point2d_<int>; }
+// #include <oln/core/2d/dpoint2d.hh>
+#include <oln/basics2d.hh>
+
+
+int
+main()
+{
+ typedef oln::dpoint2d_<int> dpoint2d;
+ typedef oln:: stc_get_supers(dpoint2d) dpoint2d_super_type;
+ mlc::assert_<
+ mlc_eq( dpoint2d_super_type, oln::internal::dpoint_nd< dpoint2d > )
+ >::check();
+}
Index: tests/Makefile.am
--- tests/Makefile.am (revision 600)
+++ tests/Makefile.am (working copy)
@@ -16,6 +16,8 @@
check_PROGRAMS = \
+ dpoint2d \
+ point2d \
grid \
image_entry \
image2d \
@@ -28,6 +30,8 @@
fill
# Images and auxiliary structures.
+dpoint2d_SOURCES = dpoint2d.cc
+point2d_SOURCES = point2d.cc
grid_SOURCES = grid.cc
image_entry_SOURCES = image_entry.cc
image2d_SOURCES = image2d.cc