pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1801618 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java
Date Tue, 11 Jul 2017 14:33:53 GMT
Author: tilman
Date: Tue Jul 11 14:33:53 2017
New Revision: 1801618

URL: http://svn.apache.org/viewvc?rev=1801618&view=rev
Log:
PDFBOX-3864: add test

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java?rev=1801618&r1=1801617&r2=1801618&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/PDFDocEncodingTest.java Tue Jul
11 14:33:53 2017
@@ -17,11 +17,11 @@
 
 package org.apache.pdfbox.cos;
 
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
 
 /**
  * Test for PDFDocEncoding.
@@ -89,5 +89,22 @@ public class PDFDocEncodingTest
             assertEquals(cosString.getString(), deviation);
         }
     }
-}
 
+    /**
+     * PDFBOX-3864: Test that chars smaller than 256 which are NOT part of PDFDocEncoding
are
+     * handled correctly.
+     *
+     * @throws IOException
+     */
+    @Test
+    public void testPDFBox3864() throws IOException
+    {
+        for (int i = 0; i < 256; i++)
+        {
+            String hex = String.format("FEFF%04X", i);
+            COSString cs1 = COSString.parseHex(hex);
+            COSString cs2 = new COSString(cs1.getString());
+            assertEquals(cs1, cs2);
+        }
+    }
+}



Mime
View raw message