pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1839726 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
Date Fri, 31 Aug 2018 04:16:06 GMT
Author: tilman
Date: Fri Aug 31 04:16:06 2018
New Revision: 1839726

URL: http://svn.apache.org/viewvc?rev=1839726&view=rev
Log:
PDFBOX-4302: test must have MAX_ENTRIES_PER_OPERATOR unique characters

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java?rev=1839726&r1=1839725&r2=1839726&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
Fri Aug 31 04:16:06 2018
@@ -20,6 +20,8 @@ package org.apache.pdfbox.pdmodel.font;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
 import junit.framework.TestCase;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
@@ -230,7 +232,15 @@ public class TestFontEmbedding extends T
         text = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん"
+
                 "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン"
+
                 "12345678";
-        assertEquals(ToUnicodeWriter.MAX_ENTRIES_PER_OPERATOR, text.length());
+
+        // The test must have MAX_ENTRIES_PER_OPERATOR unique characters
+        Set<Character> set = new HashSet<>(ToUnicodeWriter.MAX_ENTRIES_PER_OPERATOR);
+        for (int i = 0; i < text.length(); ++i)
+        {
+            set.add(text.charAt(i));
+        }
+        assertEquals(ToUnicodeWriter.MAX_ENTRIES_PER_OPERATOR, set.size());
+
         try (PDDocument document = new PDDocument())
         {
             PDPage page = new PDPage(PDRectangle.A0);



Mime
View raw message