aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2009-10-15 20:43:13 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2009-10-15 20:43:13 +0000
commit3938e8f60e96809fbdafacf5d96e3325d3452289 (patch)
tree0cabf583e4660f6ce0d42a549ec2a06690194bd8 /test/java/org/apache/fop
parentea58935a59a651eba814fc0eb4d16d0e2a972d97 (diff)
downloadxmlgraphics-fop-3938e8f60e96809fbdafacf5d96e3325d3452289.tar.gz
xmlgraphics-fop-3938e8f60e96809fbdafacf5d96e3325d3452289.zip
Application of the patch submitted by Alexander Kiel to improve variable names around Kerning and KnuthElement (see https://issues.apache.org/bugzilla/show_bug.cgi?id=48003).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@825646 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
-rw-r--r--test/java/org/apache/fop/layoutengine/ElementListCheck.java36
-rw-r--r--test/java/org/apache/fop/util/ElementListUtilsTestCase.java30
2 files changed, 33 insertions, 33 deletions
diff --git a/test/java/org/apache/fop/layoutengine/ElementListCheck.java b/test/java/org/apache/fop/layoutengine/ElementListCheck.java
index 1b6077c29..e63fc3291 100644
--- a/test/java/org/apache/fop/layoutengine/ElementListCheck.java
+++ b/test/java/org/apache/fop/layoutengine/ElementListCheck.java
@@ -83,10 +83,10 @@ public class ElementListCheck implements LayoutEngineCheck {
}
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if ("true".equals(domEl.getAttribute("aux"))) {
@@ -110,24 +110,24 @@ public class ElementListCheck implements LayoutEngineCheck {
KnuthPenalty pen = (KnuthPenalty)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if (domEl.getAttribute("p").length() > 0) {
if ("<0".equals(domEl.getAttribute("p"))) {
- if (knuthEl.getP() >= 0) {
+ if (knuthEl.getPenalty() >= 0) {
fail("Expected p<0"
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
} else if (">0".equals(domEl.getAttribute("p"))) {
- if (knuthEl.getP() <= 0) {
+ if (knuthEl.getPenalty() <= 0) {
fail("Expected p>0"
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
} else {
int p;
@@ -142,20 +142,20 @@ public class ElementListCheck implements LayoutEngineCheck {
} else {
p = Integer.parseInt(domEl.getAttribute("p"));
}
- if (p != knuthEl.getP()) {
+ if (p != knuthEl.getPenalty()) {
fail("Expected p=" + p
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
}
}
if ("true".equals(domEl.getAttribute("flagged"))) {
- if (!pen.isFlagged()) {
+ if (!pen.isPenaltyFlagged()) {
fail("Expected flagged penalty"
+ " at position " + pos);
}
} else if ("false".equals(domEl.getAttribute("flagged"))) {
- if (pen.isFlagged()) {
+ if (pen.isPenaltyFlagged()) {
fail("Expected non-flagged penalty"
+ " at position " + pos);
}
@@ -180,26 +180,26 @@ public class ElementListCheck implements LayoutEngineCheck {
KnuthGlue glue = (KnuthGlue)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if (domEl.getAttribute("y").length() > 0) {
int stretch = Integer.parseInt(domEl.getAttribute("y"));
- if (stretch != knuthEl.getY()) {
+ if (stretch != knuthEl.getStretch()) {
fail("Expected y=" + stretch
+ " (stretch) at position " + pos
- + " but got: " + knuthEl.getY());
+ + " but got: " + knuthEl.getStretch());
}
}
if (domEl.getAttribute("z").length() > 0) {
int shrink = Integer.parseInt(domEl.getAttribute("z"));
- if (shrink != knuthEl.getZ()) {
+ if (shrink != knuthEl.getShrink()) {
fail("Expected z=" + shrink
+ " (shrink) at position " + pos
- + " but got: " + knuthEl.getZ());
+ + " but got: " + knuthEl.getShrink());
}
}
} else {
diff --git a/test/java/org/apache/fop/util/ElementListUtilsTestCase.java b/test/java/org/apache/fop/util/ElementListUtilsTestCase.java
index d41e9f94f..bebad4422 100644
--- a/test/java/org/apache/fop/util/ElementListUtilsTestCase.java
+++ b/test/java/org/apache/fop/util/ElementListUtilsTestCase.java
@@ -55,9 +55,9 @@ public class ElementListUtilsTestCase extends TestCase {
assertFalse(res);
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(0, ((KnuthPenalty)lst.get(5)).getP());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(0, ((KnuthPenalty)lst.get(5)).getPenalty());
}
/**
@@ -82,11 +82,11 @@ public class ElementListUtilsTestCase extends TestCase {
assertFalse(res);
//Must insert an INFINITE penalty
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(2)).getW());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(4)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(5)).getW());
- assertEquals(0, ((KnuthGlue)lst.get(7)).getW());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(2)).getWidth());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(4)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(5)).getWidth());
+ assertEquals(0, ((KnuthGlue)lst.get(7)).getWidth());
}
/**
@@ -110,9 +110,9 @@ public class ElementListUtilsTestCase extends TestCase {
assertFalse(res);
- assertEquals(0, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getP());
+ assertEquals(0, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getPenalty());
}
/**
@@ -137,10 +137,10 @@ public class ElementListUtilsTestCase extends TestCase {
assertFalse(res);
//Must insert an INFINITE penalty
- assertEquals(0, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(6)).getW());
+ assertEquals(0, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(6)).getWidth());
}