Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LongHtmlTest fails with java.lang.AssertionError #32

Open
GoogleCodeExporter opened this issue May 1, 2015 · 0 comments
Open

LongHtmlTest fails with java.lang.AssertionError #32

GoogleCodeExporter opened this issue May 1, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 5 May 2011 at 4:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant