* tests/accu/stat/Makefile.am: Add a new target.
* tests/accu/stat/deviation.cc: New.
---
milena/ChangeLog | 8 ++++++
milena/tests/accu/stat/Makefile.am | 5 +++-
.../qt_rgb_to_int_u.cc => accu/stat/deviation.cc} | 25 +++++++++++++------
3 files changed, 29 insertions(+), 9 deletions(-)
copy milena/tests/{fun/v2v/qt_rgb_to_int_u.cc => accu/stat/deviation.cc} (75%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5ecbfb8..af606bd 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add a new test for accu::stat:deviation.
+
+ * tests/accu/stat/Makefile.am: Add a new target.
+
+ * tests/accu/stat/deviation.cc: New.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* mln/accu/stat/deviation.hh: Fix type of constructor argument.
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/milena/tests/accu/stat/Makefile.am b/milena/tests/accu/stat/Makefile.am
index c331db0..47197c0 100644
--- a/milena/tests/accu/stat/Makefile.am
+++ b/milena/tests/accu/stat/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+# (LRDE).
#
# This file is part of Olena.
#
@@ -17,6 +18,7 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
+ deviation \
var \
min \
min_h \
@@ -27,6 +29,7 @@ check_PROGRAMS = \
mean \
rank
+deviation_SOURCES = deviation.cc
var_SOURCES = var.cc
mean_SOURCES = mean.cc
median_h_SOURCES = median_h.cc
diff --git a/milena/tests/fun/v2v/qt_rgb_to_int_u.cc
b/milena/tests/accu/stat/deviation.cc
similarity index 75%
copy from milena/tests/fun/v2v/qt_rgb_to_int_u.cc
copy to milena/tests/accu/stat/deviation.cc
index 5b55d49..e39359e 100644
--- a/milena/tests/fun/v2v/qt_rgb_to_int_u.cc
+++ b/milena/tests/accu/stat/deviation.cc
@@ -23,22 +23,31 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+///
+/// \brief Tests on mln::accu::deviation.
+
#include <mln/core/image/image2d.hh>
+#include <mln/debug/iota.hh>
-#include <mln/fun/v2v/qt_rgb_to_int_u.hh>
-#include <mln/value/qt/rgb32.hh>
-#include <mln/value/int_u8.hh>
+#include <mln/accu/stat/deviation.hh>
+#include <mln/data/compute.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/data/convert.hh>
+#include <mln/value/int_u8.hh>
int main()
{
using namespace mln;
+ image2d<short> ima(3, 3);
+ debug::iota(ima);
- fun::v2v::qt_rgb_to_int_u<8> f;
-
- value::qt::rgb32 vcolor(100, 200, 30);
+ accu::stat::deviation<int> dev(5);
- value::int_u8 vgl = f(vcolor);
+ volatile float
+ ref = 2.5819f,
+ trunc_val = (unsigned(data::compute(dev, ima) * 10000.f) / 10000.f);
- mln_assertion(vgl == 110);
+ mln_assertion(trunc_val == ref);
}
--
1.5.6.5