https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix many warnings and errors in test files.
* mln/core/image/imorph/labeled_image.hh: Fix doc.
* mln/accu/all.hh
(count_adjacent_vertices): Use de-activation notation.
(tuple): De-activate.
* mln/value/ops.hh
(operator==): New overloads for a couple of scalars, resp.
int and unsigned; fix warnings.
(operator): Fix missing declarations.
* mln/value/scalar.hh: Upgrade doc style.
* mln/value/int_s.hh: Fix warnings.
* mln/value/internal/gray_.hh: Fix warning.
* mln/value/internal/gray_f.hh: Fix warnings.
Fix ending guard.
* mln/set/compute_with_weights.hh: Fix warnings.
* mln/util/adjacency_matrix.hh: Fix warnings.
* tests/arith/times_full.cc: Fix missing includes; layout.
* tests/arith/plus_full.cc: Fix missing includes; layout.
* tests/arith/revert_full.cc: Fix missing include.
* tests/data/paste.cc (include): Fix typo.
* tests/accu/all_accus.cc: Upgrade doc style.
* tests/accu/count.cc: Fix warnings.
* tests/value/rgb_full.cc: Upgrade doc style.
* tests/value/int_u8.cc: Fix warnings.
* tests/value/float01.cc: Remove useless dependencies.
Revamp.
Fix warnings.
* tests/value/graylevel_f.cc,
* tests/value/graylevel_full.cc,
* tests/value/graylevel_f_full.cc: Fix ambiguities with g++-4.2.
Upgrade doc style.
* tests/value/graylevel.cc: Upgrade doc style.
* tests/convert/to_hsl.cc: De-activate code since it relies
on de-activated code.
* tests/morpho/artificial_line_graph_image_wst.cc: Fix typo.
* tests/morpho/lena_line_graph_image_wst1.cc: Fix warning.
mln/accu/all.hh | 4 -
mln/core/image/imorph/labeled_image.hh | 13 +---
mln/set/compute_with_weights.hh | 6 +-
mln/util/adjacency_matrix.hh | 18 +++---
mln/value/int_s.hh | 8 +-
mln/value/internal/gray_.hh | 4 -
mln/value/internal/gray_f.hh | 10 +--
mln/value/ops.hh | 50 ++++++++++++++++++
mln/value/scalar.hh | 10 +--
tests/accu/all_accus.cc | 6 +-
tests/accu/count.cc | 7 +-
tests/arith/plus_full.cc | 13 ----
tests/arith/revert_full.cc | 1
tests/arith/times_full.cc | 11 ----
tests/convert/to_hsl.cc | 12 ++--
tests/morpho/artificial_line_graph_image_wst.cc | 2
tests/morpho/lena_line_graph_image_wst1.cc | 2
tests/value/float01.cc | 66 +++++-------------------
tests/value/graylevel.cc | 13 ++--
tests/value/graylevel_f.cc | 11 +---
tests/value/graylevel_f_full.cc | 22 ++++----
tests/value/graylevel_full.cc | 15 ++---
tests/value/int_u8.cc | 20 +++----
tests/value/rgb_full.cc | 10 +--
24 files changed, 165 insertions(+), 169 deletions(-)
Index: mln/core/image/imorph/labeled_image.hh
--- mln/core/image/imorph/labeled_image.hh (revision 3919)
+++ mln/core/image/imorph/labeled_image.hh (working copy)
@@ -112,17 +112,12 @@
/// Morpher providing an improved interface for labeled image.
///
/// \tparam I The label image type.
- /// \tparam A An accumulator type.
///
- /// This image type allows to pre-compute components attributes. These
- /// attributes can be set through the template parameter \p A. This
- /// accumulator type can be a simple accumulator, a pair of accumulators or
- /// a tuple.
- ///
- /// This image type guaranties that the labeling is always contiguous.
- ///
- /// \sa accu::pair, accu::tuple, mln::accu
+ /// This image type allows to access every site set at a given
+ /// label.
///
+ /// This image type guaranties that labels are contiguous (from 1 to
+ /// n).
///
/// \ingroup modimageidmorpher
//
Index: mln/accu/all.hh
--- mln/accu/all.hh (revision 3919)
+++ mln/accu/all.hh (working copy)
@@ -60,7 +60,7 @@
# include <mln/accu/count.hh>
# include <mln/accu/count_labels.hh>
# include <mln/accu/center.hh>
-//# include <mln/accu/count_adjacent_vertices.hh>
+// << # include <mln/accu/count_adjacent_vertices.hh> >>
# include <mln/accu/height.hh>
# include <mln/accu/histo.hh>
# include <mln/accu/label_used.hh>
@@ -81,7 +81,7 @@
# include <mln/accu/rank.hh>
# include <mln/accu/rms.hh>
# include <mln/accu/sum.hh>
-# include <mln/accu/tuple.hh>
+// << # include <mln/accu/tuple.hh> >>
# include <mln/accu/volume.hh>
// Routines.
Index: mln/value/ops.hh
--- mln/value/ops.hh (revision 3919)
+++ mln/value/ops.hh (working copy)
@@ -210,6 +210,42 @@
operator % (const value::scalar_<Sl>& lhs, const
value::scalar_<Sr>& rhs);
+ // Operator ==.
+
+ template <typename Sl, typename Sr>
+ mln_trait_op_eq(Sl, Sr)
+ operator == (const value::scalar_<Sl>& lhs, const
value::scalar_<Sr>& rhs);
+
+ bool
+ operator == (const value::scalar_<int>& lhs, const
value::scalar_<unsigned>& rhs);
+
+ bool
+ operator == (const value::scalar_<unsigned>& lhs, const
value::scalar_<int>& rhs);
+
+ template <typename O, typename L>
+ mln_trait_op_eq(O, O)
+ operator==(const value::scalar_<O>& lhs, const Literal<L>& rhs);
+
+ template <typename L, typename O>
+ mln_trait_op_eq(O, O)
+ operator==(const Literal<L>& lhs, const value::scalar_<O>& rhs);
+
+
+ // Operator <.
+
+ template <typename Sl, typename Sr>
+ mln_trait_op_less(Sl, Sr)
+ operator < (const value::scalar_<Sl>& lhs, const
value::scalar_<Sr>& rhs);
+
+ template <typename O, typename L>
+ mln_trait_op_less(O, O)
+ operator < (const value::scalar_<O>& lhs, const Literal<L>&
rhs);
+
+ template <typename L, typename O>
+ mln_trait_op_less(O, O)
+ operator < (const Literal<L>& lhs, const value::scalar_<O>&
rhs);
+
+
# ifndef MLN_INCLUDE_ONLY
@@ -338,6 +374,20 @@
return value::equiv(lhs) == value::equiv(rhs);
}
+ inline
+ bool
+ operator == (const value::scalar_<int>& lhs, const
value::scalar_<unsigned>& rhs)
+ {
+ return lhs.to_equiv() == int(rhs.to_equiv());
+ }
+
+ inline
+ bool
+ operator == (const value::scalar_<unsigned>& lhs, const
value::scalar_<int>& rhs)
+ {
+ return int(lhs.to_equiv()) == rhs.to_equiv();
+ }
+
template <typename O, typename L>
inline
mln_trait_op_eq(O, O)
Index: mln/value/scalar.hh
--- mln/value/scalar.hh (revision 3919)
+++ mln/value/scalar.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2007, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_VALUE_SCALAR_HH
# define MLN_VALUE_SCALAR_HH
-/*! \file mln/value/scalar.hh
- *
- * \brief Definition of the basic mln::value::scalar_ class.
- */
+/// \file mln/value/scalar.hh
+///
+/// \brief Definition of the basic mln::value::scalar_ class.
# include <mln/value/concept/scalar.hh>
# include <mln/metal/is_a.hh>
Index: mln/value/int_s.hh
--- mln/value/int_s.hh (revision 3919)
+++ mln/value/int_s.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -193,7 +193,7 @@
inline
int_s<n>::int_s(int i)
{
- static const int max = metal::math::pow_int<2, n-1>::value - 1;
+ static const int max = int(metal::math::pow_int<2, n-1>::value) - 1;
static const int min = - max;
mln_precondition(i >= min);
mln_precondition(i <= max);
@@ -205,7 +205,7 @@
int_s<n>&
int_s<n>::operator=(int i)
{
- static const int max = metal::math::pow_int<2, n-1>::value - 1;
+ static const int max = int(metal::math::pow_int<2, n-1>::value) - 1;
static const int min = - max;
mln_precondition(i >= min);
mln_precondition(i <= max);
Index: mln/value/internal/gray_.hh
--- mln/value/internal/gray_.hh (revision 3919)
+++ mln/value/internal/gray_.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006, 2007, 2008 EPITA Research and Development
+// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -682,7 +682,7 @@
mln_trait_op_div(graylevel<n>, scalar_<S>)
operator/(const graylevel<n>& lhs, const scalar_<S>& rhs)
{
- mln_precondition(rhs.to_equiv() != 0);
+ mln_precondition(rhs.to_equiv() != S(0));
typedef mln_trait_op_div(graylevel<n>, scalar_<S>) ret;
return internal::helper_gray__op_<ret>::div(lhs, rhs);
}
Index: mln/value/internal/gray_f.hh
--- mln/value/internal/gray_f.hh (revision 3919)
+++ mln/value/internal/gray_f.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006, 2007, 2008 EPITA Research and Development
+// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -474,7 +474,7 @@
mln_trait_op_times(graylevel_f, S)
operator*(const graylevel_f& lhs, const scalar_<S>& rhs)
{
- return lhs.value() * rhs;
+ return lhs.value() * rhs.to_equiv();
}
// Op / scalar
@@ -483,12 +483,12 @@
mln_trait_op_div(graylevel_f, S)
operator/(const graylevel_f& lhs, const scalar_<S>& rhs)
{
- mln_precondition(rhs.to_equiv() != 0);
- return lhs.value() / rhs;
+ mln_precondition(rhs.to_equiv() != S(0));
+ return lhs.value() / rhs.to_equiv();
}
} // end of namespace mln::value
} // end of namespace mln
-#endif // ! MLN_VALUE_GRAY_F_HH
+#endif // ! MLN_VALUE_INTERNAL_GRAY_F_HH
Index: mln/set/compute_with_weights.hh
--- mln/set/compute_with_weights.hh (revision 3919)
+++ mln/set/compute_with_weights.hh (working copy)
@@ -102,9 +102,9 @@
mln_precondition(label.is_valid());
mln_precondition(w.domain() <= label.domain());
- (void) a_;
- (void) w_;
- (void) label_;
+ (void) a;
+ (void) w;
+ (void) label;
}
} // end of namespace mln::internal
Index: mln/util/adjacency_matrix.hh
--- mln/util/adjacency_matrix.hh (revision 3919)
+++ mln/util/adjacency_matrix.hh (working copy)
@@ -30,11 +30,13 @@
/// \file mln/util/adjacency_matrix.hh
///
-/// A class of adjacency matrix.
+/// \brief A class of adjacency matrix.
///
-/// FIXME: the underlying data structure is chosen according
+/// \todo the underlying data structure is chosen according
/// to the value type quantification however we may like to make it
/// depend on the number of elements.
+///
+/// \todo Have theo re-read this file.
# include <mln/core/image/image2d.hh>
# include <mln/util/set.hh>
@@ -260,8 +262,8 @@
adjacency_matrix_impl_selector<V, metal::bool_<false> >
::add(const V& e1, const V& e2)
{
- mln_precondition(e1 < nelements_);
- mln_precondition(e2 < nelements_);
+ mln_precondition(e1 < int(nelements_));
+ mln_precondition(e2 < int(nelements_));
adj_.insert(make::ord_pair(e1, e2));
}
@@ -270,8 +272,8 @@
adjacency_matrix_impl_selector<V, metal::bool_<false> >
::remove(const V& e1, const V& e2)
{
- mln_precondition(e1 < nelements_);
- mln_precondition(e2 < nelements_);
+ mln_precondition(e1 < int(nelements_));
+ mln_precondition(e2 < int(nelements_));
mln_precondition(adj_.has(make::ord_pair(e1, e2)));
adj_.remove(make::ord_pair(e1, e2));
}
@@ -288,8 +290,8 @@
adjacency_matrix_impl_selector<V, metal::bool_<false> >
::are_adjacent(const V& e1, const V& e2) const
{
- mln_precondition(e1 < nelements_);
- mln_precondition(e2 < nelements_);
+ mln_precondition(e1 < int(nelements_));
+ mln_precondition(e2 < int(nelements_));
return adj_.has(make::ord_pair(e1, e2));
}
Index: tests/arith/times_full.cc
--- tests/arith/times_full.cc (revision 3919)
+++ tests/arith/times_full.cc (working copy)
@@ -30,9 +30,6 @@
///
/// Tests on mln::arith::times.
-
-
-
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
#include <mln/core/image/image3d.hh>
@@ -45,18 +42,14 @@
#include <mln/value/int_s8.hh>
#include <mln/value/int_s16.hh>
-
-
+#include <mln/value/int_u8.hh>
+#include <mln/value/int_u16.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/times.hh>
-
-
-
-
struct f_box1d_t : mln::Function_p2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
Index: tests/arith/plus_full.cc
--- tests/arith/plus_full.cc (revision 3919)
+++ tests/arith/plus_full.cc (working copy)
@@ -26,14 +26,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-
/// \file tests/arith/plus_full.cc
///
/// Tests on mln::arith::plus.
-
-
-
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
#include <mln/core/image/image3d.hh>
@@ -41,23 +37,18 @@
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/fun/p2b/chess.hh>
-
#include <mln/literal/origin.hh>
+#include <mln/value/int_u8.hh>
#include <mln/value/int_s8.hh>
+#include <mln/value/int_u16.hh>
#include <mln/value/int_s16.hh>
-
-
#include <mln/debug/iota.hh>
#include <mln/arith/plus.hh>
-
-
-
-
struct f_box1d_t : mln::Function_p2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
Index: tests/arith/revert_full.cc
--- tests/arith/revert_full.cc (revision 3919)
+++ tests/arith/revert_full.cc (working copy)
@@ -40,6 +40,7 @@
#include <mln/fun/p2b/chess.hh>
#include <mln/literal/origin.hh>
+#include <mln/value/int_u8.hh>
#include <mln/value/int_s8.hh>
#include <mln/value/int_s16.hh>
Index: tests/accu/all_accus.cc
--- tests/accu/all_accus.cc (revision 3919)
+++ tests/accu/all_accus.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 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
@@ -26,7 +27,8 @@
// Public License.
/// \file tests/accu/all_accus.cc
-/// \brief Tests on all_accus files in mln/accu.
+///
+/// \brief Tests on all_accus files in mln/accu/.
#include <mln/accu/all.hh>
#include <mln/core/alias/point2d.hh>
Index: tests/accu/count.cc
--- tests/accu/count.cc (revision 3919)
+++ tests/accu/count.cc (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -57,11 +58,11 @@
{
accu::count<int> a, a_;
a.take_as_init(1);
- mln_assertion(a == 1);
+ mln_assertion(a == 1u);
a.take(2);
- mln_assertion(a == 2);
+ mln_assertion(a == 2u);
a_.take_as_init(a);
- mln_assertion(a_ == 2);
+ mln_assertion(a_ == 2u);
}
}
Index: tests/value/rgb_full.cc
--- tests/value/rgb_full.cc (revision 3919)
+++ tests/value/rgb_full.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/rgb_full.cc
- *
- * \brief Tests on mln::value::rgb.
- */
+/// \file tests/value/rgb_full.cc
+///
+/// \brief Tests on mln::value::rgb.
#include <mln/value/rgb.hh>
#include <mln/value/rgb8.hh>
Index: tests/value/graylevel_f.cc
--- tests/value/graylevel_f.cc (revision 3919)
+++ tests/value/graylevel_f.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 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
@@ -25,10 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/graylevel_f.cc
- *
- * \brief Tests on mln::value::graylevel_f.
- */
+/// \file tests/value/graylevel_f.cc
+///
+/// \brief Tests on mln::value::graylevel_f.
#include <mln/value/graylevel.hh>
#include <mln/value/glf.hh>
@@ -55,7 +54,7 @@
mln_assertion(b == a);
a *= 2;
- mln_assertion(a == white);
+ mln_assertion(a == glf(white));
mln_assertion(a.to_enc() == 1.f);
}
}
Index: tests/value/float01.cc
--- tests/value/float01.cc (revision 3919)
+++ tests/value/float01.cc (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -32,26 +32,16 @@
#include <iostream>
-#include <mln/core/image/image2d.hh>
-#include <mln/debug/iota.hh>
-#include <mln/debug/println.hh>
-
+#include <mln/core/concept/function.hh>
#include <mln/value/float01_8.hh>
#include <mln/value/float01_16.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/transform.hh>
-#include <mln/io/pgm/load.hh>
-#include <mln/io/pgm/save.hh>
-#include <mln/win/rectangle2d.hh>
-#include <mln/level/median.hh>
-#include <mln/level/compare.hh>
+namespace mln
+{
-
-using namespace mln;
-using namespace mln::value;
-using mln::value::int_u8;
+ using namespace value;
float fi(int) { return 0.5f; }
int ii(int) { return 1; }
@@ -60,7 +50,7 @@
int id(double) { return 1; }
-struct tofloat01 : mln::Function_v2v<tofloat01>
+ struct tofloat01 : Function_v2v<tofloat01>
{
typedef float01_<12> result;
@@ -72,7 +62,7 @@
}
};
-struct to8bits : mln::Function_v2v<to8bits>
+ struct to8bits : Function_v2v<to8bits>
{
typedef int_u8 result;
@@ -85,15 +75,17 @@
}
};
+} // mln
+
+
int main()
{
- win::rectangle2d rect(51, 51);
- border::thickness = 52;
+ using namespace mln;
- float01_8 a(0.5);
- float01_16 b(0.5);
+ value::float01_8 a(0.5);
+ value::float01_16 b(0.5);
- assert(approx_equal(b,a));
+ mln_assertion(approx_equal(b,a));
std::cout << b << std::endl;
b = b + 0.2f;
@@ -123,32 +115,4 @@
std::cout << b << std::endl;
b = 1;
std::cout << b << std::endl;
-
- {
- typedef value::float01_<12> float01_12;
-
- std::cout << "convert" << std::endl;
- image2d<int_u8>
- lena = io::pgm::load<int_u8>("../img/lena.pgm"),
- ref(lena.domain());
-
- image2d<float01_12> out(lena.domain());
- image2d<float01_12> tmp(lena.domain());
-
- tmp = level::transform(lena, tofloat01());
-
- level::median(tmp, rect, out);
- level::median(lena, rect, ref);
-
-
- lena = level::transform(out, to8bits());
-
- io::pgm::save(lena, "out.pgm");
- io::pgm::save(ref, "ref.pgm");
- mln_assertion(lena == ref);
- // FIXME: Dead code.
- //debug::println(out);
- }
-
-
}
Index: tests/value/int_u8.cc
--- tests/value/int_u8.cc (revision 3919)
+++ tests/value/int_u8.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/int_u8.cc
- *
- * \brief Tests on mln::value::int_u8.
- */
+/// \file tests/value/int_u8.cc
+///
+/// \brief Tests on mln::value::int_u8.
#include <mln/value/int_u8.hh>
#include <tests/value/macros.hh>
@@ -49,18 +49,18 @@
// Assignment.
{
i = 51;
- // FIXME: Triggers a warning about signed vs unsigned comparison.
- sym_compare_assert(i, ==, 51);
+ mln_assertion(i == 51u);
+ mln_assertion(-i == -51);
i = 51u;
- sym_compare_assert(i, ==, 51);
+ mln_assertion(i == 51u);
signed char c = 51;
i = c;
- sym_compare_assert(i, ==, 51);
+ mln_assertion(i == 51u);
j = i;
- sym_compare_assert(j, ==, 51);
+ mln_assertion(j == 51u);
i = 3;
sym_compare_assert(3.0f, ==, i);
Index: tests/value/graylevel_full.cc
--- tests/value/graylevel_full.cc (revision 3919)
+++ tests/value/graylevel_full.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,12 +26,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/graylevel_full.cc
- *
- * \brief Tests on mln::value::graylevel. Tests operations between
- * graylevel of different encodings.
- *
- */
+/// \file tests/value/graylevel_full.cc
+///
+/// \brief Tests on mln::value::graylevel. Tests operations between
+/// graylevel of different encodings.
#include <mln/value/gl8.hh>
#include <mln/value/gl16.hh>
@@ -71,7 +70,7 @@
gl8 e = white;
- mln_assertion(e == white);
+ mln_assertion(e == gl8(white));
gl8 f = 12;
gl8 g = f;
Index: tests/value/graylevel_f_full.cc
--- tests/value/graylevel_f_full.cc (revision 3919)
+++ tests/value/graylevel_f_full.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2007, 2009 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
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/graylevel_f_full.cc
- *
- * \brief Full tests on mln::value::graylevel_f.
- */
+/// \file tests/value/graylevel_f_full.cc
+///
+/// \brief Full tests on mln::value::graylevel_f.
#include <mln/value/graylevel.hh>
#include <mln/value/glf.hh>
@@ -77,24 +77,24 @@
// Literals
{
glf a(white);
- mln_assertion(a == white);
+ mln_assertion(a == glf(white));
mln_assertion(a.value() == 1.f);
glf d = white;
- mln_assertion(d == white);
+ mln_assertion(d == glf(white));
mln_assertion(d.value() == 1.f);
glf b(black);
- mln_assertion(b == black);
+ mln_assertion(b == glf(black));
mln_assertion(b.value() == 0.f);
glf e = black;
- mln_assertion(e == black);
+ mln_assertion(e == glf(black));
mln_assertion(e.value() == 0.f);
glf c(medium_gray);
- mln_assertion(c == medium_gray);
+ mln_assertion(c == glf(medium_gray));
mln_assertion(c.value() == 0.5f);
glf f = medium_gray;
- mln_assertion(f == medium_gray);
+ mln_assertion(f == glf(medium_gray));
mln_assertion(f.value() == 0.5f);
}
Index: tests/value/graylevel.cc
--- tests/value/graylevel.cc (revision 3919)
+++ tests/value/graylevel.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,12 +26,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/graylevel.cc
- *
- * \brief Tests on mln::value::graylevel. Tests operations between
- * graylevel of different encodings.
- *
- */
+/// \file tests/value/graylevel.cc
+///
+/// \brief Tests on mln::value::graylevel. Tests operations between
+/// graylevel of different encodings.
#include <mln/value/gl8.hh>
#include <mln/value/gl16.hh>
Index: tests/convert/to_hsl.cc
--- tests/convert/to_hsl.cc (revision 3919)
+++ tests/convert/to_hsl.cc (working copy)
@@ -40,12 +40,12 @@
{
using namespace mln;
- value::rgb8 c1(3,3,3);
- value::hsl_f c2 = convert::to<value::hsl_f>(c1);
-// mln_assertion(c2 == hsl_f(0,0,3)); //FIXME: wrong result.
+// value::rgb8 c1(3,3,3);
+// value::hsl_f c2 = convert::to<value::hsl_f>(c1);
+// // mln_assertion(c2 == hsl_f(0,0,3)); //FIXME: wrong result.
- value::hsl_f c3(3,3,3);
- c1 = convert::to<value::rgb8>(c3);
-// mln_assertion(c1 == rgb8(2,4,0)); //FIXME: wrong result.
+// value::hsl_f c3(3,3,3);
+// c1 = convert::to<value::rgb8>(c3);
+// // mln_assertion(c1 == rgb8(2,4,0)); //FIXME: wrong result.
}
Index: tests/morpho/artificial_line_graph_image_wst.cc
--- tests/morpho/artificial_line_graph_image_wst.cc (revision 3919)
+++ tests/morpho/artificial_line_graph_image_wst.cc (working copy)
@@ -108,7 +108,7 @@
? mln_min(input_val_t)
: mln_max(input_val_t);
mln_assertion((nrows * ncols) == 10000);
- mln_assertion((2 * nrows * ncols - (rows + ncols)) == 19800);
+ mln_assertion((2 * nrows * ncols - (nrows + ncols)) == 19800);
/*----------------.
| Line gradient. |
Index: tests/morpho/lena_line_graph_image_wst1.cc
--- tests/morpho/lena_line_graph_image_wst1.cc (revision 3919)
+++ tests/morpho/lena_line_graph_image_wst1.cc (working copy)
@@ -158,7 +158,7 @@
int_u8 nbasins;
typedef edge_image<util::site_pair<point2d>,int_u8,util::graph> wshed_t;
wshed_t wshed = morpho::meyer_wst(lg_ima, nbh, nbasins);
- mln_assertion(nbasins == 5);
+ mln_assertion(nbasins == 5u);
/*---------.
| Output. |