ZF-2034: testConvertTo(Zend_Measure_NumberTest) failing

Issue Type: Unit Tests: Problem Created: 2007-10-03T04:18:44.000+0000 Last Updated: 2008-03-21T16:25:42.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Sebastian Nohn (nohn) Assignee: Thomas Weidner (thomas) Tags: - Zend_Measure

Related issues: Attachments:


1.0-Branch, revision 6577:

  1. testConvertTo(Zend_Measure_NumberTest) Failed asserting that two strings are equal. expected string <3 â½> difference < ????> got string <3> /home/sebastian/Work/ZendFramework-1.0/tests/Zend/Measure/NumberTest.php:256


Posted by Thomas Weidner (thomas) on 2007-11-04T09:51:04.000+0000

Integrated trunk into branch. Please check the latest revision and give us feedback.

Posted by Sebastian Nohn (nohn) on 2007-11-06T01:56:39.000+0000

1.0-Branch, At revision 6754:

  1. testConvertTo(Zend_Measure_NumberTest) Failed asserting that two strings are equal. expected string <3 â½> difference < ????> got string <3> /home/sebastian/Work/ZendFramework-1.0/tests/Zend/Measure/NumberTest.php:256

Posted by Thomas Weidner (thomas) on 2007-12-01T10:45:09.000+0000

Seems that this issue depends on ZF-2169.

It would be great if you can test this with the latest trunk and the attached debug file from the other issue.


Posted by Darby Felton (darby) on 2007-12-05T13:48:10.000+0000

I seem to have trouble on certain platforms (e.g., trunk SVN r7041 with PHP 5.2.4, PHPUnit 3.2.2 on RHEL4) with a test in Zend_Measure_NumberTest causing the test suite to halt or spin (e.g., infinite loop?). I ran it as follows under the default TestConfiguration.php.dist:

<pre class="literal">
phpunit --verbose AllTests > AllTests.ConfigDefault.out 2>&1

Leading output snipped:

<pre class="literal">   Zend_Measure_LightnessTest


The end of the above output is where the test suite halts for me. At this point the phpunit process needs to be terminated, or it just runs ad infinitum without producing output.

I suspected testConvertTo() to be likely at fault, so I wanted to make a note of it here, rather than create a separate issue. If this is an incorrect assumption, please feel free to use this information to create another issue. I can provide additional information as needed.

Also, a minor thing, [~thomas] comments that this issue depends on [ZF-2169], but the dependency in JIRA shows the other way around.

Posted by Sebastian Nohn (nohn) on 2007-12-05T13:54:09.000+0000

I can reproduce that (only difference is that I run Ubuntu 6.06)

Posted by Thomas Weidner (thomas) on 2007-12-05T15:26:41.000+0000

Nice that everybody responds that he can confirm this issue. But without the debug output I am not able to fix it. I feel a little bit of ignored. ;-)

Darby's test broke at testNumberSetType()... can be seen from the output... this is the fourth test. Sebstian's Line 256 is an empty line within Number-Test.

The class itself calculates with an internal precision of 25. It could be possible that this precision is the reason for the problems... but it degrades to float calculation when no bcmath is avaiable... which should make no performance problems in my eyes.

Anyway... the originate issue is is a problem which I don't quite understand:

The test tries to equal the output with a defined value. The value is 3 but the output is "3 (10)"... but within windows the tests run without reported problems. Within linux there is a difference. So this seems to be the problem of the reported issue.

But again... this has nothing to do with the seen infinite loop.

Posted by Thomas Weidner (thomas) on 2007-12-05T15:34:24.000+0000

After some testing I found the reason:

phpunit seems to react different on win* and *nix systems:

<pre class="highlight">
$value = '3 ⑽';
testEquals(3, $value);

returns true on windows and false on linux

<pre class="highlight">
$value = '3 ⑽';
testEquals('3 ⑽', $value);

returns true on windows and true on linux

I am using 3.1.0 beta2 since several months without problems in the past. I can not verify if it's related to phpunit or some magical windows-php auto-conversion. But I think this is the originate problem.

Posted by Thomas Weidner (thomas) on 2007-12-06T01:50:22.000+0000

I fixed now the testbed. So the originate problem should not occur anymore.

Please give SVN-7047 a try and us a response.

Posted by Thomas Weidner (thomas) on 2007-12-06T01:54:41.000+0000

I created a own issue for the loop problem... see ZF-2272 for details.

Posted by Darby Felton (darby) on 2007-12-06T13:46:11.000+0000

I confirm this issue is fixed for me, though I still experience the hanging ([ZF-2272]).

Posted by Darby Felton (darby) on 2007-12-06T15:32:56.000+0000

Thanks, Thomas! :)

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.