]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Enable stretch and shrink checking on glues.
authorJeremias Maerki <jeremias@apache.org>
Thu, 13 Oct 2005 17:39:58 +0000 (17:39 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 13 Oct 2005 17:39:58 +0000 (17:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@320822 13f79535-47bb-0310-9956-ffa450edef68

test/java/org/apache/fop/layoutengine/ElementListCheck.java

index bf6cc0fdbedb85d479690bf844d4cec44f9672ca..151dbd18d74ccc07b30ff930ff1c6a815511553f 100644 (file)
@@ -185,7 +185,22 @@ public class ElementListCheck implements LayoutEngineCheck {
                                     + " but got: " + knuthEl.getW());
                         }
                     }
-                    //TODO Check stretch and shrink
+                    if (domEl.getAttribute("y").length() > 0) {
+                        int stretch = Integer.parseInt(domEl.getAttribute("y"));
+                        if (stretch != knuthEl.getY()) {
+                            fail("Expected y=" + stretch 
+                                    + " (stretch) at position " + pos 
+                                    + " but got: " + knuthEl.getY());
+                        }
+                    }
+                    if (domEl.getAttribute("z").length() > 0) {
+                        int shrink = Integer.parseInt(domEl.getAttribute("z"));
+                        if (shrink != knuthEl.getZ()) {
+                            fail("Expected z=" + shrink 
+                                    + " (shrink) at position " + pos 
+                                    + " but got: " + knuthEl.getZ());
+                        }
+                    }
                 } else {
                     throw new IllegalArgumentException("Invalid child node for 'element-list': " 
                             + domEl.getLocalName()