URL:
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
ChangeLog:
2008-09-18 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix some tests.
* milena/tests/convert/to_p_set.cc,
* milena/tests/convert/to_window.cc: Use the proper comparison operator.
* milena/tests/core/alias/point1d.cc: use point1d::ind().
* milena/tests/core/alias/w_window1d_int.cc: use convert::to().
* milena/tests/core/image/value_enc_image.cc:
use the proper p_runs2d type.
---
convert/to_p_set.cc | 7 +++++--
convert/to_window.cc | 6 ++++--
core/alias/point1d.cc | 4 ++--
core/alias/w_window1d_int.cc | 4 ++--
core/image/value_enc_image.cc | 8 ++++----
5 files changed, 17 insertions(+), 12 deletions(-)
Index: branches/cleanup-2008/milena/tests/core/image/value_enc_image.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/image/value_enc_image.cc (revision 2336)
+++ branches/cleanup-2008/milena/tests/core/image/value_enc_image.cc (revision 2337)
@@ -43,6 +43,7 @@
#include <mln/level/paste.hh>
#include <mln/level/compare.hh>
#include <mln/io/pgm/save.hh>
+#include <mln/core/alias/p_runs2d.hh>
#include "tests/data.hh"
@@ -66,11 +67,10 @@
/// Basic test
{
typedef value_enc_image<point2d, int> ima_type;
- typedef p_runs_<point2d> runs;
- p_runs_<point2d> pruns0;
- p_runs_<point2d> pruns1;
- p_runs_<point2d> pruns2;
+ p_runs2d pruns0;
+ p_runs2d pruns1;
+ p_runs2d pruns2;
pruns0.insert(p_run<point2d>(point2d(0, 0), 2));
Index: branches/cleanup-2008/milena/tests/core/alias/w_window1d_int.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/alias/w_window1d_int.cc (revision 2336)
+++ branches/cleanup-2008/milena/tests/core/alias/w_window1d_int.cc (revision 2337)
@@ -43,7 +43,7 @@
return p.ind ();
}
-
+#include <mln/convert/to.hh>
int main()
{
using namespace mln;
@@ -53,7 +53,7 @@
w_window1d_int w_win = make::w_window1d(ws);
image1d<int> ima = convert::to_image(w_win);
- w_window1d_int w_win_2 = convert::to_w_window(ima);
+ w_window1d_int w_win_2 = mln::convert::to<w_window1d_int>(ima);
mln_assertion(w_win_2 == w_win);
}
Index: branches/cleanup-2008/milena/tests/core/alias/point1d.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/alias/point1d.cc (revision 2336)
+++ branches/cleanup-2008/milena/tests/core/alias/point1d.cc (revision 2337)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 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
@@ -50,7 +50,7 @@
mln_assertion(p.ind() == 5 && p[0] == 5);
// construction
- q = 5;
+ q.ind() = 5;
mln_assertion(p == q);
q.set_all(0);
Index: branches/cleanup-2008/milena/tests/convert/to_p_set.cc
===================================================================
--- branches/cleanup-2008/milena/tests/convert/to_p_set.cc (revision 2336)
+++ branches/cleanup-2008/milena/tests/convert/to_p_set.cc (revision 2337)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007. 2008 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
@@ -41,6 +41,7 @@
#include <mln/level/fill.hh>
#include <mln/convert/to_p_set.hh>
+#include <mln/util/ord.hh>
using namespace mln;
@@ -89,11 +90,13 @@
test(ref, test_win);
// std::set :
- std::set<point2d> set;
+ std::set<point2d, util::ord<point2d> > set;
+
set.insert(a);
set.insert(b);
set.insert(c);
set.insert(d);
+
p_set<point2d> test_set = convert::to_p_set(set);
test(ref, test_set);
}
Index: branches/cleanup-2008/milena/tests/convert/to_window.cc
===================================================================
--- branches/cleanup-2008/milena/tests/convert/to_window.cc (revision 2336)
+++ branches/cleanup-2008/milena/tests/convert/to_window.cc (revision 2337)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 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
@@ -43,6 +43,8 @@
#include <mln/convert/to_window.hh>
#include <mln/convert/to_p_set.hh>
+#include <mln/util/ord.hh>
+
using namespace mln;
void test(window2d ref, window2d cmp)
@@ -89,7 +91,7 @@
test(ref, test_setp);
// std::set :
- std::set<dpoint2d> set;
+ std::set<dpoint2d, util::ord<dpoint2d> > set;
set.insert(a);
set.insert(b);
set.insert(c);