--- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.cpp Tue Jul 06 14:15:47 2010 +0300
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.cpp Wed Aug 18 09:48:26 2010 +0300
@@ -62,33 +62,23 @@
{
QSignalSpy spyDataChanged(mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
- mModel->addParticipant(1,"Bubble-1",8,true);
- mModel->addParticipant(2,"Bubble-2",9,false);
- mModel->addParticipant(3,"Bubble-3",10,true);
+ mModel->addParticipant(1,"Bubble-1");
+ mModel->addParticipant(2,"Bubble-2");
+ mModel->addParticipant(3,"Bubble-3");
QVERIFY(mModel->rowCount()==3);
QVERIFY(spyDataChanged.count()==0);
// name changed
- mModel->addParticipant(2,"Bubble-Two",9,false);
+ mModel->addParticipant(2,"Bubble-Two");
QVERIFY(mModel->rowCount()==3);
QVERIFY(spyDataChanged.count()==1);
-
- // state changed
- mModel->addParticipant(2,"Bubble-Two",11,false);
- QVERIFY(mModel->rowCount()==3);
- QVERIFY(spyDataChanged.count()==2);
-
- // ciphering changed
- mModel->addParticipant(2,"Bubble-Two",11,true);
- QVERIFY(mModel->rowCount()==3);
- QVERIFY(spyDataChanged.count()==3);
}
void ut_BubbleParticipantListModel::test_removeParticipant()
{
- mModel->addParticipant(1,"Bubble-1",8,true);
- mModel->addParticipant(2,"Bubble-2",9,false);
- mModel->addParticipant(3,"Bubble-3",10,true);
+ mModel->addParticipant(1,"Bubble-1");
+ mModel->addParticipant(2,"Bubble-2");
+ mModel->addParticipant(3,"Bubble-3");
mModel->removeParticipant(2);
QVERIFY(mModel->rowCount()==2);
@@ -96,15 +86,15 @@
mModel->removeParticipant(3);
QVERIFY(mModel->rowCount()==1);
- mModel->addParticipant(2,"Bubble-2",9,false);
+ mModel->addParticipant(2,"Bubble-2");
QVERIFY(mModel->rowCount()==2);
}
void ut_BubbleParticipantListModel::test_bubbleId()
{
- mModel->addParticipant(1,"Bubble-1",8,true);
- mModel->addParticipant(2,"Bubble-2",9,false);
- mModel->addParticipant(3,"Bubble-3",10,true);
+ mModel->addParticipant(1,"Bubble-1");
+ mModel->addParticipant(2,"Bubble-2");
+ mModel->addParticipant(3,"Bubble-3");
QVERIFY(mModel->bubbleId(1)==2);
QVERIFY(mModel->bubbleId(4)==-1);
@@ -112,19 +102,16 @@
void ut_BubbleParticipantListModel::test_dataModel()
{
- mModel->addParticipant(1,"Bubble-1",8,true);
- mModel->addParticipant(2,"Bubble-2",9,false);
- mModel->addParticipant(3,"Bubble-3",10,true);
+ mModel->addParticipant(1,"Bubble-1");
+ mModel->addParticipant(2,"Bubble-2",Qt::ElideLeft);
+ mModel->addParticipant(3,"Bubble-3");
QModelIndex index = mModel->index(1,0);
- QVERIFY(index.data(Qt::DecorationRole).toInt()==9);
QVERIFY(index.data(Qt::DisplayRole).toString()=="Bubble-2");
- QVERIFY(index.data(Qt::StatusTipRole).toBool()==false);
- QVERIFY(index.data(Qt::UserRole).isNull());
+ QVERIFY(index.data(Qt::TextAlignmentRole).toInt()==Qt::ElideLeft);
- index = mModel->index(2,0);
- QVERIFY(index.data(Qt::StatusTipRole).toBool()==true);
+ QVERIFY(index.data(Qt::EditRole).isNull());
index = mModel->index(4,0);
QVERIFY(index.data(Qt::DisplayRole).isNull());