This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 24ef62ed281c580a966a40983f5182b11c60b2ff
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Thu May 8 17:26:22 2025 +0200

    Fix the test failures in XCharacterClassificationTest._getType().
    Some of the hardcoded characters no longer had the type they were
    originally expected to have, probably due to changes in new Unicode
    versions. Replace them with other characters that have the expected
    types now.
    
    Patch by: me
---
 .../source/api/i18n/XCharacterClassificationTest.java  | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/test/testuno/source/api/i18n/XCharacterClassificationTest.java 
b/test/testuno/source/api/i18n/XCharacterClassificationTest.java
index 8a78192373..471fc2b879 100644
--- a/test/testuno/source/api/i18n/XCharacterClassificationTest.java
+++ b/test/testuno/source/api/i18n/XCharacterClassificationTest.java
@@ -230,11 +230,15 @@ public class XCharacterClassificationTest {
     @Test
     public void _getType() {
         boolean res = true;
-        char[] characters = new char[]{586,65,97,498,721,4588,772,8413,3404,
-            
48,8544,179,32,8232,8233,144,8204,57344,56320,173,40,41,95,3852,247,
-            3647,901,3896,171,187};
-        int[] charsInt = new int[]{586,65,97,498,721,4588,772,8413,3404,48,
-            8544,179,32,8232,8233,144,8204,57344,56320,173,40,41,95,3852,247,
+        // If or when this list gets out of date again,
+        // find new characters of the required type with:
+        // for (int i = 30; i <= 0xffff; i++) {
+        //     String s = new String("" + (char)i);
+        //     int type = oObj.getType(s, 0);
+        //     System.out.println("character " + i + " has type " + 
charstyles_office[type]);
+        // }
+        char[] characters = new char[]{888,65,97,498,721,4588,772,8413,3404,
+            48,8544,179,32,8232,8233,144,8204,57344,56320,45,40,41,95,3852,247,
             3647,901,3896,171,187};
         String toCheck = new String(characters);
 
@@ -242,9 +246,9 @@ public class XCharacterClassificationTest {
             int get = oObj.getType(toCheck, i);
             res &= (charstyles_office[get] == charstyles_office[i]);
             if (!res) {
-                System.out.println("Code :" + 
Integer.toHexString(charsInt[i]));
+                System.out.println("Code: " + 
Integer.toHexString((int)characters[i]));
                 System.out.println("Gained: " + charstyles_office[get]);
-                System.out.println("Expected : " + charstyles_office[i]);
+                System.out.println("Expected: " + charstyles_office[i]);
             }
         }
         Assert.assertTrue("getType()", res);

Reply via email to