change in test
authorJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Thu, 2 Sep 2010 12:51:38 +0000 (14:51 +0200)
committerJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Thu, 2 Sep 2010 12:51:38 +0000 (14:51 +0200)
trunk/src/plugins/xdxf/src/xdxfplugin.cpp
trunk/src/plugins/xdxf/tests/test.cpp

index a876953..aa34ded 100644 (file)
@@ -309,14 +309,9 @@ DictDialog* XdxfPlugin::dictDialog() {
 
 
 CommonDictInterface* XdxfPlugin::getNew(const Settings *settings) const {
-
-    qDebug()<<"tu";
     XdxfPlugin *plugin = new XdxfPlugin();
-    qDebug()<<"tu2";
-    if(settings){
-            qDebug()<<"tu3";
+    if(settings)
         plugin->setSettings(settings);
-    }
     return  plugin;
 }
 
@@ -356,9 +351,7 @@ bool XdxfPlugin::isCached() {
 
 
 void XdxfPlugin::setSettings(const Settings *settings) {
-    qDebug()<<"tu4";
     if(settings) {
-        qDebug()<<"tu5";
         bool isPathChange=false;
         QString oldPath = _settings->value("path");
         if(oldPath != settings->value("path")) {
index f7bfed6..7397adc 100644 (file)
@@ -23,7 +23,7 @@
 #include <QSignalSpy>
 
 void XdxfTest::getNew() {
-
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -35,10 +35,11 @@ void XdxfTest::getNew() {
 
     xdxfPlugin->clean();
     delete xdxfPlugin;
+
 }
 
 void XdxfTest::searchFile() {
-
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -51,10 +52,12 @@ void XdxfTest::searchFile() {
 
     xdxfPlugin->clean();
     delete xdxfPlugin;
+
 }
 
 void XdxfTest::makeCache()
 {
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -66,9 +69,11 @@ void XdxfTest::makeCache()
 
     xdxfPlugin->clean();
     delete xdxfPlugin;
+
 }
 
 void XdxfTest::searchCache() {
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -83,9 +88,11 @@ void XdxfTest::searchCache() {
 
     xdxfPlugin->clean();
     delete xdxfPlugin;
+
 }
 
 void XdxfTest::searchWordListCache(){
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -128,10 +135,11 @@ void XdxfTest::searchWordListCache(){
 
     xdxfPlugin->clean();
     delete xdxfPlugin;
+
 }
 
 void XdxfTest::searchWordListFile() {
-
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -176,7 +184,7 @@ void XdxfTest::searchWordListFile() {
 }
 
 void XdxfTest::stop() {
-
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -195,6 +203,7 @@ void XdxfTest::stop() {
 
 
 void XdxfTest::langFrom() {
+    qDebug()<<"\n";
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
     settings->setValue("path","../tests/dict.xdxf");
@@ -208,6 +217,7 @@ void XdxfTest::langFrom() {
 }
 
 void XdxfTest::timeCache() {
+    qDebug()<<"\n";
     QTime timer;
     QDate date;
     QFile File("../tests/time.xml");
@@ -215,6 +225,10 @@ void XdxfTest::timeCache() {
         qDebug()<<"Error: could not open file";
         return;
     }
+    if(!QFile::exists("../../../../../../dict.xdxf")) {
+        qDebug()<<"Error: could not open dict file";
+        return;
+    }
     QTextStream out(&File);
     while(!out.atEnd())
         out.seek(out.pos()+1);
@@ -258,6 +272,7 @@ void XdxfTest::timeCache() {
 }
 
 void XdxfTest::timeFile() {
+    qDebug()<<"\n";
     QTime timer;
     QDate date;
     QFile File("../tests/time.xml");
@@ -265,12 +280,18 @@ void XdxfTest::timeFile() {
         qDebug()<<"Error: could not open file";
         return;
     }
+    if(!QFile::exists("../../../../../../dict.xdxf")) {
+        qDebug()<<"Error: could not open dict file";
+        return;
+    }
     QTextStream out(&File);
     while(!out.atEnd())
         out.seek(out.pos()+1);
 
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
+    if(!QFile::exists("../../../../../../dict.xdxf"))
+        return;
     settings->setValue("path","../../../../../../dict.xdxf");
     CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
     delete settings;
@@ -301,6 +322,7 @@ void XdxfTest::timeFile() {
 }
 
 void  XdxfTest::timeCacheNormalize() {
+    qDebug()<<"\n";
     QTime timer;
     QDate date;
     QFile File("../tests/time.xml");
@@ -308,6 +330,10 @@ void  XdxfTest::timeCacheNormalize() {
         qDebug()<<"Error: could not open file";
         return;
     }
+    if(!QFile::exists("../../../../../../dict.xdxf")) {
+        qDebug()<<"Error: could not open dict file";
+        return;
+    }
     QTextStream out(&File);
     while(!out.atEnd())
         out.seek(out.pos()+1);
@@ -315,6 +341,7 @@ void  XdxfTest::timeCacheNormalize() {
     timer.start();
     XdxfPlugin xdxfPluginB(this);
     Settings *settings=new Settings;
+
     settings->setValue("path","../../../../../../dict.xdxf");
     settings->setValue("generateCache", "true");
     settings->setValue("strip_accents", "true");
@@ -350,7 +377,7 @@ void  XdxfTest::timeCacheNormalize() {
 }
 
 void  XdxfTest::removeAccents() {
-
+    qDebug()<<"\n";
     XdxfPluginSub xdxf;
     xdxf.settings()->setValue(QString("strip_accents"), QString("true"));
 
@@ -368,6 +395,7 @@ void  XdxfTest::removeAccents() {
 }
 
 void XdxfTest::timeFileNormalize(){
+    qDebug()<<"\n";
     QTime timer;
     QDate date;
     QFile File("../tests/time.xml");
@@ -375,6 +403,10 @@ void XdxfTest::timeFileNormalize(){
         qDebug()<<"Error: could not open file";
         return;
     }
+    if(!QFile::exists("../../../../../../dict.xdxf")) {
+        qDebug()<<"Error: could not open dict file";
+        return;
+    }
     QTextStream out(&File);
     while(!out.atEnd())
         out.seek(out.pos()+1);