[perl #48749] [BUG] t/examples/tutorial.t if_unless failure (Win32)

Ron Schmidt via RT parrotbug-followup at parrotcode.org
Mon Feb 23 00:00:56 UTC 2009


On Tue Jan 01 06:00:00 2008, cosimo wrote:
> On Lun. 17 Dic. 2007 02:35:56, ptc wrote:
> > I'm currently getting the following failure on Win32 (VisualStudio
> > 2005, ActiveState Perl, r24008):
> > 
> > #     Failed test (t/examples/tutorial.t at line 247)
> > t/examples/tutorial..........................NOK 35#          got:
...
> > t/examples/tutorial..........................dubious
> >         Test returned status 1 (wstat 256, 0x100)
> > DIED. FAILED test 35
> >         Failed 1/35 tests, 97.14% okay
> 
> I also experienced this failure, probably not related to Win32.
> The solution IMO is to add a row "NaN was false" to
> the test result string to t/examples/tutorial.t in the test #35.

The test passes for me on Windows XP with Strawberry Perl and gcc.  It 
also passes on cygwin and Linux.  And yes, on the XP machine I 
commented 51_if_unless out of the todo hash and all tests still ran 
successfully.  I find it unlikely that treating NaN as false is a good 
solution.  None of the systems that run the test successfully treated 
NaN as false for this test.  Also see the small 'C' example below that 
demonstrates that gcc does not treat NaN as false.

Could someone please retest this on Win32 particularly with Visual 
Studio to see if it is still an issue at all and if so whether it might 
be a VC++ difference/issue.

Thanks,
Ron

/* example below prints "NaN/Inf is true" for gcc under cygwin/linux. */

#include <stdio.h>

int main(int argc, char ** argv) {
	float z = 0.0;
	float f = 1.0 / 0.0;
	if (z)
		printf("float zero is true ???\n");
	else 
		if (f) 
			printf("%f NaN/Inf is true\n", f);
		else
			printf("NaN/Inf is false\n");
}



More information about the parrot-dev mailing list