[test] Remove disabled code

We'd add normalization and decomposition tests later.
This commit is contained in:
Behdad Esfahbod 2011-06-28 16:16:21 -04:00
parent 9704f0ca6c
commit 20d8a3982a
1 changed files with 0 additions and 92 deletions

View File

@ -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},
{