From 20d8a3982ae320035edd6a04b402cefc9a5e5779 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 28 Jun 2011 16:16:21 -0400 Subject: [PATCH] [test] Remove disabled code We'd add normalization and decomposition tests later. --- test/test-shape-complex.c | 92 --------------------------------------- 1 file changed, 92 deletions(-) diff --git a/test/test-shape-complex.c b/test/test-shape-complex.c index 92f4efcb0..f8dcb0ed1 100644 --- a/test/test-shape-complex.c +++ b/test/test-shape-complex.c @@ -65,98 +65,6 @@ typedef struct const test_data_t tests[]; } test_t; -#if 0 -static bool decomposedShaping(FT_Face face, HB_Script script, const QChar &ch) -{ - QString uc = QString().append(ch); - Shaper shaper(face, script, uc); - - uc = uc.normalized(QString::NormalizationForm_D); - Shaper decomposed(face, script, uc); - - if( shaper.shaper_item.num_glyphs != decomposed.shaper_item.num_glyphs ) - goto error; - - for (unsigned int i = 0; i < shaper.shaper_item.num_glyphs; ++i) { - if ((shaper.shaper_item.glyphs[i]&0xffffff) != (decomposed.shaper_item.glyphs[i]&0xffffff)) - goto error; - } - return true; - error: - QString str = ""; - int i = 0; - while (i < uc.length()) { - str += QString("%1 ").arg(uc[i].unicode(), 4, 16); - ++i; - } - qDebug("%s: decomposedShaping of char %4x failed\n decomposedString: %s\n nglyphs=%d, decomposed nglyphs %d", - face->family_name, - ch.unicode(), str.toLatin1().data(), - shaper.shaper_item.num_glyphs, - decomposed.shaper_item.num_glyphs); - - str = ""; - i = 0; - while (i < shaper.shaper_item.num_glyphs) { - str += QString("%1 ").arg(shaper.shaper_item.glyphs[i], 4, 16); - ++i; - } - qDebug(" composed glyph result = %s", str.toLatin1().constData()); - str = ""; - i = 0; - while (i < decomposed.shaper_item.num_glyphs) { - str += QString("%1 ").arg(decomposed.shaper_item.glyphs[i], 4, 16); - ++i; - } - qDebug(" decomposed glyph result = %s", str.toLatin1().constData()); - return false; -} - -struct shape_test_t { - unsigned short unicode[16]; - unsigned short glyphs[16]; -}; - -void tst_QScriptEngine::greek() -{ - "DejaVuSans.ttf", - if (face) { - for (int uc = 0x1f00; uc <= 0x1fff; ++uc) { - QString str; - str.append(uc); - if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { - /* qDebug() << "skipping" << hex << uc; */ - continue; - } - if (uc == 0x1fc1 || uc == 0x1fed) - continue; - QVERIFY( decomposedShaping(face, HB_Script_Greek, QChar(uc)) ); - } - FT_Done_Face(face); - } else { - QSKIP("couln't find DejaVu Sans", SkipAll); - } - - - face = loadFace("SBL_grk.ttf"); - if (face) { - for (int uc = 0x1f00; uc <= 0x1fff; ++uc) { - QString str; - str.append(uc); - if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { - /* qDebug() << "skipping" << hex << uc; */ - continue; - } - if (uc == 0x1fc1 || uc == 0x1fed) - continue; - QVERIFY( decomposedShaping(face, HB_Script_Greek, QChar(uc)) ); - - } - - }; -} -#endif - static const test_set_t tests_greek = { {"DejaVuSans.ttf", 0}, {