logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp
changeset 6 41c0a814d878
parent 2 7119b73b84d6
child 8 6c9acdc6adc0
child 10 b04270301d3b
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp	Thu May 27 12:51:53 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp	Fri Jun 11 13:38:41 2010 +0300
@@ -70,6 +70,7 @@
     QVERIFY( mMatchesView->mActionMap.count() == 0 );
     QVERIFY( mMatchesView->mLayoutSectionName == "" );
     QVERIFY( !mMatchesView->mAddToContactsButton );
+    QCOMPARE( mMatchesView->mActivities.at(0), QString(logsActivityIdViewMatches) );
 }
 
 void UT_LogsMatchesView::testActivated()
@@ -104,23 +105,26 @@
     //Pass model as input arg
     LogsDbConnector* dbConnector = 0;
     LogsMatchesModel* model1 = new LogsMatchesModel(*dbConnector);
+    model1->resetLastCall();
     QVariant arg = qVariantFromValue( model1 );
     mMatchesView->activated( true, arg );
     QVERIFY( mMatchesView->mListView );
-    QVERIFY( mMatchesView->mModel == model1 );  
+    QVERIFY( mMatchesView->mModel == model1 );
+    QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
     
     LogsMatchesModel* model2 = new LogsMatchesModel(*dbConnector);
+    model2->resetLastCall();
     QVariant arg2 = qVariantFromValue( model2 );
     mMatchesView->activated( true, arg2 );
     QVERIFY( mMatchesView->mListView );
     QVERIFY( mMatchesView->mModel == model2 );
+    QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
     
     // After passing model as input arg, do not pass model
     mMatchesView->activated( true,QVariant() );
     QVERIFY( mMatchesView->mListView );
     QVERIFY( mMatchesView->mModel );
-    QVERIFY( mMatchesView->mModel != model1 );
-    QVERIFY( mMatchesView->mModel != model2 );
+    QVERIFY( mMatchesView->mModel->mLastCall == QLatin1String("constructor") );
 }