aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-07-15 20:19:06 +0000
committerNick Burch <nick@apache.org>2008-07-15 20:19:06 +0000
commitd526a30313ac2e9ce801092500a560872b41f961 (patch)
treeb447610baad3046bc77a4160e8b68b7844092381 /src/testcases/org/apache/poi/hssf
parent6b6f924c299bae2ee80c1aee644a9c174a75c39b (diff)
downloadpoi-d526a30313ac2e9ce801092500a560872b41f961.tar.gz
poi-d526a30313ac2e9ce801092500a560872b41f961.zip
Method to check if two fonts have the same contents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@677028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf')
-rw-r--r--src/testcases/org/apache/poi/hssf/record/TestFontRecord.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java
index 6485f586f9..d5051e9915 100644
--- a/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java
+++ b/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java
@@ -121,4 +121,21 @@ public class TestFontRecord
for (int i = 0; i < data.length; i++)
assertEquals("At offset " + i, data[i], recordBytes[i+4]);
}
+
+ public void testSameProperties() throws Exception {
+ FontRecord f1 = new FontRecord(new TestcaseRecordInputStream((short)0x31, (short)data.length, data));
+ FontRecord f2 = new FontRecord(new TestcaseRecordInputStream((short)0x31, (short)data.length, data));
+
+ assertTrue(f1.sameProperties(f2));
+
+ f2.setFontName("Arial2");
+ assertFalse(f1.sameProperties(f2));
+ f2.setFontName("Arial");
+ assertTrue(f1.sameProperties(f2));
+
+ f2.setFontHeight((short)11);
+ assertFalse(f1.sameProperties(f2));
+ f2.setFontHeight((short)0xc8);
+ assertTrue(f1.sameProperties(f2));
+ }
}