28 |
28 |
29 #include "unittest_mpcollectiondatamodel.h" |
29 #include "unittest_mpcollectiondatamodel.h" |
30 #include "unittest_helper.h" |
30 #include "unittest_helper.h" |
31 #include "stub/inc/mpcollectionalbumartmanager.h" |
31 #include "stub/inc/mpcollectionalbumartmanager.h" |
32 #include "stub/inc/mpmpxcollectiondata.h" |
32 #include "stub/inc/mpmpxcollectiondata.h" |
|
33 #include "stub/inc/mpplaybackdata.h" |
33 |
34 |
34 // Do this so we can access all member variables. |
35 // Do this so we can access all member variables. |
35 #define private public |
36 #define private public |
36 #include "mpcollectiondatamodel.h" |
37 #include "mpcollectiondatamodel.h" |
37 #undef private |
38 #undef private |
84 if ( translatorLoaded ) { |
87 if ( translatorLoaded ) { |
85 qApp->installTranslator(mMpTranslator); |
88 qApp->installTranslator(mMpTranslator); |
86 } |
89 } |
87 |
90 |
88 mStubData = new MpMpxCollectionData(); |
91 mStubData = new MpMpxCollectionData(); |
|
92 mStubPlaybackData = new MpPlaybackData(this); |
89 mHelper = new TestHelper(); |
93 mHelper = new TestHelper(); |
90 } |
94 } |
91 |
95 |
92 /*! |
96 /*! |
93 Called after the last testfunction was executed. |
97 Called after the last testfunction was executed. |
94 */ |
98 */ |
95 void TestMpCollectionDataModel::cleanupTestCase() |
99 void TestMpCollectionDataModel::cleanupTestCase() |
96 { |
100 { |
97 delete mStubData; |
101 delete mStubData; |
98 mStubData = 0; |
102 mStubData = 0; |
|
103 delete mStubPlaybackData; |
|
104 mStubPlaybackData = 0; |
99 delete mHelper; |
105 delete mHelper; |
100 mHelper = 0; |
106 mHelper = 0; |
101 } |
107 } |
102 |
108 |
103 /*! |
109 /*! |
104 Called before each testfunction is executed. |
110 Called before each testfunction is executed. |
105 */ |
111 */ |
106 void TestMpCollectionDataModel::init() |
112 void TestMpCollectionDataModel::init() |
107 { |
113 { |
108 mTest = new MpCollectionDataModel(mStubData); |
114 mTest = new MpCollectionDataModel(mStubData, mStubPlaybackData); |
109 MpMpxCollectionData::resetItemDataCounter(); |
115 MpMpxCollectionData::resetItemDataCounter(); |
110 mTest->mCollectionData->mItemDataReturn = true; |
116 mTest->mCollectionData->mItemDataReturn = true; |
111 mTest->mCollectionData->mCollectionTitleReturn = true; |
117 mTest->mCollectionData->mCollectionTitleReturn = true; |
112 } |
118 } |
113 |
119 |
964 QCOMPARE(mTest->mAlbumIndexOffset, 0); |
970 QCOMPARE(mTest->mAlbumIndexOffset, 0); |
965 mTest->mCollectionData->setContext(ECollectionContextPlaylistSongs); |
971 mTest->mCollectionData->setContext(ECollectionContextPlaylistSongs); |
966 QCOMPARE(mTest->mAlbumIndexOffset, 0); |
972 QCOMPARE(mTest->mAlbumIndexOffset, 0); |
967 } |
973 } |
968 |
974 |
|
975 /*! |
|
976 Tests fileCorrupted() |
|
977 */ |
|
978 void TestMpCollectionDataModel::testFileCorrupted() |
|
979 { |
|
980 |
|
981 |
|
982 } |
|
983 |
969 // End of file |
984 // End of file |