Bugzilla – Attachment 124910 Details for
Bug 99730
testFuncMDETERM fails due to floating point calculations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Possible patch using a fuzzy test for zero
libreoffice-unittest-MDETERM.patch (text/plain), 1.28 KB, created by
librenedine
on 2016-05-08 13:50:29 UTC
(
hide
)
Description:
Possible patch using a fuzzy test for zero
Filename:
MIME Type:
Creator:
librenedine
Created:
2016-05-08 13:50:29 UTC
Size:
1.28 KB
patch
obsolete
>diff -u a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx >--- a/sc/qa/unit/ucalc_formula.cxx >+++ b/sc/qa/unit/ucalc_formula.cxx >@@ -6847,17 +6847,10 @@ > aFormulaBuffer[13] = static_cast<sal_Unicode>( '0' + nSize ); > m_pDoc->SetString(aPos, aFormulaBuffer.toString()); > >- // On crappy 32-bit targets, presumably without extended precision on >- // interim results or optimization not catching it, this test fails >- // when comparing to 0.0, so have a narrow error margin. See also >- // commit message of 8140309d636d4a870875f2dd75ed3dfff2c0fbaf >-#if SAL_TYPES_SIZEOFPOINTER == 4 >- CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of MDETERM incorrect for singular integer matrix", >+ // Do not compare with equality instead use an error margin. >+ // This applies to both 32bit and 64bit. >+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of MDETERM incorrect for singular integer matrix (error tolerance 1e-12)", > 0.0, m_pDoc->GetValue(aPos), 1e-12); >-#else >- CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of MDETERM incorrect for singular integer matrix", >- 0.0, m_pDoc->GetValue(aPos)); >-#endif > } > > int aVals[] = {23, 31, 13, 12, 34, 64, 34, 31, 98, 32, 33, 63, 45, 54, 65, 76};
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 99730
: 124910