Debian Codegraph @

debian/patches/fix_test

raw
1 From 71457ab69083af8c11730d41644659b0d32106a1 Mon Sep 17 00:00:00 2001
2 From: Klaas Gadeyne <[email protected]>
3 Date: Fri, 25 May 2018 08:49:05 +0200
4 Subject: [PATCH] fix test that sometimes caused havoc in Mac OS X due to
5 different approximation/rounding.
6
7 ---
8 tests/complete_filter_test.cpp | 11 ++++++++---
9 1 file changed, 8 insertions(+), 3 deletions(-)
10
11 diff --git a/tests/complete_filter_test.cpp b/tests/complete_filter_test.cpp
12 index f909664..6826051 100644
13 --- a/tests/complete_filter_test.cpp
14 +++ b/tests/complete_filter_test.cpp
15 @@ -451,11 +451,16 @@ Complete_FilterTest::testComplete_FilterValue_Discr()
16 filter.Update(&sys_model,&meas_model,measurement);
17 } // estimation loop
18
19 + // FIXME: This test needs more explanation...
20 DiscretePdf * posterior = filter.PostGet();
21 for (int state=0; state< num_states; state++)
22 {
23 - //cout << state << ": " << posterior->ProbabilityGet(state) << endl;
24 - if (state== (int)(mobile_robot.GetState()(2)) ) CPPUNIT_ASSERT(posterior->ProbabilityGet(state) >0.9);
25 - else CPPUNIT_ASSERT(posterior->ProbabilityGet(state) <0.1);
26 + // std::cout << "state = " << state << " : " << "posterior->ProbabilityGet(state) = " << posterior->ProbabilityGet(state) << std::endl;
27 + if (state == (int)(round(mobile_robot.GetState()(2))) ){ // Y position What does this comparison mean???
28 + CPPUNIT_ASSERT(posterior->ProbabilityGet(state) >0.9);
29 + }
30 + else {
31 + CPPUNIT_ASSERT(posterior->ProbabilityGet(state) <0.1);
32 + }
33 }
34 }