Fixed unit test for FriendGroupItem bug_5831_group_release
authorSami Rämö <sami.ramo@ixonos.com>
Tue, 15 Jun 2010 13:33:12 +0000 (16:33 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Tue, 15 Jun 2010 13:33:12 +0000 (16:33 +0300)
   Reviewed by Pekka Nissinen

 - Changed image used in the test to current group item image

 - Chanded locations of items used in the tests to match
   bounding rects of the current items

tests/map/friendgroupitem/friend_group.png [new file with mode: 0755]
tests/map/friendgroupitem/situare_user.gif [deleted file]
tests/map/friendgroupitem/testfriendgroupitem.cpp

diff --git a/tests/map/friendgroupitem/friend_group.png b/tests/map/friendgroupitem/friend_group.png
new file mode 100755 (executable)
index 0000000..cbdcd1d
Binary files /dev/null and b/tests/map/friendgroupitem/friend_group.png differ
diff --git a/tests/map/friendgroupitem/situare_user.gif b/tests/map/friendgroupitem/situare_user.gif
deleted file mode 100644 (file)
index cd34a82..0000000
Binary files a/tests/map/friendgroupitem/situare_user.gif and /dev/null differ
index f579ce4..39494b4 100644 (file)
@@ -54,7 +54,7 @@ private:
 
 void TestFriendGroupItem::initTestCase()
 {
-    pixmap = new QPixmap("situare_user.gif");
+    pixmap = new QPixmap("friend_group.png");
     url = QUrl("http://www.something.com/pict.png");
 }
 
@@ -91,10 +91,11 @@ void TestFriendGroupItem::init()
 
     // override coordinate positions with scene pixel positions so testing is more
     // convenient
+    const int ITEM_SIDE = 58; // defined in baselocationitem.cpp
     friend1->setPos(100, 100);
-    friend2->setPos(100, 150);
-    friend3->setPos(150, 100);
-    friend4->setPos(150, 150);
+    friend2->setPos(friend1->pos() + QPoint(0, ITEM_SIDE)); // east from friend1
+    friend3->setPos(friend1->pos() + QPoint(ITEM_SIDE, 0)); // south from friend1
+    friend4->setPos(friend1->pos() + QPoint(ITEM_SIDE, ITEM_SIDE)); // south-east from friend1
 
     // create test group
     group = new FriendGroupItem(friend1);