Settings *settings=new Settings;
settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QList<Translation*> te6=xdxfPlugin->searchWordList("*",8);
QCOMPARE(te6.size(),8);
Settings *settings=new Settings;
settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QCOMPARE(xdxfPlugin->search("."), QString("<key>.</key><t>kropka</t>"));
QCOMPARE(xdxfPlugin->search("1"), QString("<key>1</key><t>one</t>"));
settings->setValue("path","../tests/dict.xdxf");
settings->setValue("generateCache", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
+
QCOMPARE(xdxfPlugin->settings()->value("cached"),tr("true"));
xdxfPlugin->clean();
settings->setValue("path","../tests/dict.xdxf");
settings->setValue("generateCache", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QCOMPARE(xdxfPlugin->settings()->value("cached"),tr("true"));
QCOMPARE(xdxfPlugin->search("."), QString("<key>.</key><t>kropka</t>"));
settings->setValue("path","../tests/dict.xdxf");
settings->setValue("generateCache", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QList<Translation*> te = xdxfPlugin->searchWordList(".", 10);
if(te.size()>0)
Settings *settings=new Settings;
settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QList<Translation*> te = xdxfPlugin->searchWordList(".", 10);
if(te.size()>0)
Settings *settings=new Settings;
settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QString string("*");
QFuture<QList<Translation*> > future = QtConcurrent::run(xdxfPlugin,
void XdxfTest::langFrom() {
-
XdxfPlugin xdxfPluginB(this);
Settings *settings=new Settings;
settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
QCOMPARE(xdxfPlugin->langFrom(), QString("ENG"));
settings->setValue("path","../../../../../../dict.xdxf");
settings->setValue("generateCache", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
out<<"\n<date>" + date.currentDate().toString("dd.MM.yyyy") +" ";
out<<timer.currentTime().toString(Qt::TextDate) + "</date>";
Settings *settings=new Settings;
settings->setValue("path","../../../../../../dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
timer.start();
xdxfPlugin->search("Bantu");
settings->setValue("generateCache", "true");
settings->setValue("strip_accents", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
out<<"\n<type> Cache with strip accent </type> <time>" << timer.elapsed();
out<<"</time>";
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"));
settings->setValue("path","../../../../../../dict.xdxf");
settings->setValue("strip_accents", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
+ delete settings;
timer.start();
xdxfPlugin->search("Bantu");
File.close();
xdxfPlugin->clean();
delete xdxfPlugin;
-
}
QTEST_MAIN(XdxfTest)