inigo / daisydiff

Automatically exported from code.google.com/p/daisydiff
0 stars 0 forks source link

LongHtmlTest fails with java.lang.AssertionError #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run the LongHtmlTest with Java assertions enabled. (eg using the -ea JVM 
flag)

What is the expected output? What do you see instead?
The test should pass. (I haven't altered the test or the code).
But instead I get the following stack trace
longHtml1(org.outerj.daisy.diff.html.LongHtmlTest)  Time elapsed: 0.116 sec  
<<< FAILURE!
java.lang.AssertionError
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addTextBrokenAcrossLines(ChangeText.java:86)
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addTextCarefully(ChangeText.java:71)
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addTextCarefully(ChangeText.java:81)
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addTextCarefully(ChangeText.java:81)
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addTextCarefully(ChangeText.java:81)
        at org.outerj.daisy.diff.html.ancestor.ChangeText.addText(ChangeText.java:36)
        at org.outerj.daisy.diff.html.ancestor.tagtostring.AnchorToString.addAttributes(AnchorToString.java:39)
        at org.outerj.daisy.diff.html.ancestor.tagtostring.TagToString.getRemovedDescription(TagToString.java:74)
        at org.outerj.daisy.diff.html.ancestor.ChangeTextGenerator.addTagOld(ChangeTextGenerator.java:122)
        at org.outerj.daisy.diff.html.ancestor.ChangeTextGenerator.getChanged(ChangeTextGenerator.java:83)
        at org.outerj.daisy.diff.html.ancestor.AncestorComparator.getResult(AncestorComparator.java:81)
        at org.outerj.daisy.diff.html.TextNodeComparator.handlePossibleChangedPart(TextNodeComparator.java:136)
        at org.outerj.daisy.diff.html.HTMLDiffer.diff(HTMLDiffer.java:75)
        at org.outerj.daisy.diff.html.HtmlTestFixture.diff(HtmlTestFixture.java:104)
        at org.outerj.daisy.diff.html.LongHtmlTest.longHtml1(LongHtmlTest.java:42)

What version of the product are you using? On what operating system?
v 1.1
MacOSX 10.6.6
Java 1.6.0_24

Please provide any additional information below.
The failing assertion is:
 assert (s.indexOf(' ') < 0 && s.length() > maxNbCharsPerLine);
Only the first part fails.  That is, if I comment out the 
s.indexOf(' ') &&
the assertion succeeds and the test passes.

I'm yet to look into whether the assertion is actually unreasonable or whether 
something needs to be fixed to prevent it happening.

Original issue reported on code.google.com by don.jp.w...@gmail.com on 5 May 2011 at 4:44