Fixed unit tests
[situare] / tests / map / friendgroupitem / testfriendgroupitem.cpp
index aa7847f..f579ce4 100644 (file)
@@ -48,12 +48,14 @@ private:
     FriendLocationItem *friend4;
     FriendGroupItem *group;
     QPixmap *pixmap;
+    QUrl url;
     MapScene scene;
 };
 
 void TestFriendGroupItem::initTestCase()
 {
     pixmap = new QPixmap("situare_user.gif");
+    url = QUrl("http://www.something.com/pict.png");
 }
 
 void TestFriendGroupItem::cleanupTestCase()
@@ -63,16 +65,24 @@ void TestFriendGroupItem::cleanupTestCase()
 
 void TestFriendGroupItem::init()
 {
+    QString userID("ABC123");
+
     // create test friends
-    friend1 = new FriendLocationItem(*pixmap, QPoint(0, 0), this);
-    friend2 = new FriendLocationItem(*pixmap, QPoint(0, 0), this);
-    friend3 = new FriendLocationItem(*pixmap, QPoint(0, 0), this);
-    friend4 = new FriendLocationItem(*pixmap, QPoint(0, 0), this);
+    friend1 = new FriendLocationItem(userID, this);
+    friend2 = new FriendLocationItem(userID, this);
+    friend3 = new FriendLocationItem(userID, this);
+    friend4 = new FriendLocationItem(userID, this);
     QVERIFY(friend1 != 0);
     QVERIFY(friend2 != 0);
     QVERIFY(friend3 != 0);
     QVERIFY(friend4 != 0);
 
+    // set pixmaps
+    friend1->setProfileImage(*pixmap, url);
+    friend2->setProfileImage(*pixmap, url);
+    friend3->setProfileImage(*pixmap, url);
+    friend4->setProfileImage(*pixmap, url);
+
     // add friends to scene
     scene.addItem(friend1);
     scene.addItem(friend2);