summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <shausman@rhea.troll.no>2007-02-16 13:13:04 +0100
committerSimon Hausmann <shausman@rhea.troll.no>2007-03-28 12:52:28 +0200
commitabf553a82732432e524998560adf156d809a0953 (patch)
tree1e31f11c6e67e9afc9e0bc3e0bd0519c6642437c /tests
parentfc0080075ea0c4117e4d5412bab96412948d30b5 (diff)
split out the unicode harfbuzz<>qt bindings into a separate file, to be used by
the shaper test
Diffstat (limited to 'tests')
-rw-r--r--tests/linebreaking/Makefile.am2
-rw-r--r--tests/linebreaking/harfbuzz-qt.cpp33
-rw-r--r--tests/linebreaking/main.cpp31
3 files changed, 34 insertions, 32 deletions
diff --git a/tests/linebreaking/Makefile.am b/tests/linebreaking/Makefile.am
index eaec07a..b710896 100644
--- a/tests/linebreaking/Makefile.am
+++ b/tests/linebreaking/Makefile.am
@@ -1,7 +1,7 @@
check_PROGRAMS = linebreaking
-linebreaking_SOURCES = main.cpp
+linebreaking_SOURCES = main.cpp harfbuzz-qt.cpp
linebreaking_LDADD = $(QT_GUI_LIBS) $(QT_QTEST_LIBS) ../../src/libharfbuzz-1.la
main.o: main.moc
diff --git a/tests/linebreaking/harfbuzz-qt.cpp b/tests/linebreaking/harfbuzz-qt.cpp
new file mode 100644
index 0000000..abd2073
--- /dev/null
+++ b/tests/linebreaking/harfbuzz-qt.cpp
@@ -0,0 +1,33 @@
+#include <harfbuzz-external.h>
+#include <Qt/private/qunicodetables_p.h>
+
+HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch)
+{
+#if QT_VERSION >= 0x040300
+ return (HB_LineBreakClass)QUnicodeTables::lineBreakClass(ch);
+#else
+#error "This test currently requires Qt >= 4.3"
+#endif
+}
+
+void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass)
+{
+ *category = (HB_CharCategory)QChar::category(ch);
+ *combiningClass = QChar::combiningClass(ch);
+}
+
+HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch)
+{
+ return (HB_CharCategory)QChar::category(ch);
+}
+
+int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch)
+{
+ return QChar::combiningClass(ch);
+}
+
+HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
+{
+ return QChar::mirroredChar(ch);
+}
+
diff --git a/tests/linebreaking/main.cpp b/tests/linebreaking/main.cpp
index 9377c49..838c122 100644
--- a/tests/linebreaking/main.cpp
+++ b/tests/linebreaking/main.cpp
@@ -14,40 +14,9 @@
*/
#include <QtTest/QtTest>
#include <QtCore/qdebug.h>
-#include <Qt/private/qunicodetables_p.h>
#include <harfbuzz-shaper.h>
-HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch)
-{
-#if QT_VERSION >= 0x040300
- return (HB_LineBreakClass)QUnicodeTables::lineBreakClass(ch);
-#else
-#error "This test currently requires Qt >= 4.3"
-#endif
-}
-
-void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass)
-{
- *category = (HB_CharCategory)QChar::category(ch);
- *combiningClass = QChar::combiningClass(ch);
-}
-
-HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch)
-{
- return (HB_CharCategory)QChar::category(ch);
-}
-
-int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch)
-{
- return QChar::combiningClass(ch);
-}
-
-HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
-{
- return QChar::mirroredChar(ch);
-}
-
static QVector<HB_CharAttributes> getCharAttributes(const QString &str)
{
QVector<HB_CharAttributes> attrs(str.length());