https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update tests on pw material.
* tests/pw_image.cc: Rename as...
* tests/pw/image.cc: ...this.
* tests/pw_value.cc: Rename as...
* tests/pw/value.cc: ...this.
* tests/pw/Makefile.am (check_PROGRAMS): Update.
(image_SOURCES, value_SOURCES): New.
* tests/Makefile.am (SUBDIRS): Add pw.
(pw_image_SOURCES, pw_value_SOURCES): Remove.
* mln/pw/all.hh: Update.
mln/pw/all.hh | 6 ++++--
tests/Makefile.am | 5 +----
tests/pw/Makefile.am | 9 +++++++++
tests/pw/image.cc | 2 +-
tests/pw/value.cc | 22 ++++++++++++----------
5 files changed, 27 insertions(+), 17 deletions(-)
Index: tests/pw/value.cc
--- tests/pw/value.cc (revision 1608)
+++ tests/pw/value.cc (working copy)
@@ -25,15 +25,14 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pw_value.cc
+/*! \file tests/pw/value.cc
*
* \brief Test on mln::pw::value_.
*/
#include <mln/core/image2d.hh>
-#include <mln/fun/ops.hh>
-#include <mln/pw/value.hh>
-#include <mln/pw/cst.hh>
+#include <mln/level/fill.hh>
+#include <mln/pw/all.hh>
int main()
@@ -41,13 +40,16 @@
using namespace mln;
image2d<int> ima(3, 3);
- point2d p = make::point2d(1, 1);
+ level::fill(ima, 0);
+
+ point2d p(1, 1);
ima(p) = 51;
mln_assertion( (pw::value(ima) = pw::cst(51))(p) = true );
- {
- image2d<float> imaf(3,3);
- imaf(p) = 51;
- mln_assertion(((pw::value(ima) + pw::value(imaf))(p) / 20) - 5.1 < 0.00001);
- }
+// {
+// image2d<float> imaf(3,3);
+// imaf(p) = 51;
+// mln_assertion(((pw::value(ima) + pw::value(imaf))(p) / 20) - 5.1 < 0.00001);
+// }
+
}
Index: tests/pw/image.cc
--- tests/pw/image.cc (revision 1608)
+++ tests/pw/image.cc (working copy)
@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pw_image.cc
+/*! \file tests/pw/image.cc
*
* \brief Tests on mln::pw::image.
*/
Index: tests/pw/Makefile.am
--- tests/pw/Makefile.am (revision 1709)
+++ tests/pw/Makefile.am (working copy)
@@ -1,3 +1,12 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ image \
+ value
+
+image_SOURCES = image.cc
+value_SOURCES = value.cc
+
+TESTS = $(check_PROGRAMS)
Index: tests/Makefile.am
--- tests/Makefile.am (revision 1709)
+++ tests/Makefile.am (working copy)
@@ -20,6 +20,7 @@
morpho \
neighb \
norm \
+ pw \
set \
util \
value \
@@ -92,8 +93,6 @@
point1d \
point2d \
point3d \
- pw_image \
- pw_value \
\
safe_image \
seed2tiling \
@@ -184,8 +183,6 @@
point1d_SOURCES = point1d.cc
point2d_SOURCES = point2d.cc
point3d_SOURCES = point3d.cc
-pw_image_SOURCES = pw_image.cc
-pw_value_SOURCES = pw_value.cc
safe_image_SOURCES = safe_image.cc
seed2tiling_SOURCES = seed2tiling.cc
Index: mln/pw/all.hh
--- mln/pw/all.hh (revision 1709)
+++ mln/pw/all.hh (working copy)
@@ -43,11 +43,13 @@
} // end of namespace mln
-# include <mln/pw/value.hh>
# include <mln/pw/cst.hh>
-# include <mln/pw/var.hh>
# include <mln/pw/image.hh>
+# include <mln/pw/value.hh>
+# include <mln/pw/var.hh>
+
+// Extra include so that we can use operators in point-wise expressions.
# include <mln/fun/ops.hh>