videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp
changeset 55 4bfa887905cf
parent 50 21fe8338c6bf
equal deleted inserted replaced
50:21fe8338c6bf 55:4bfa887905cf
   102 // cleanup
   102 // cleanup
   103 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   104 //
   104 //
   105 void TestVideoModel_p::cleanup()
   105 void TestVideoModel_p::cleanup()
   106 {
   106 {
       
   107     disconnect();
   107     if(mTestObject)
   108     if(mTestObject)
   108     {
   109     {
   109         delete mTestObject;
   110         delete mTestObject;
   110         mTestObject = 0;
   111         mTestObject = 0;
   111     }  
   112     }  
  1423     
  1424     
  1424     disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));  
  1425     disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));  
  1425 }
  1426 }
  1426 
  1427 
  1427 // -----------------------------------------------------------------------------
  1428 // -----------------------------------------------------------------------------
  1428 // testListCompleteSlot
  1429 // testVideoListCompleteSlot
  1429 // -----------------------------------------------------------------------------
  1430 // -----------------------------------------------------------------------------
  1430 //
  1431 //
  1431 void TestVideoModel_p::testListCompleteSlot()
  1432 void TestVideoModel_p::testVideoListCompleteSlot()
  1432 {
  1433 {
  1433     QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(videoListCompleteSlot())));
  1434     QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(videoListCompleteSlot())));
  1434     QSignalSpy spy(mStubModel, SIGNAL(modelReady()));
  1435     QSignalSpy modelReadySpy(mStubModel, SIGNAL(modelReady()));
       
  1436     QSignalSpy albumListReadySpy(mStubModel, SIGNAL(albumListReady()));
  1435     emit signalListCompleteSlot();
  1437     emit signalListCompleteSlot();
  1436     QCOMPARE(spy.count(), 1);
  1438     QCOMPARE(modelReadySpy.count(), 1);
  1437 }
  1439     QCOMPARE(albumListReadySpy.count(), 0);
  1438 
  1440 }
  1439 // -----------------------------------------------------------------------------
  1441 
  1440 // testalbumListCompleteSlot
  1442 // -----------------------------------------------------------------------------
  1441 // -----------------------------------------------------------------------------
  1443 // testAlbumListCompleteSlot
  1442 //
  1444 // -----------------------------------------------------------------------------
  1443 void TestVideoModel_p::testalbumListCompleteSlot()
  1445 //
       
  1446 void TestVideoModel_p::testAlbumListCompleteSlot()
  1444 {
  1447 {
  1445     QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(albumListCompleteSlot())));
  1448     QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(albumListCompleteSlot())));
  1446     QSignalSpy spy(mStubModel, SIGNAL(albumListReady()));
  1449     QSignalSpy modelReadySpy(mStubModel, SIGNAL(modelReady()));
       
  1450     QSignalSpy albumListReadySpy(mStubModel, SIGNAL(albumListReady()));
  1447     emit signalListCompleteSlot();
  1451     emit signalListCompleteSlot();
  1448     QCOMPARE(spy.count(), 1);
  1452     QCOMPARE(albumListReadySpy.count(), 1);
       
  1453     QCOMPARE(modelReadySpy.count(), 0);
  1449 }
  1454 }
  1450 
  1455 
  1451 // End of file
  1456 // End of file
  1452     
  1457     
  1453 
  1458