* tests/value/interop.cc: Here.
Remove dead code.
---
milena/ChangeLog | 7 +++
milena/tests/value/interop.cc | 100 ++++++++++++++++++++++-------------------
2 files changed, 60 insertions(+), 47 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index aa0c433..22fd714 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-23 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Partly re-enable Milena's test value/interop.
+
+ * tests/value/interop.cc: Here.
+ Remove dead code.
+
2014-06-20 Roland Levillain <roland(a)lrde.epita.fr>
Remove mentions to trash/ directories in Milena.
diff --git a/milena/tests/value/interop.cc b/milena/tests/value/interop.cc
index 672b231..5334bcb 100644
--- a/milena/tests/value/interop.cc
+++ b/milena/tests/value/interop.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2014 EPITA Research and Development
+// Laboratory (LRDE).
//
// This file is part of Olena.
//
@@ -28,6 +29,8 @@
#include <mln/value/int_u16.hh>
#include <mln/value/float01_8.hh>
+// FIXME: Overhaul this test.
+
int main()
{
using namespace mln;
@@ -45,63 +48,66 @@ int main()
using value::int_s8;
- // FIXME: Dead code?
-// {
-// // Operations on int_u<n>
-// int_u8 i = 128;
-// int_u16 j = 42;
-// int_s8 k = 42;
-// float01_8 x;
-
-// (j = j + i) = i + j;
-// mln_assertion(j == (128 + 42));
-
-// (k = j - i) = i - j;
-// mln_assertion(k == (-42));
+ {
+ // Operations on int_u<n>
+ int_u8 i = 128;
+ int_u16 j = 42;
+ int_s8 k = 42;
+ float01_8 x;
-// j = 2;
-// (j = j * i) = i * j;
-// mln_assertion(j == (2 * 128));
+ (j = j + i) = i + j;
+ mln_assertion(j == (128 + 42));
-// (x = (j / i) / ((j / i) + 0.1))
-// = (i / j) / ((i / j) + 0.1);
+ (k = j - i) = i - j;
+ mln_assertion(k == (-42));
-// // std::cout << i + i << std::endl;
-// // float01_8 f = i / 200.5;
-// // std::cout << x << std::endl;
-// }
+ j = 2;
+ (j = j * i) = i * j;
+ mln_assertion(j == (2 * 128));
-// {
-// // Operations on int_u<n> and int / float
-// int_u16 j = 42;
-// int_s8 k = 42;
-// float x;
+ (x = (j / i) / ((j / i) + 0.1))
+ = (i / j) / ((i / j) + 0.1);
-// // int
-// (k = j - 123) = 123 - j;
-// (j = j + 123) = 123 + j;
-// (j = j * 4) = 4 * j;
+ }
-// (j = j / 4) = 4 / j;
+ {
+ // Operations on int_u<n> and int / float
+ int_u16 j = 42;
+ int_s8 k = 42;
+ float x;
-// // float
-// x = (j / 4.5 * 3.4 + 3.5 - 5.6) / 0.0234;
-// }
+ // int
+ (k = j - 123) = 123 - j;
+ (j = j + 123) = 123 + j;
+ (j = j * 4) = 4 * j;
+ (j = j / 4) = 4 / j;
-// {
-// // Operations on int_u<n> and float01_8
-// int_u16 j = 42;
-// float01_8 x = 0.456;
+ // float
+ x = (j / 4.5 * 3.4 + 3.5 - 5.6) / 0.0234;
-// x = x / j;
-// mln_assertion(x < 0 && x < 1);
+ // Prevent ``unused variable'' warnings from the compiler.
+ (void) x;
+ }
-// x = x * j;
-// mln_assertion(x < 0 && x < 1);
-// x = x * j;
-// mln_assertion(x < 0 && x < 1);
-// }
+ {
+#if 0
+ // Operations on int_u<n> and float01_8
+ int_u16 j = 42;
+ float01_8 x = 0.456;
+
+ /* FIXME: Does not work: the results of these operation are
+ outsided the range [0, 1]. */
+ x = x / j;
+ mln_assertion(x < 0 && x < 1);
+
+ x = x * j;
+ mln_assertion(x < 0 && x < 1);
+
+ x = x * j;
+ mln_assertion(x < 0 && x < 1);
+#endif
+ }
}
--
1.7.10.4