settings->setValue("path","../tests/dict.xdxf");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
- QCOMPARE(xdxfPlugin->search("."), QString("<t>kropka</t>"));
- QCOMPARE(xdxfPlugin->search("1"), QString("<t>one</t>"));
- QCOMPARE(xdxfPlugin->search("test"), QString("<t><c c=\"FF00FF\">kro</c>test01<pos>krowa</pos></t>"));
+ QCOMPARE(xdxfPlugin->search("."), QString("<key>.</key><t>kropka</t>"));
+ QCOMPARE(xdxfPlugin->search("1"), QString("<key>1</key><t>one</t>"));
+ QCOMPARE(xdxfPlugin->search("test"), QString("<key>test</key><t><c c=\"FF00FF\">kro</c>test01<pos>krowa</pos></t>"));
}
void XdxfTest::makeCache()
settings->setValue("generateCache", "true");
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
QCOMPARE(xdxfPlugin->settings()->value("cached"),tr("true"));
+ delete xdxfPlugin;
}
void XdxfTest::searchCache() {
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
QCOMPARE(xdxfPlugin->settings()->value("cached"),tr("true"));
- QCOMPARE(xdxfPlugin->search("."), QString("<t>kropka</t>"));
- QCOMPARE(xdxfPlugin->search("1"), QString("<t>one</t>"));
- QCOMPARE(xdxfPlugin->search("test"), QString("<t><c c=\"FF00FF\">kro</c>test01<pos>krowa</pos></t>"));
+ QCOMPARE(xdxfPlugin->search("."), QString("<key>.</key><t>kropka</t>"));
+ QCOMPARE(xdxfPlugin->search("1"), QString("<key>1</key><t>one</t>"));
+ QCOMPARE(xdxfPlugin->search("test"), QString("<key>test</key><t><c c=\"FF00FF\">kro</c>test01<pos>krowa</pos></t>"));
+
+ delete xdxfPlugin;
}
void XdxfTest::searchWordListCache(){
QList<Translation*> te11 = xdxfPlugin->searchWordList("h**?*?**e");
QCOMPARE(te11.at(0)->key(), QString("house"));
+
+ delete xdxfPlugin;
}
void XdxfTest::searchWordListFile() {
QList<Translation*> te11 = xdxfPlugin->searchWordList("h**?*?**e");
QCOMPARE(te11.at(0)->key(), QString("house"));
+ delete xdxfPlugin;
}
void XdxfTest::stop() {
QFuture<QList<Translation*> > future = QtConcurrent::run(xdxfPlugin, &CommonDictInterface::searchWordList, string, 10);
QList<Translation*> te5 = future.result();
QCOMPARE(te5.size(), 9);
+
+ delete xdxfPlugin;
}
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
QCOMPARE(xdxfPlugin->langFrom(), QString("ENG"));
+
+ delete xdxfPlugin;
}
QTEST_MAIN(XdxfTest)