
Since you (= the CSI 2009 working on Olena) are starting to patch Olena, I'll try to comment your changes, so that you can Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr> writes:
Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr>
Add test for neighborhood.
* tests/core/neighb2d.cc: New. * tests/core/Makefile.am: .
You should document all the changes you make in a patch. See how we (= the Olena Team) usually handle this in previous entries of ChangeLogs. Here, you want to say * tests/core/Makefile.am (check_PROGRAMS): Add neighb2d. (neighb2d_SOURCES): New.
* oln/core/automatic/impl.hh: . * oln/core/abstract/internal/image_impl.hh: .
Likewise; here, you probably want to say * oln/core/automatic/impl.hh, * oln/core/abstract/internal/image_impl.hh: Remove inclusions of removed files. or something like that. So, I invite you to fix this entry, *but* remember that ChangeLogs fixes - should be done in standalone patches - shall produce no mention of the fix in the ChangeLog, e.g., you must not create a new entry containing something like this: * ChangeLog: Fix. The simplest way to prevent Vcs from creating this entry is to invoke Subversion directly: \svn commit ChangeLog You're invited to send your changes to the olena-patches list, even in that case. Use `svn diff' to create a hand-made diff file: svn up svn diff -rPREV:HEAD >diffs.patch See the LRDE Guidelines for more information.
Index: tests/core/neighb2d.cc --- tests/core/neighb2d.cc (revision 0) +++ tests/core/neighb2d.cc (revision 0) @@ -0,0 +1,65 @@ +// Copyright (C) 2007 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::neighb2d. + +#include <oln/core/2d/image2d.hh> +#include <oln/core/2d/neighb2d.hh> + + +namespace test +{ + + template <typename I> + unsigned run(const oln::Image_with_Nbh<I>& input) + { + oln_piter(I) p(input.points()); + oln_niter(I) n(p, input.nbhood()); + unsigned count = 0; + + for_all(p) + { + for_all(n) + if (input.owns_(n)) + ++count; + } + return count; + } +} + + +int main() +{ + using namespace oln; + + image2d<bool> ima(3, 3); + // 2 + 3 + 2 + + // 3 + 4 + 3 + + // 2 + 3 + 2 = 24 + std::cout << test::run(ima + c4) << std::endl; + assert(test::run(ima + c4) == 24); +}
Good!
Index: tests/core/Makefile.am --- tests/core/Makefile.am (revision 860) +++ tests/core/Makefile.am (working copy) @@ -24,6 +24,7 @@ grid \ image2d \ npoints \ + neighb2d \ window2d \ at
@@ -34,6 +35,7 @@ image2d_SOURCES = image2d.cc npoints_SOURCES = npoints.cc window2d_SOURCES = window2d.cc +neighb2d_SOURCES = neighb2d.cc
# Methods. at_SOURCES = at.cc Index: oln/core/automatic/impl.hh
Ok.
--- oln/core/automatic/impl.hh (revision 860) +++ oln/core/automatic/impl.hh (working copy) @@ -28,7 +28,7 @@ #ifndef OLN_CORE_AUTOMATIC_IMPL_HH # define OLN_CORE_AUTOMATIC_IMPL_HH
-# include <oln/core/typedefs.hh> +// # include <oln/core/typedefs.hh>
namespace oln Index: oln/core/abstract/internal/image_impl.hh --- oln/core/abstract/internal/image_impl.hh (revision 860) +++ oln/core/abstract/internal/image_impl.hh (working copy) @@ -29,7 +29,7 @@ # define OLN_CORE_ABSTRACT_INTERNAL_IMAGE_IMPL_HH
# include <mlc/flags.hh> -# include <oln/core/typedefs.hh> +// # include <oln/core/typedefs.hh> # include <oln/core/abstract/any.hh> # include <oln/core/macros.hh>
I invite you to remove these obsolete #include statements, rather than commenting them, since oln/core/typedefs.hh no longer exists. Keep in mind that the Subversion repository can help you to go back in time if needed (e.g., if you want to revert a code deletion). Thanks for your patch!