Issues

ZF-2839: Zend_Measure unit tests fail

Description

Several unit tests errors came with the latest updates:


There were 14 errors:

1) testFlow_MassSetComputedType2(Zend_Measure_Flow_MassTest)
Zend_Locale_Math_Exception: division overflow: -0.1 / 86400 != -1.1574074074074E-6
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:202
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/Flow/MassTest.php:322
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

2) testFlow_MoleSetComputedType2(Zend_Measure_Flow_MoleTest)
Zend_Locale_Math_Exception: division overflow: -0.1 / 86400 != -1.1574074074074E-6
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:202
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/Flow/MoleTest.php:322
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

3) testFlow_VolumeSetType(Zend_Measure_Flow_VolumeTest)
Zend_Locale_Math_Exception: division overflow: -100 / 0.028316847 != -3531.4666212661
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:241
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/Flow/VolumeTest.php:298
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

4) testViscosity_KinematicSetComputedType2(Zend_Measure_Viscosity_KinematicTest)
Zend_Locale_Math_Exception: division overflow: -100 / 864000 != -0.00011574074074074
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:202
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/Viscosity/KinematicTest.php:322
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

5) testAccelerationSetType(Zend_Measure_AccelerationTest)
Zend_Locale_Math_Exception: division overflow: -100 / 9.80665 != -10.197162129779
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:241
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/AccelerationTest.php:169
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

6) testAccelerationConvertTo(Zend_Measure_AccelerationTest)
Zend_Locale_Math_Exception: division overflow: -100 / 9.80665 != -10.197162129779
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:241
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:311
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/AccelerationTest.php:231
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

7) testAreaSetComputedType2(Zend_Measure_AreaTest)
Zend_Locale_Math_Exception: division overflow: -0.064516 / 27878400 != -2.314193067034E-9
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:235
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/AreaTest.php:339
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

8) testLengthSetType(Zend_Measure_LengthTest)
Zend_Locale_Math_Exception: division overflow: -100 / 1609.344 != -0.062137119223733
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:241
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/LengthTest.php:315
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

9) testLengthSetComputedType2(Zend_Measure_LengthTest)
Zend_Locale_Math_Exception: division overflow: -79200 / 3937 != -20.11684023368
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:202
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/LengthTest.php:339
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

10) testNumberSetType(Zend_Measure_NumberTest)
Zend_Locale_Math_Exception: modulo overflow: 1 % 7 (result=0.14285714285714)
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Number.php:314
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Number.php:378
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/NumberTest.php:180
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

11) testTemperatureSetType1(Zend_Measure_TemperatureTest)
Zend_Locale_Math_Exception: addition overflow: -73.333333333333 + 273.15 != 199.81666666667
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:206
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/TemperatureTest.php:327
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

12) testDetailConversion(Zend_Measure_TemperatureTest)
Zend_Locale_Math_Exception: addition overflow: 37.777777777778 + 273.15 != 310.92777777778
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:206
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:311
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/TemperatureTest.php:404
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

13) testTorqueSetComputedType2(Zend_Measure_TorqueTest)
Zend_Locale_Math_Exception: multiplication overflow: -0.70615518333333 * 16 != -11.298482933333
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:212
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/TorqueTest.php:339
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

14) testVolumeSetComputedType1(Zend_Measure_VolumeTest)
Zend_Locale_Math_Exception: division overflow: -0.49511316872429 / 0.0037854118 != -130.7950613786
/home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Measure/Abstract.php:235
/home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Measure/VolumeTest.php:333
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:71
/home/cawa/ZendFramework/svn/framework/branch/release-1.5/tests/Zend/Measure/AllTests.php:115

FAILURES!
Tests: 740, Errors: 14.

Errors occur for relese-1.5 branch as well as for the trunk

Comments

I thought you did test all with the change at ZF-2804.

What I found was that the original number has a precision of 12... but the result only a precision of 11... strange.... but this can be the reason of this error

I am focusing on test 12... one of the simpler ones... addition.

Should be fixed with latest updates

I'm assuming this was merged to the 1.5 branch for inclusion in 1.5.1. If this is not the case, please update JIRA.