Issues

ZF-2633: testToFloatSetlocale(Zend_Locale_FormatTest): "Zend_Locale_Math_Exception: subtraction overflow: 1234.5 - 1234 != 0,5"

Description

Error occurs while unit tests passing with the following diagnostic:

 
2) testToFloatSetlocale(Zend_Locale_FormatTest)
Zend_Locale_Math_Exception: subtraction overflow: 1234.5 - 1234 != 0,5
/home/cawa/ZendFramework/release-1.0/library/Zend/Locale/Format.php:399
/home/cawa/ZendFramework/release-1.0/library/Zend/Locale/Format.php:526
/home/cawa/ZendFramework/release-1.0/tests/Zend/Locale/FormatTest.php:913
/home/cawa/ZendFramework/release-1.0/tests/AllTests.php:51
/home/cawa/ZendFramework/release-1.0/tests/AllTests.php:65

Comments

Have you tested with the branch or just with the release ??? This is part of another issue and has already been fixed in te past with the help of Darby and Sebastian.

It would be interesting if the same problem occurs within trunk or not.

I need details... PHP Version, OS, BCMath activated, Used Locale, ZF Revision

It's current SVN version of release maintenance branch

I tested it using two different Linux machines.

PHP versions:

PHP 5.2.5 (cli) (built: Feb 12 2008 11:37:43) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

PHP 5.2.4 (cli) (built: Oct 16 2007 17:32:16) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans

PHP 5.2.2RC2-dev (cli) (built: Feb 1 2008 01:09:49) Copyright (c) 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

BCMath extension is disabled (enabling bcmath extension doesn't help)

TESTS_ZEND_LOCALE_BCMATH_ENABLED tests configuration variable is set to true.

ZF revision 7971

Can you please test with the latest release and give me response ?

Still fails:


1) testToFloatSetlocale(Zend_Locale_FormatTest)
Zend_Locale_Math_Exception: subtraction overflow: 1234.5 - 1234 != 0,5
/home/cawa/ZendFramework/release-1.0/library/Zend/Locale/Format.php:409
/home/cawa/ZendFramework/release-1.0/library/Zend/Locale/Format.php:532
/home/cawa/ZendFramework/release-1.0/tests/Zend/Locale/FormatTest.php:913
/home/cawa/ZendFramework/release-1.0/tests/Zend/Locale/AllTests.php:63
/home/cawa/ZendFramework/release-1.0/tests/Zend/Locale/AllTests.php:79

I attached a debug version for Zend/Locale/Math/PhpMath.php

Please change yours with the debug file and return me the debug output for detail analysis. Thank you

Here is an output of the test code you provided (see the attachment).

Output is generated by passing Zend_Locale tests set (tests/Zend/Locale/AllTests.php).

Unsure if it will make until 1.0.4... therefor downgrading to critical

I attached a reworked PhpMath file. The problem is related to a autoconversion which is done even after casting to a specific type.

Please test the new version and give me feedback if it now works or if I have to find another way.

Aha. OK!

Here is next output (out1.txt)

Changeset 8266 is related to this issue (wrong issue number in the comment)

Fixed for trunk and release maintenance branch.

Thomas, please review the changes

I reviewed them and found other problems related to this. I rewrote the class, now it should work in all different environments.

I have no problems in my 3 environments... can you verify that for your's ?

PS: I made the changes only to trunk ! If it works for you you can make the change also to branch (ask darby related to release date)

I've tested it and got a set of errors (see the attached file). I have fix for them and I'm going to commit it. Please review update.

PS Could you mention JIRA issue number within commit comments (like [ZF-xxxx])? JIRA automatically lists such commits within 'FishEye' tab for the specified issue and it's very helpful for linking changesets with issues and merging changes to branches.

Still have problems...


PHPUnit 3.2.12 by Sebastian Bergmann.

............................................................ 60 / 87
...............E...........

Time: 14 seconds

There was 1 error:

1) testToFloatSetlocale(Zend_Locale_FormatTest)
Zend_Locale_Math_Exception: subtraction overflow: 1234,5 - 1234 != 0
/home/cawa/ZendFramework/trunk/library/Zend/Locale/Format.php:414
/home/cawa/ZendFramework/trunk/library/Zend/Locale/Format.php:537
/home/cawa/ZendFramework/trunk/tests/Zend/Locale/FormatTest.php:913
/home/cawa/ZendFramework/trunk/tests/Zend/Locale/AllTests.php:63
/home/cawa/ZendFramework/trunk/tests/Zend/Locale/AllTests.php:79

FAILURES!
Tests: 87, Errors: 1.

Some problems still exist. Needs more complex solution.

Test is marked as skipped.

Priority is downgraded to postpone issue.

Should be fixed with SVN-8532... please verify this and give me feedback... Thank you

Fixed