orocos / orocos-bayesian-filtering

The orocos Bayesian Filtering Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test fails on i386 architecture

josch opened this issue · comments

commented

Hi,

I packaged orocos-bfl for Debian and noticed, that a test fails on the i386 and hurd-i386 architectures. Relevant build logs:

https://buildd.debian.org/status/fetch.php?pkg=orocos-bfl&arch=i386&ver=0.8.0-2&stamp=1522666884&raw=0
https://buildd.debian.org/status/fetch.php?pkg=orocos-bfl&arch=hurd-i386&ver=0.8.0-2&stamp=1522662767&raw=0

Relevant snippet from the error message in both build logs:

    Start 2: test_pdf

2: Test command: /<<PKGBUILDDIR>>/obj-i686-gnu/tests/test_pdf
2: Test timeout computed to be: 9.99988e+06
2: ...DiscretePdf::Samplefrom(int, void *): No such sampling method
2: .Box-Muller not implemented yet!
2: Box-Muller not implemented yet!
2: ...Mixture::Samplefrom(T, void *): No such sampling method
2: Mixture::Samplefrom(T, void *): No such sampling method
2: Mixture::Samplefrom(T, void *): No such sampling method
2: Mixture::Samplefrom(T, void *): No such sampling method
2: F.
2: 
2: pdf_test.cpp:1135:Assertion
2: Test name: PdfTest::testMixture
2: equality assertion failed
2: - Expected: 0.0590505944295115
2: - Actual  : 0.0590505944295115
2: 
2: Failures !!!
2: Run: 8   Failure total: 1   Failures: 1   Errors: 0
2/7 Test #2: test_pdf .........................***Failed    0.02 sec

The following patch fixed the problem:

--- a/tests/pdf_test.cpp
+++ b/tests/pdf_test.cpp
@@ -1132,7 +1132,7 @@ PdfTest::testMixture()
   {
     prob = prob + vecW[j-1] * componentVec[j-1]->ProbabilityGet(cv1) ;
   }
-  CPPUNIT_ASSERT_EQUAL((double)prob,(double)mixtureVec.ProbabilityGet(cv1)) ;
+  CPPUNIT_ASSERT_EQUAL(approxEqual((double)prob, (double)mixtureVec.ProbabilityGet(cv1), epsilon),true);
   //ExpectedValueGet
   expectedMix = mixtureVec.ExpectedValueGet() ;
   expectedComp = 0.0; 

Should be fixed now. Thx for submitting the issue!

As a side note: If you have any improvements/pull requests for the improvements/updates for the debian subdirectory orocos_bfl/debian, you're very welcome :-)

commented

You can always retrieve the latest packaging of orocos-bfl in Debian either via apt-get source orocos-bfl or debcheckout orocos-bfl, or, if you don't run Debian yourself, by browsing: https://sources.debian.org/src/orocos-bfl/0.8.0-3/debian/