pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1841087 - /pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
Date Mon, 17 Sep 2018 16:24:22 GMT
Author: tilman
Date: Mon Sep 17 16:24:22 2018
New Revision: 1841087

URL: http://svn.apache.org/viewvc?rev=1841087&view=rev
Log:
PDFBOX-4318: add test inspired by bug reproducing code of Daniel Wildschut

Modified:
    pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java

Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java?rev=1841087&r1=1841086&r2=1841087&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
Mon Sep 17 16:24:22 2018
@@ -190,6 +190,32 @@ public class PDFontTest
         doc.close();
     }
 
+    /**
+     * Test whether bug from PDFBOX-4318 is fixed, which had the wrong cache key.
+     * @throws java.io.IOException
+     */
+    @Test
+    public void testPDFox4318() throws IOException
+    {
+        try
+        {
+            PDType1Font.HELVETICA_BOLD.encode("\u0080");
+            Assert.fail("should have thrown IllegalArgumentException");
+        }
+        catch (IllegalArgumentException ex)
+        {
+        }
+        PDType1Font.HELVETICA_BOLD.encode("€");
+        try
+        {
+            PDType1Font.HELVETICA_BOLD.encode("\u0080");
+            Assert.fail("should have thrown IllegalArgumentException");
+        }
+        catch (IllegalArgumentException ex)
+        {
+        }
+    }
+
     private void testPDFBox3826checkFonts(byte[] byteArray, File fontFile) throws IOException
     {
         PDDocument doc = PDDocument.load(byteArray);



Mime
View raw message