Commit 56971cfe authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Fix unit tests.

parent 47d250a7
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
namespace dynamicgraph { namespace dynamicgraph {
/// Template class used to serialize a signal value. /// Template class used to serialize a signal value.
template <typename T> struct signal_disp { template <typename T> struct signal_disp {
inline static void run (const T &value, std::ostream &os) { os << value << '\n'; } inline static void run (const T &value, std::ostream &os) { os << value; }
}; };
/// Template specialization of signal_disp for Eigen objects /// Template specialization of signal_disp for Eigen objects
......
...@@ -112,5 +112,5 @@ BOOST_AUTO_TEST_CASE(test_tracer) { ...@@ -112,5 +112,5 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
"TracerRealTime my-tracer [mode=play] : \n" "TracerRealTime my-tracer [mode=play] : \n"
" - Dep list: \n" " - Dep list: \n"
" -> MyEntity(my-entity)::input(double)::out_double (in output)" " -> MyEntity(my-entity)::input(double)::out_double (in output)"
" [9Ko/16Ko] \n")); " [8Ko/16Ko] \n"));
} }
...@@ -36,15 +36,15 @@ BOOST_AUTO_TEST_CASE(standard_double_registerer) { ...@@ -36,15 +36,15 @@ BOOST_AUTO_TEST_CASE(standard_double_registerer) {
typedef std::pair<std::string, std::string> test_t; typedef std::pair<std::string, std::string> test_t;
std::vector<test_t> values; std::vector<test_t> values;
values.push_back(std::make_pair("42.0", "42\n")); values.push_back(std::make_pair("42.0", "42"));
values.push_back(std::make_pair("42.5", "42.5\n")); values.push_back(std::make_pair("42.5", "42.5"));
values.push_back(std::make_pair("-12.", "-12\n")); values.push_back(std::make_pair("-12.", "-12"));
// Double special values. // Double special values.
// FIXME: these tests are failing :( // FIXME: these tests are failing :(
values.push_back(std::make_pair("inf", "inf\n")); values.push_back(std::make_pair("inf", "inf"));
values.push_back(std::make_pair("-inf", "-inf\n")); values.push_back(std::make_pair("-inf", "-inf"));
values.push_back(std::make_pair("nan", "nan\n")); values.push_back(std::make_pair("nan", "nan"));
BOOST_FOREACH (const test_t &test, values) { BOOST_FOREACH (const test_t &test, values) {
// Set // Set
...@@ -55,14 +55,14 @@ BOOST_AUTO_TEST_CASE(standard_double_registerer) { ...@@ -55,14 +55,14 @@ BOOST_AUTO_TEST_CASE(standard_double_registerer) {
{ {
output_test_stream output; output_test_stream output;
mySignal.get(output); mySignal.get(output);
BOOST_CHECK(output.is_equal(test.second)); BOOST_CHECK_EQUAL(output.str(), test.second);
} }
// Trace // Trace
{ {
output_test_stream output; output_test_stream output;
mySignal.trace(output); mySignal.trace(output);
BOOST_CHECK(output.is_equal(test.second)); BOOST_CHECK_EQUAL(output.str(), test.second);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment