tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -98,7 +98,7 @@
     void telugu();
     void kannada();
     void malayalam();
-    // sinhala missing
+    void sinhala();
 
     void khmer();
     void linearB();
@@ -379,7 +379,11 @@
                   { 0x151, 0x276, 0x172, 0x143, 0x0 } },
                 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
                   { 0x151, 0x276, 0x172, 0x144, 0x0 } }, 
-
+                // test decomposed two parts matras
+                { { 0x995, 0x9c7, 0x9be, 0x0 },
+                  { 0x179, 0x151, 0x172, 0x0 } },
+                { { 0x995, 0x9c7, 0x9d7, 0x0 },
+                  { 0x179, 0x151, 0x17e, 0x0 } },
 		{ {0}, {0} }
 	    };
 
@@ -502,16 +506,16 @@
         if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) {
             QFont f("Likhan");
 	    const ShapeTable shape_table [] = {
-		{ { 0x09a8, 0x09cd, 0x09af, 0x0 },
-		  { 0x0192, 0x0 } },
+                { { 0x9a8, 0x9cd, 0x9af, 0x0 },
+                  { 0x1ca, 0x0 } },
 		{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
-		  { 0x01d6, 0x0 } },
+                  { 0x020e, 0x0 } },
 		{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
-		  { 0x01bc, 0x0 } },
+                  { 0x01f4, 0x0 } },
 		{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
-		  { 0x01c6, 0x0 } },
+                  { 0x01fe, 0x0 } },
 		{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
-		  { 0xd3, 0x12f, 0x0 } },
+                  { 0x10b, 0x167, 0x0 } },
 
 		{ {0}, {0} }
 	    };
@@ -647,6 +651,12 @@
 		  { 0x0025, 0x0 } },
 		{ { 0x0b83, 0x0b95, 0x0 },
 		  { 0x0025, 0x0031, 0x0 } },
+                { { 0xb95, 0xbc6, 0xbbe, 0x0 },
+                  { 0xa, 0x31, 0x7, 0x0 } },
+                { { 0xb95, 0xbc7, 0xbbe, 0x0 },
+                  { 0xb, 0x31, 0x7, 0x0 } },
+                { { 0xb95, 0xbc6, 0xbd7, 0x0 },
+                  { 0xa, 0x31, 0x40, 0x0 } },
 
 		{ {0}, {0} }
 	    };
@@ -694,7 +704,9 @@
                   { 0xe6, 0xb3, 0x83, 0x0 } },
                 { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
                   { 0xe6, 0xb3, 0x9f, 0x0 } }, 
-		{ {0}, {0} }
+                { { 0xc15, 0xc46, 0xc56, 0x0 },
+                  { 0xe6, 0xb3, 0x0 } },
+                { {0}, {0} }
 
             };
 
@@ -762,7 +774,16 @@
 		  { 0x00b0, 0x006c, 0x0 } },
 		{ { 0x0cb7, 0x0ccd, 0x0 },
 		  { 0x0163, 0x0 } },
-
+                { { 0xc95, 0xcbf, 0xcd5, 0x0 },
+                  { 0x114, 0x73, 0x0 } },
+                { { 0xc95, 0xcc6, 0xcd5, 0x0 },
+                  { 0x90, 0x6c, 0x73, 0x0 } },
+                { { 0xc95, 0xcc6, 0xcd6, 0x0 },
+                  { 0x90, 0x6c, 0x74, 0x0 } },
+                { { 0xc95, 0xcc6, 0xcc2, 0x0 },
+                  { 0x90, 0x6c, 0x69, 0x0 } },
+                { { 0xc95, 0xcca, 0xcd5, 0x0 },
+                  { 0x90, 0x6c, 0x69, 0x73, 0x0 } },
 		{ {0}, {0} }
 	    };
 
@@ -816,8 +837,14 @@
 		  { 0x009e, 0x0 } },
 		{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
 		  { 0x009e, 0x0 } },
-
-
+                { { 0xd15, 0xd46, 0xd3e, 0x0 },
+                  { 0x5e, 0x34, 0x58, 0x0 } },
+                { { 0xd15, 0xd47, 0xd3e, 0x0 },
+                  { 0x5f, 0x34, 0x58, 0x0 } },
+                { { 0xd15, 0xd46, 0xd57, 0x0 },
+                  { 0x5e, 0x34, 0x65, 0x0 } },
+                { { 0xd15, 0xd57, 0x0 },
+                  { 0x34, 0x65, 0x0 } },
 		{ {0}, {0} }
 	    };
 
@@ -831,11 +858,74 @@
 	    QSKIP("couln't find AkrutiMal2", SkipAll);
 	}
     }
+    {
+        if (QFontDatabase().families(QFontDatabase::Malayalam).contains("Rachana")) {
+            QFont f("Rachana");
+            const ShapeTable shape_table [] = {
+                { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 },
+                  { 0x385, 0xa3, 0x0 } },
+                { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+                  { 0x2ff, 0x0 } },
+                { { 0xd33, 0xd4d, 0xd33, 0x0 },
+                  { 0x3f8, 0x0 } },
+                { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+                  { 0x2ff, 0x0 } },
+
+                { {0}, {0} }
+            };
+
+
+            const ShapeTable *s = shape_table;
+            while (s->unicode[0]) {
+                QVERIFY( shaping(f, s) );
+                ++s;
+            }
+        } else {
+            QSKIP("couln't find Rachana", SkipAll);
+        }
+    }
+
 #else
     QSKIP("X11 specific test", SkipAll);
 #endif
 }
 
+void tst_QTextScriptEngine::sinhala()
+{
+#if defined(Q_WS_X11)
+    {
+        if (QFontDatabase().families(QFontDatabase::Sinhala).contains("Malithi Web")) {
+            QFont f("Malithi Web");
+            const ShapeTable shape_table [] = {
+                { { 0xd9a, 0xdd9, 0xdcf, 0x0 },
+                  { 0x4a, 0x61, 0x42, 0x0 } },
+                { { 0xd9a, 0xdd9, 0xddf, 0x0 },
+                  { 0x4a, 0x61, 0x50, 0x0 } },
+                { { 0xd9a, 0xdd9, 0xdca, 0x0 },
+                  { 0x4a, 0x62, 0x0 } },
+                { { 0xd9a, 0xddc, 0xdca, 0x0 },
+                  { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+                { { 0xd9a, 0xdda, 0x0 },
+                  { 0x4a, 0x62, 0x0 } },
+                { { 0xd9a, 0xddd, 0x0 },
+                  { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+                { {0}, {0} }
+            };
+
+
+            const ShapeTable *s = shape_table;
+            while (s->unicode[0]) {
+                QVERIFY( shaping(f, s) );
+                ++s;
+            }
+        } else {
+            QSKIP("couln't find Malithi Web", SkipAll);
+        }
+    }
+#else
+    QSKIP("X11 specific test", SkipAll);
+#endif
+}
 
 
 void tst_QTextScriptEngine::khmer()