Merge branch 'master' of ssh://drop.maemo.org/git/mdictionary
[mdictionary] / trunk / tests / mDictionaryTests / tst_Backbone.cpp
index de754d2..38ef11e 100644 (file)
@@ -147,8 +147,10 @@ void BackboneTest::stopSearchingTest() {
         QCOMPARE(m->stopped, 0);
     }
 
+    back->search("");
     back->stopSearching();
 
+
     for(int i = 0; i < total; i++) {
         CommonDictInterfaceMock *m = (CommonDictInterfaceMock*)dict[i];
         QCOMPARE(m->stopped, 1);
@@ -177,6 +179,7 @@ void BackboneTest::searchTest() {
     back->_searchDicts = 1;
 
     back->search(list);
+    sleep(1);
 
 
     for(int i = 0; i < total; i++) {
@@ -196,14 +199,14 @@ void BackboneTest::translationTest() {
     QTime time;
     time.start();
     QString list("nic");
+    back->_searchBookmarks = 0;
+    back->_searchDicts = 1;
     back->search(list);
-    qDebug() << "Time for backbone.search: " << time.elapsed();
-    usleep(1000);
-    time.start();
+    sleep(2);
+    qDebug() << back->result().size() << total;
     back->translationReady();
-    qDebug() << "Time for backbone->translation: " << time.elapsed();
+    qDebug() << back->result().size() << total;
 
-    QVERIFY2(translatS.count() == 1, "Lost finall 'ready()' signal");
     QVERIFY2(back->result().size() == total*2, "Lost some of the translations");
 }
 
@@ -220,6 +223,7 @@ void BackboneTest::quitTest() {
         QCOMPARE(m->stopped, 0);
     }
 
+    back->search("");
     back->quit();
 
     for(int i = 0; i < total; i++) {
@@ -230,7 +234,7 @@ void BackboneTest::quitTest() {
 }
 
 void BackboneTest::historyTest() {
-    History* history = back->history();
+    History* history = new History(10,this);
 
     history->add("mleko");