From: Piotrek Date: Mon, 30 Aug 2010 07:40:53 +0000 (+0200) Subject: Added some tests X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=204900635e718910def1d6c74be679c202633ab1;p=mdictionary Added some tests --- diff --git a/trunk/src/plugins/xdxf/tests/test.cpp b/trunk/src/plugins/xdxf/tests/test.cpp index 92662cd..cb6c8c5 100644 --- a/trunk/src/plugins/xdxf/tests/test.cpp +++ b/trunk/src/plugins/xdxf/tests/test.cpp @@ -277,15 +277,19 @@ void XdxfTest::timeFile() void XdxfTest::removeAccents() { - Cheat cheat; - cheat.settings()->setValue(QString("strip_accents"), QString("true")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("nóżka")), QString("nozka")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("motor")), QString("motor")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("nÓżKa")), QString("nozka")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("ławka")), QString("lawka")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("éàèùâêîôûëïüÿäöüç")), QString("eaeuaeioueiuyaouc")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("íőűúó")), QString("iouuo")); - QCOMPARE(cheat.getRemoveAccents(QString::fromUtf8("-ę")), QString("-e")); + XdxfPluginSub xdxf; + xdxf.settings()->setValue(QString("strip_accents"), QString("true")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("nóżka")), QString("nozka")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("motor")), QString("motor")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("nÓżKa")), QString("nozka")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("ławka")), QString("lawka")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("éàèùâêîôûëïüÿäöüç")), QString("eaeuaeioueiuyaouc")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("íőűúó")), QString("iouuo")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("-ę")), QString("-e")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("\"e\"")), QString("\"e\"")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("'e'")), QString("'e'")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("\\e")), QString("e")); + QCOMPARE(xdxf.getRemoveAccents(QString::fromUtf8("\\")), QString("")); } diff --git a/trunk/src/plugins/xdxf/tests/test.h b/trunk/src/plugins/xdxf/tests/test.h index 82a0f85..7a1f43b 100644 --- a/trunk/src/plugins/xdxf/tests/test.h +++ b/trunk/src/plugins/xdxf/tests/test.h @@ -52,16 +52,10 @@ void removeAccents(); }; - class Cheat : public XdxfPlugin + class XdxfPluginSub : public XdxfPlugin { public: - Cheat(QObject *parent = 0) : XdxfPlugin(parent){} - - QMap getLetters() - { - return letters; - } - + XdxfPluginSub(QObject *parent = 0) : XdxfPlugin(parent){} QString getRemoveAccents(QString s) { return removeAccents(s);