35
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Unit test for mpsongdata
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include <QSignalSpy>
|
|
18 |
#include <hbapplication.h>
|
|
19 |
#include <hbmainwindow.h>
|
|
20 |
#include <hbicon.h>
|
|
21 |
|
|
22 |
#include"unittest_mpsongdata.h"
|
|
23 |
#include "stub/inc/thumbnailmanager_qt.h"
|
|
24 |
|
|
25 |
// Do this so we can access all member variables.
|
|
26 |
#define private public
|
|
27 |
#include "mpsongdata.h"
|
|
28 |
#undef private
|
|
29 |
|
|
30 |
|
|
31 |
/*!
|
|
32 |
Make our test case a stand-alone executable that runs all the test functions.
|
|
33 |
*/
|
|
34 |
int main(int argc, char *argv[])
|
|
35 |
{
|
|
36 |
HbApplication app(argc, argv);
|
|
37 |
HbMainWindow window;
|
|
38 |
|
|
39 |
TestMpSongData tv;
|
|
40 |
|
|
41 |
if ( argc > 1 ) {
|
|
42 |
return QTest::qExec( &tv, argc, argv);
|
|
43 |
}
|
|
44 |
else {
|
|
45 |
char *pass[3];
|
|
46 |
pass[0] = argv[0];
|
|
47 |
pass[1] = "-o";
|
|
48 |
pass[2] = "c:\\data\\unittest_mpsongdata.txt";
|
|
49 |
|
|
50 |
return QTest::qExec(&tv, 3, pass);
|
|
51 |
}
|
|
52 |
}
|
|
53 |
|
|
54 |
//Constructor
|
|
55 |
TestMpSongData::TestMpSongData()
|
|
56 |
: mTest(0)
|
|
57 |
{
|
|
58 |
|
|
59 |
}
|
|
60 |
|
|
61 |
//Destructor
|
|
62 |
TestMpSongData::~TestMpSongData()
|
|
63 |
{
|
|
64 |
delete mTest;
|
|
65 |
}
|
|
66 |
|
|
67 |
/*!
|
|
68 |
Called before the first testfunction is executed.
|
|
69 |
*/
|
|
70 |
void TestMpSongData::initTestCase()
|
|
71 |
{
|
|
72 |
|
|
73 |
}
|
|
74 |
|
|
75 |
/*!
|
|
76 |
Called after the last testfunction was executed.
|
|
77 |
*/
|
|
78 |
void TestMpSongData::cleanupTestCase()
|
|
79 |
{
|
36
|
80 |
QCoreApplication::processEvents();
|
35
|
81 |
}
|
|
82 |
|
|
83 |
/*!
|
|
84 |
Called before each testfunction is executed.
|
|
85 |
*/
|
|
86 |
void TestMpSongData::init()
|
|
87 |
{
|
|
88 |
mTest = new MpSongData();
|
|
89 |
}
|
|
90 |
|
|
91 |
/*!
|
|
92 |
Called after every testfunction.
|
|
93 |
*/
|
|
94 |
void TestMpSongData::cleanup()
|
|
95 |
{
|
|
96 |
delete mTest;
|
|
97 |
mTest = 0;
|
|
98 |
}
|
|
99 |
|
|
100 |
/*!
|
|
101 |
Test correct cleanup of member variables.
|
|
102 |
*/
|
|
103 |
void TestMpSongData::testMemberCleanup()
|
|
104 |
{
|
|
105 |
cleanup();
|
|
106 |
ThumbnailManager::resetInitCounter();
|
|
107 |
init();
|
|
108 |
cleanup();
|
|
109 |
QCOMPARE( ThumbnailManager::getInitCounter(), 0 );
|
|
110 |
}
|
|
111 |
|
|
112 |
|
|
113 |
/*!
|
|
114 |
Test title()
|
|
115 |
*/
|
|
116 |
void TestMpSongData::testTitle()
|
|
117 |
{
|
|
118 |
mTest->mTitle = QString();
|
|
119 |
QVERIFY( mTest->title().isNull() == true );
|
|
120 |
|
|
121 |
QString title( "title" );
|
|
122 |
mTest->mTitle = title;
|
|
123 |
QVERIFY( mTest->title().isNull() == false );
|
|
124 |
QCOMPARE( mTest->title(), title );
|
|
125 |
}
|
|
126 |
|
|
127 |
/*!
|
|
128 |
Test album()
|
|
129 |
*/
|
|
130 |
void TestMpSongData::testAlbum()
|
|
131 |
{
|
|
132 |
mTest->mAlbum = QString();
|
|
133 |
QVERIFY( mTest->album().isNull() == true );
|
|
134 |
|
|
135 |
QString album( "album" );
|
|
136 |
mTest->mAlbum = album;
|
|
137 |
QVERIFY( mTest->album().isNull() == false );
|
|
138 |
QCOMPARE( mTest->album(), album );
|
|
139 |
}
|
|
140 |
|
|
141 |
/*!
|
|
142 |
Test artist()
|
|
143 |
*/
|
|
144 |
void TestMpSongData::testArtist()
|
|
145 |
{
|
|
146 |
mTest->mArtist = QString();
|
|
147 |
QVERIFY( mTest->artist().isNull() == true );
|
|
148 |
|
|
149 |
QString artist( "artist");
|
|
150 |
mTest->mArtist = artist;
|
|
151 |
QVERIFY( mTest->artist().isNull() == false );
|
|
152 |
QCOMPARE( mTest->artist(), artist );
|
|
153 |
}
|
|
154 |
|
|
155 |
/*!
|
|
156 |
Test comment()
|
|
157 |
*/
|
|
158 |
void TestMpSongData::testComment()
|
|
159 |
{
|
|
160 |
mTest->mComment = QString();
|
|
161 |
QVERIFY( mTest->comment().isNull() == true );
|
|
162 |
|
|
163 |
QString comment( "This is a nice song" );
|
|
164 |
mTest->mComment = comment;
|
|
165 |
QVERIFY( mTest->comment().isNull() == false );
|
|
166 |
QCOMPARE( mTest->comment(), comment );
|
|
167 |
}
|
|
168 |
|
|
169 |
/*!
|
|
170 |
Test albumArt()
|
|
171 |
*/
|
|
172 |
void TestMpSongData::testAlbumArt()
|
|
173 |
{
|
|
174 |
HbIcon dummyAlbumArt;
|
|
175 |
mTest->albumArt( dummyAlbumArt );
|
|
176 |
QVERIFY( dummyAlbumArt.isNull() == true );
|
|
177 |
|
|
178 |
HbIcon dummyAlbumArtTwo;
|
|
179 |
mTest->mAlbumArt = new HbIcon( ":/playbackviewicons/someAlbumArt.png" );
|
|
180 |
mTest->albumArt( dummyAlbumArtTwo );
|
|
181 |
QVERIFY( dummyAlbumArtTwo.isNull() == false );
|
|
182 |
}
|
|
183 |
|
|
184 |
/*!
|
|
185 |
Test year()
|
|
186 |
*/
|
|
187 |
void TestMpSongData::testYear()
|
|
188 |
{
|
|
189 |
mTest->mYear = QString();
|
|
190 |
QVERIFY( mTest->year().isNull() == true );
|
|
191 |
|
|
192 |
QString year("2000");
|
|
193 |
mTest->mYear = year;
|
|
194 |
QVERIFY( mTest->year().isNull() == false );
|
|
195 |
QCOMPARE( mTest->year(), year );
|
|
196 |
}
|
|
197 |
|
|
198 |
/*!
|
|
199 |
Test genre()
|
|
200 |
*/
|
|
201 |
void TestMpSongData::testGenre()
|
|
202 |
{
|
|
203 |
mTest->mGenre = QString();
|
|
204 |
QVERIFY( mTest->genre().isNull() == true );
|
|
205 |
|
|
206 |
QString genre( "pop" );
|
|
207 |
mTest->mGenre = genre;
|
|
208 |
QVERIFY( mTest->genre().isNull() == false );
|
|
209 |
QCOMPARE( mTest->genre(), genre );
|
|
210 |
}
|
|
211 |
|
|
212 |
/*!
|
|
213 |
Test composer()
|
|
214 |
*/
|
|
215 |
void TestMpSongData::testComposer()
|
|
216 |
{
|
|
217 |
mTest->mComposer = QString();
|
|
218 |
QVERIFY( mTest->composer().isNull() == true );
|
|
219 |
|
|
220 |
QString composer( "composer ");
|
|
221 |
mTest->mComposer = composer;
|
|
222 |
QVERIFY( mTest->composer().isNull() == false );
|
|
223 |
QCOMPARE( mTest->composer(), composer );
|
|
224 |
}
|
|
225 |
|
|
226 |
|
|
227 |
/*!
|
|
228 |
Test albumTrack()
|
|
229 |
*/
|
|
230 |
void TestMpSongData::testAlbumtrack()
|
|
231 |
{
|
|
232 |
mTest->mAlbumTrack = QString();
|
|
233 |
QVERIFY( mTest->albumTrack().isNull() == true );
|
|
234 |
|
|
235 |
QString albumTrack("2");
|
|
236 |
mTest->mAlbumTrack = albumTrack;
|
|
237 |
QVERIFY( mTest->albumTrack().isNull() == false );
|
|
238 |
QCOMPARE( mTest->albumTrack(), albumTrack );
|
|
239 |
}
|
|
240 |
|
|
241 |
/*!
|
|
242 |
Test link()
|
|
243 |
*/
|
|
244 |
void TestMpSongData::testLink()
|
|
245 |
{
|
|
246 |
mTest->mLink = QString();
|
|
247 |
QVERIFY( mTest->link().isNull() == true );
|
|
248 |
|
|
249 |
QString link( "www.nokia.com" );
|
|
250 |
mTest->mLink = link;
|
|
251 |
QVERIFY( mTest->link().isNull() == false );
|
|
252 |
QCOMPARE( mTest->link(), link );
|
|
253 |
}
|
|
254 |
|
|
255 |
/*!
|
|
256 |
Test fileName()
|
|
257 |
*/
|
|
258 |
void TestMpSongData::testFileName()
|
|
259 |
{
|
|
260 |
mTest->mFileName = QString();
|
|
261 |
QVERIFY( mTest->fileName().isNull() == true );
|
|
262 |
|
|
263 |
QString fileName( "test.mp3" );
|
|
264 |
mTest->mFileName = fileName;
|
|
265 |
QVERIFY( mTest->fileName().isNull() == false );
|
|
266 |
QCOMPARE( mTest->fileName(), fileName );
|
|
267 |
}
|
|
268 |
|
|
269 |
/*!
|
|
270 |
Test fileName()
|
|
271 |
*/
|
|
272 |
void TestMpSongData::testMimeType()
|
|
273 |
{
|
|
274 |
mTest->mMimeType = QString();
|
|
275 |
QVERIFY( mTest->mimeType().isNull() == true );
|
|
276 |
|
|
277 |
QString mimeType( "mp3" );
|
|
278 |
mTest->mMimeType = mimeType;
|
|
279 |
QVERIFY( mTest->mimeType().isNull() == false );
|
|
280 |
QCOMPARE( mTest->mimeType(), mimeType );
|
|
281 |
}
|
|
282 |
|
|
283 |
/*!
|
|
284 |
Test fileName()
|
|
285 |
*/
|
|
286 |
void TestMpSongData::testDuration()
|
|
287 |
{
|
|
288 |
mTest->mDuration = QString();
|
|
289 |
QVERIFY( mTest->duration().isNull() == true );
|
|
290 |
|
|
291 |
QString duration( "04:16" );
|
|
292 |
mTest->mDuration = duration;
|
|
293 |
QVERIFY( mTest->duration().isNull() == false );
|
|
294 |
QCOMPARE( mTest->duration(), duration );
|
|
295 |
}
|
|
296 |
|
|
297 |
/*!
|
|
298 |
Test bitRate()
|
|
299 |
*/
|
|
300 |
void TestMpSongData::testBitRate()
|
|
301 |
{
|
|
302 |
mTest->mBitRate = QString();
|
|
303 |
QVERIFY( mTest->bitRate().isNull() == true );
|
|
304 |
|
|
305 |
QString bitRate( "320 Kbps" );
|
|
306 |
mTest->mBitRate = bitRate;
|
|
307 |
QVERIFY( mTest->bitRate().isNull() == false );
|
|
308 |
QCOMPARE( mTest->bitRate(), bitRate );
|
|
309 |
}
|
|
310 |
|
|
311 |
/*!
|
|
312 |
Test sampleRate()
|
|
313 |
*/
|
|
314 |
void TestMpSongData::testSampleRate()
|
|
315 |
{
|
|
316 |
mTest->mSampleRate = QString();
|
|
317 |
QVERIFY( mTest->sampleRate().isNull() == true );
|
|
318 |
|
|
319 |
QString sampleRate( "44100 hz" );
|
|
320 |
mTest->mSampleRate = sampleRate;
|
|
321 |
QVERIFY( mTest->sampleRate().isNull() == false );
|
|
322 |
QCOMPARE( mTest->sampleRate(), sampleRate );
|
|
323 |
}
|
|
324 |
|
|
325 |
/*!
|
|
326 |
Test size()
|
|
327 |
*/
|
|
328 |
void TestMpSongData::testSize()
|
|
329 |
{
|
|
330 |
mTest->mSize = QString();
|
|
331 |
QVERIFY( mTest->size().isNull() == true );
|
|
332 |
|
|
333 |
QString size( "4.3MB" );
|
|
334 |
mTest->mSize = size;
|
|
335 |
QVERIFY( mTest->size().isNull() == false );
|
|
336 |
QCOMPARE( mTest->size(), size );
|
|
337 |
}
|
|
338 |
|
|
339 |
/*!
|
|
340 |
Test modified()
|
|
341 |
*/
|
|
342 |
void TestMpSongData::testModified()
|
|
343 |
{
|
|
344 |
mTest->mModified = QString();
|
|
345 |
QVERIFY( mTest->modified().isNull() == true );
|
|
346 |
|
|
347 |
QString modified( "5.7.2010 14:35:08" );
|
|
348 |
mTest->mModified = modified;
|
|
349 |
QVERIFY( mTest->modified().isNull() == false );
|
|
350 |
QCOMPARE( mTest->modified(), modified );
|
|
351 |
}
|
|
352 |
|
|
353 |
/*!
|
|
354 |
Test copyright()
|
|
355 |
*/
|
|
356 |
void TestMpSongData::testCopyright()
|
|
357 |
{
|
|
358 |
mTest->mCopyright = QString();
|
|
359 |
QVERIFY( mTest->copyright().isNull() == true );
|
|
360 |
|
|
361 |
QString copyright( "Copyright holder" );
|
|
362 |
mTest->mCopyright = copyright;
|
|
363 |
QVERIFY( mTest->copyright().isNull() == false );
|
|
364 |
QCOMPARE( mTest->copyright(), copyright );
|
|
365 |
}
|
|
366 |
|
|
367 |
/*!
|
|
368 |
Test musicURL()
|
|
369 |
*/
|
|
370 |
void TestMpSongData::testMusicURL()
|
|
371 |
{
|
|
372 |
mTest->mMusicURL = QString();
|
|
373 |
QVERIFY( mTest->musicURL().isNull() == true );
|
|
374 |
|
|
375 |
QString musicURL( "www.nokia.com" );
|
|
376 |
mTest->mMusicURL = musicURL;
|
|
377 |
QVERIFY( mTest->musicURL().isNull() == false );
|
|
378 |
QCOMPARE( mTest->musicURL(), musicURL );
|
|
379 |
}
|
|
380 |
|
|
381 |
/*!
|
|
382 |
Test isDrmProtected()
|
|
383 |
*/
|
|
384 |
void TestMpSongData::testIsDrmProtected()
|
|
385 |
{
|
|
386 |
mTest->mDrmProtected = true;
|
|
387 |
QVERIFY( mTest->isDrmProtected() == true );
|
|
388 |
|
|
389 |
mTest->mDrmProtected = false;
|
|
390 |
QVERIFY( mTest->isDrmProtected() == false );
|
|
391 |
}
|
|
392 |
|
|
393 |
/*!
|
|
394 |
Test setTitle()
|
|
395 |
*/
|
|
396 |
void TestMpSongData::testSetTitle()
|
|
397 |
{
|
|
398 |
bool result;
|
|
399 |
QString title( "title" );
|
|
400 |
mTest->mTitle = QString();
|
|
401 |
result = mTest->setTitle( title );
|
|
402 |
QCOMPARE( result, true );
|
|
403 |
QCOMPARE( mTest->title(), title );
|
|
404 |
|
|
405 |
result = false;
|
|
406 |
title = QString( "title" );
|
|
407 |
mTest->mTitle = QString( "titleTwo" );
|
|
408 |
result = mTest->setTitle( title );
|
|
409 |
QCOMPARE( result, true );
|
|
410 |
QCOMPARE( mTest->title(), title );
|
|
411 |
|
|
412 |
result = false;
|
|
413 |
title = QString();
|
|
414 |
mTest->mTitle = QString();
|
|
415 |
result = mTest->setTitle( title );
|
|
416 |
QCOMPARE( result, false );
|
|
417 |
QCOMPARE( mTest->title().isNull(), true );
|
|
418 |
|
|
419 |
result = false;
|
|
420 |
title = QString();
|
|
421 |
mTest->mTitle = QString( "titleTwo" );
|
|
422 |
result = mTest->setTitle( title );
|
|
423 |
QCOMPARE( result, true );
|
|
424 |
QCOMPARE( mTest->title().isNull(), true );
|
|
425 |
}
|
|
426 |
|
|
427 |
/*!
|
|
428 |
Test SetAlbum()
|
|
429 |
*/
|
|
430 |
void TestMpSongData::TestMpSongData::testSetAlbum()
|
|
431 |
{
|
|
432 |
bool result;
|
|
433 |
QString album( "album" );
|
|
434 |
mTest->mAlbum = QString();
|
|
435 |
result = mTest->setAlbum( album );
|
|
436 |
QCOMPARE( result, true );
|
|
437 |
QCOMPARE( mTest->album(), album );
|
|
438 |
|
|
439 |
result = false;
|
|
440 |
album = QString( "album" );
|
|
441 |
mTest->mAlbum = QString( "albumTwo" );
|
|
442 |
result = mTest->setAlbum( album );
|
|
443 |
QCOMPARE( result, true );
|
|
444 |
QCOMPARE( mTest->album(), album );
|
|
445 |
|
|
446 |
result = false;
|
|
447 |
album = QString();
|
|
448 |
mTest->mAlbum = QString();
|
|
449 |
result = mTest->setAlbum( album );
|
|
450 |
QCOMPARE( result, false );
|
|
451 |
QCOMPARE( mTest->album().isNull(), true );
|
|
452 |
|
|
453 |
result = false;
|
|
454 |
album = QString();
|
|
455 |
mTest->mAlbum = QString( "albumTwo" );
|
|
456 |
result = mTest->setAlbum( album );
|
|
457 |
QCOMPARE( result, true );
|
|
458 |
QCOMPARE( mTest->album().isNull(), true );
|
|
459 |
}
|
|
460 |
|
|
461 |
/*!
|
|
462 |
Test SetArtist()
|
|
463 |
*/
|
|
464 |
void TestMpSongData::testSetArtist()
|
|
465 |
{
|
|
466 |
bool result;
|
|
467 |
QString artist( "artist" );
|
|
468 |
mTest->mArtist = QString();
|
|
469 |
result = mTest->setArtist( artist );
|
|
470 |
QCOMPARE( result, true );
|
|
471 |
QCOMPARE( mTest->artist(), artist );
|
|
472 |
|
|
473 |
result = false;
|
|
474 |
artist = QString( "artist" );
|
|
475 |
mTest->mArtist = QString( "artistTwo" );
|
|
476 |
result = mTest->setArtist( artist );
|
|
477 |
QCOMPARE( result, true );
|
|
478 |
QCOMPARE( mTest->artist(), artist );
|
|
479 |
|
|
480 |
result = false;
|
|
481 |
artist = QString();
|
|
482 |
mTest->mArtist = QString();
|
|
483 |
result = mTest->setArtist( artist );
|
|
484 |
QCOMPARE( result, false );
|
|
485 |
QCOMPARE( mTest->artist().isNull(), true );
|
|
486 |
|
|
487 |
result = false;
|
|
488 |
artist = QString();
|
|
489 |
mTest->mArtist = QString( "artistTwo" );
|
|
490 |
result = mTest->setArtist( artist );
|
|
491 |
QCOMPARE( result, true );
|
|
492 |
QCOMPARE( mTest->artist().isNull(), true );
|
|
493 |
}
|
|
494 |
|
|
495 |
/*!
|
|
496 |
Test SetComment()
|
|
497 |
*/
|
|
498 |
void TestMpSongData::testSetComment()
|
|
499 |
{
|
|
500 |
bool result;
|
|
501 |
QString comment( "comment" );
|
|
502 |
mTest->mComment = QString();
|
|
503 |
result = mTest->setComment( comment );
|
|
504 |
QCOMPARE( result, true );
|
|
505 |
QCOMPARE( mTest->comment(), comment );
|
|
506 |
|
|
507 |
result = false;
|
|
508 |
comment = QString( "comment" );
|
|
509 |
mTest->mComment = QString( "commentTwo" );
|
|
510 |
result = mTest->setComment( comment );
|
|
511 |
QCOMPARE( result, true );
|
|
512 |
QCOMPARE( mTest->comment(), comment );
|
|
513 |
|
|
514 |
result = false;
|
|
515 |
comment = QString();
|
|
516 |
mTest->mComment = QString();
|
|
517 |
result = mTest->setComment( comment );
|
|
518 |
QCOMPARE( result, false );
|
|
519 |
QCOMPARE( mTest->comment().isNull(), true );
|
|
520 |
|
|
521 |
result = false;
|
|
522 |
comment = QString();
|
|
523 |
mTest->mComment = QString( "commentTwo" );
|
|
524 |
result = mTest->setComment( comment );
|
|
525 |
QCOMPARE( result, true );
|
|
526 |
QCOMPARE( mTest->comment().isNull(), true );
|
|
527 |
}
|
|
528 |
|
|
529 |
/*!
|
|
530 |
Test SetYear()
|
|
531 |
*/
|
|
532 |
void TestMpSongData::testSetYear()
|
|
533 |
{
|
|
534 |
bool result;
|
|
535 |
int year = 2010;
|
|
536 |
mTest->mYear = QString();
|
|
537 |
result = mTest->setYear( year );
|
|
538 |
QCOMPARE( result, true );
|
|
539 |
QCOMPARE( mTest->year(), QString::number( year ) );
|
|
540 |
|
|
541 |
result = false;
|
|
542 |
year = 2010;
|
|
543 |
mTest->mYear = QString::number( 2011 );
|
|
544 |
result = mTest->setYear( year );
|
|
545 |
QCOMPARE( result, true );
|
|
546 |
QCOMPARE( mTest->year(), QString::number( year ) );
|
|
547 |
|
|
548 |
result = false;
|
|
549 |
year = -1;
|
|
550 |
mTest->mYear = QString();
|
|
551 |
result = mTest->setYear( year );
|
|
552 |
QCOMPARE( result, true );
|
|
553 |
QCOMPARE( mTest->year().isNull(), true );
|
|
554 |
|
|
555 |
result = false;
|
|
556 |
year = -1;
|
|
557 |
mTest->mYear = QString::number( 2011 );
|
|
558 |
result = mTest->setYear( year );
|
|
559 |
QCOMPARE( result, true );
|
|
560 |
QCOMPARE( mTest->year().isNull(), true );
|
|
561 |
}
|
|
562 |
|
|
563 |
/*!
|
|
564 |
Test setGenre()
|
|
565 |
*/
|
|
566 |
void TestMpSongData::testSetGenre()
|
|
567 |
{
|
|
568 |
bool result;
|
|
569 |
QString genre( "genre" );
|
|
570 |
mTest->mGenre = QString();
|
|
571 |
result = mTest->setGenre( genre );
|
|
572 |
QCOMPARE( result, true );
|
|
573 |
QCOMPARE( mTest->genre(), genre );
|
|
574 |
|
|
575 |
result = false;
|
|
576 |
genre = QString( "genre" );
|
|
577 |
mTest->mGenre = QString( "genreTwo" );
|
|
578 |
result = mTest->setGenre( genre );
|
|
579 |
QCOMPARE( result, true );
|
|
580 |
QCOMPARE( mTest->genre(), genre );
|
|
581 |
|
|
582 |
result = false;
|
|
583 |
genre = QString();
|
|
584 |
mTest->mGenre = QString();
|
|
585 |
result = mTest->setGenre( genre );
|
|
586 |
QCOMPARE( result, false );
|
|
587 |
QCOMPARE( mTest->genre().isNull(), true );
|
|
588 |
|
|
589 |
result = false;
|
|
590 |
genre = QString();
|
|
591 |
mTest->mGenre = QString( "genreTwo" );
|
|
592 |
result = mTest->setGenre( genre );
|
|
593 |
QCOMPARE( result, true );
|
|
594 |
QCOMPARE( mTest->genre().isNull(), true );
|
|
595 |
}
|
|
596 |
|
|
597 |
/*!
|
|
598 |
Test setComposer()
|
|
599 |
*/
|
|
600 |
void TestMpSongData::testSetComposer()
|
|
601 |
{
|
|
602 |
bool result;
|
|
603 |
QString composer( "composer" );
|
|
604 |
mTest->mComposer = QString();
|
|
605 |
result = mTest->setComposer( composer );
|
|
606 |
QCOMPARE( result, true );
|
|
607 |
QCOMPARE( mTest->composer(), composer );
|
|
608 |
|
|
609 |
result = false;
|
|
610 |
composer = QString( "composer" );
|
|
611 |
mTest->mComposer = QString( "composerTwo" );
|
|
612 |
result = mTest->setComposer( composer );
|
|
613 |
QCOMPARE( result, true );
|
|
614 |
QCOMPARE( mTest->composer(), composer );
|
|
615 |
|
|
616 |
result = false;
|
|
617 |
composer = QString();
|
|
618 |
mTest->mComposer = QString();
|
|
619 |
result = mTest->setComposer( composer );
|
|
620 |
QCOMPARE( result, false );
|
|
621 |
QCOMPARE( mTest->composer().isNull(), true );
|
|
622 |
|
|
623 |
result = false;
|
|
624 |
composer = QString();
|
|
625 |
mTest->mComposer = QString( "composerTwo" );
|
|
626 |
result = mTest->setComposer( composer );
|
|
627 |
QCOMPARE( result, true );
|
|
628 |
QCOMPARE( mTest->composer().isNull(), true );
|
|
629 |
}
|
|
630 |
|
|
631 |
/*!
|
|
632 |
Test setAlbumTrack()
|
|
633 |
*/
|
|
634 |
void TestMpSongData::testSetAlbumTrack()
|
|
635 |
{
|
|
636 |
bool result;
|
|
637 |
QString albumTrack( "2" );
|
|
638 |
mTest->mAlbumTrack = QString();
|
|
639 |
result = mTest->setAlbumTrack( albumTrack );
|
|
640 |
QCOMPARE( result, true );
|
|
641 |
QCOMPARE( mTest->albumTrack(), albumTrack );
|
|
642 |
|
|
643 |
result = false;
|
|
644 |
albumTrack = QString( "2" );
|
|
645 |
mTest->mAlbumTrack = QString( "3" );
|
|
646 |
result = mTest->setAlbumTrack( albumTrack );
|
|
647 |
QCOMPARE( result, true );
|
|
648 |
QCOMPARE( mTest->albumTrack(), albumTrack );
|
|
649 |
|
|
650 |
result = false;
|
|
651 |
albumTrack = QString();
|
|
652 |
mTest->mAlbumTrack = QString();
|
|
653 |
result = mTest->setAlbumTrack( albumTrack );
|
|
654 |
QCOMPARE( result, false );
|
|
655 |
QCOMPARE( mTest->albumTrack().isNull(), true );
|
|
656 |
|
|
657 |
result = false;
|
|
658 |
albumTrack = QString();
|
|
659 |
mTest->mAlbumTrack = QString( "3" );
|
|
660 |
result = mTest->setAlbumTrack( albumTrack );
|
|
661 |
QCOMPARE( result, true );
|
|
662 |
QCOMPARE( mTest->albumTrack().isNull(), true );
|
|
663 |
}
|
|
664 |
|
|
665 |
/*!
|
|
666 |
Test setLink()
|
|
667 |
*/
|
|
668 |
void TestMpSongData::testSetLink()
|
|
669 |
{
|
|
670 |
QString link( "www.nokia.com" );
|
|
671 |
mTest->mLink = QString();
|
|
672 |
mTest->setLink( link );
|
|
673 |
QCOMPARE( mTest->link(), link );
|
|
674 |
|
|
675 |
link = QString( "www.nokia.com" );
|
|
676 |
mTest->mLink = QString( "www.nokia.fi" );
|
|
677 |
mTest->setLink( link );
|
|
678 |
QCOMPARE( mTest->link(), link );
|
|
679 |
|
|
680 |
link = QString();
|
|
681 |
mTest->mLink = QString();
|
|
682 |
mTest->setLink( link );
|
|
683 |
QCOMPARE( mTest->link().isNull(), true );
|
|
684 |
|
|
685 |
link = QString();
|
|
686 |
mTest->mLink = QString( "www.nokia.fi" );
|
|
687 |
mTest->setLink( link );
|
|
688 |
QCOMPARE( mTest->link().isNull(), true );
|
|
689 |
}
|
|
690 |
|
|
691 |
/*!
|
|
692 |
Test setFileName()
|
|
693 |
*/
|
|
694 |
void TestMpSongData::testSetFileName()
|
|
695 |
{
|
|
696 |
bool result;
|
|
697 |
QString fileName( "fileName" );
|
|
698 |
mTest->mFileName = QString();
|
|
699 |
result = mTest->setFileName( fileName );
|
|
700 |
QCOMPARE( result, true );
|
|
701 |
QCOMPARE( mTest->fileName(), fileName );
|
|
702 |
|
|
703 |
result = false;
|
|
704 |
fileName = QString( "fileName" );
|
|
705 |
mTest->mFileName = QString( "fileNameTwo" );
|
|
706 |
result = mTest->setFileName( fileName );
|
|
707 |
QCOMPARE( result, true );
|
|
708 |
QCOMPARE( mTest->fileName(), fileName );
|
|
709 |
|
|
710 |
result = false;
|
|
711 |
fileName = QString();
|
|
712 |
mTest->mFileName = QString();
|
|
713 |
result = mTest->setFileName( fileName );
|
|
714 |
QCOMPARE( result, false );
|
|
715 |
QCOMPARE( mTest->fileName().isNull(), true );
|
|
716 |
|
|
717 |
result = false;
|
|
718 |
fileName = QString();
|
|
719 |
mTest->mFileName = QString( "fileNameTwo" );
|
|
720 |
result = mTest->setFileName( fileName );
|
|
721 |
QCOMPARE( result, true );
|
|
722 |
QCOMPARE( mTest->fileName().isNull(), true );
|
|
723 |
}
|
|
724 |
|
|
725 |
/*!
|
|
726 |
Test setMimeType()
|
|
727 |
*/
|
|
728 |
void TestMpSongData::testSetMimeType()
|
|
729 |
{
|
|
730 |
bool result;
|
|
731 |
QString mimeType( "mimeType" );
|
|
732 |
mTest->mMimeType = QString();
|
|
733 |
result = mTest->setMimeType( mimeType );
|
|
734 |
QCOMPARE( result, true );
|
|
735 |
QCOMPARE( mTest->mimeType(), mimeType );
|
|
736 |
|
|
737 |
result = false;
|
|
738 |
mimeType = QString( "mimeType" );
|
|
739 |
mTest->mMimeType = QString( "mimeTypeTwo" );
|
|
740 |
result = mTest->setMimeType( mimeType );
|
|
741 |
QCOMPARE( result, true );
|
|
742 |
QCOMPARE( mTest->mimeType(), mimeType );
|
|
743 |
|
|
744 |
result = false;
|
|
745 |
mimeType = QString();
|
|
746 |
mTest->mMimeType = QString();
|
|
747 |
result = mTest->setMimeType( mimeType );
|
|
748 |
QCOMPARE( result, false );
|
|
749 |
QCOMPARE( mTest->mimeType().isNull(), true );
|
|
750 |
|
|
751 |
result = false;
|
|
752 |
mimeType = QString();
|
|
753 |
mTest->mMimeType = QString( "mimeTypeTwo" );
|
|
754 |
result = mTest->setMimeType( mimeType );
|
|
755 |
QCOMPARE( result, true );
|
|
756 |
QCOMPARE( mTest->mimeType().isNull(), true );
|
|
757 |
}
|
|
758 |
|
|
759 |
/*!
|
|
760 |
Test setDuration() // TODO: more cases to add here for different time interval
|
|
761 |
*/
|
|
762 |
void TestMpSongData::testSetDuration()
|
|
763 |
{
|
|
764 |
bool result;
|
|
765 |
int duration = 100;
|
|
766 |
mTest->mDuration = QString();
|
|
767 |
result = mTest->setDuration( duration );
|
|
768 |
QCOMPARE( result, true );
|
|
769 |
QCOMPARE( mTest->duration(), QString("01:40") );
|
|
770 |
|
|
771 |
result = false;
|
|
772 |
duration = 100;
|
|
773 |
mTest->mDuration = QString( "02:00" );
|
|
774 |
result = mTest->setDuration( duration );
|
|
775 |
QCOMPARE( result, true );
|
|
776 |
QCOMPARE( mTest->duration(), QString("01:40") );
|
|
777 |
|
|
778 |
result = false;
|
|
779 |
duration = -1;
|
|
780 |
mTest->mDuration = QString();
|
|
781 |
result = mTest->setDuration( duration );
|
|
782 |
QCOMPARE( result, true );
|
|
783 |
QCOMPARE( mTest->duration().isNull(), true );
|
|
784 |
|
|
785 |
result = false;
|
|
786 |
duration = -1;
|
|
787 |
mTest->mDuration = QString( "02:00" );
|
|
788 |
result = mTest->setDuration( duration );
|
|
789 |
QCOMPARE( result, true );
|
|
790 |
QCOMPARE( mTest->duration().isNull(), true );
|
|
791 |
}
|
|
792 |
|
|
793 |
/*!
|
|
794 |
Test setBitRate()
|
|
795 |
*/
|
|
796 |
void TestMpSongData::testSetBitRate()
|
|
797 |
{
|
|
798 |
bool result;
|
|
799 |
int bitRate = 302000;
|
|
800 |
mTest->mBitRate = QString();
|
|
801 |
result = mTest->setBitRate( bitRate );
|
|
802 |
QCOMPARE( result, true );
|
|
803 |
QCOMPARE( mTest->bitRate(), QString::number( bitRate / 1000 ) );
|
|
804 |
|
|
805 |
result = false;
|
|
806 |
bitRate = 302000;
|
|
807 |
mTest->mBitRate = QString::number( 412 );
|
|
808 |
result = mTest->setBitRate( bitRate );
|
|
809 |
QCOMPARE( result, true );
|
|
810 |
QCOMPARE( mTest->bitRate(), QString::number( bitRate / 1000 ) );
|
|
811 |
|
|
812 |
result = false;
|
|
813 |
bitRate = -1;
|
|
814 |
mTest->mBitRate = QString();
|
|
815 |
result = mTest->setBitRate( bitRate );
|
|
816 |
QCOMPARE( result, true );
|
|
817 |
QCOMPARE( mTest->bitRate().isNull(), true );
|
|
818 |
|
|
819 |
result = false;
|
|
820 |
bitRate = -1;
|
|
821 |
mTest->mBitRate = QString::number( 412 );
|
|
822 |
result = mTest->setBitRate( bitRate );
|
|
823 |
QCOMPARE( result, true );
|
|
824 |
QCOMPARE( mTest->bitRate().isNull(), true );
|
|
825 |
}
|
|
826 |
|
|
827 |
/*!
|
|
828 |
Test setSampleRate
|
|
829 |
*/
|
|
830 |
void TestMpSongData::testSetSampleRate()
|
|
831 |
{
|
|
832 |
bool result;
|
|
833 |
int sampleRate = 44100;
|
|
834 |
mTest->mSampleRate = QString();
|
|
835 |
result = mTest->setSampleRate( sampleRate );
|
|
836 |
QCOMPARE( result, true );
|
|
837 |
QCOMPARE( mTest->sampleRate(), QString::number( sampleRate ) );
|
|
838 |
|
|
839 |
result = false;
|
|
840 |
sampleRate = 44100;
|
|
841 |
mTest->mSampleRate = QString::number( 55000 );
|
|
842 |
result = mTest->setSampleRate( sampleRate );
|
|
843 |
QCOMPARE( result, true );
|
|
844 |
QCOMPARE( mTest->sampleRate(), QString::number( sampleRate ) );
|
|
845 |
|
|
846 |
result = false;
|
|
847 |
sampleRate = -1;
|
|
848 |
mTest->mSampleRate = QString();
|
|
849 |
result = mTest->setSampleRate( sampleRate );
|
|
850 |
QCOMPARE( result, true );
|
|
851 |
QCOMPARE( mTest->sampleRate().isNull(), true );
|
|
852 |
|
|
853 |
result = false;
|
|
854 |
sampleRate = -1;
|
|
855 |
mTest->mSampleRate = QString::number( 55000 );
|
|
856 |
result = mTest->setSampleRate( sampleRate );
|
|
857 |
QCOMPARE( result, true );
|
|
858 |
QCOMPARE( mTest->sampleRate().isNull(), true );
|
|
859 |
}
|
|
860 |
|
|
861 |
/*!
|
|
862 |
Test setSize
|
|
863 |
*/
|
|
864 |
void TestMpSongData::testSetSize()
|
|
865 |
{
|
|
866 |
bool result;
|
|
867 |
int size = 4300;
|
|
868 |
mTest->mSize = QString();
|
|
869 |
result = mTest->setSize( size );
|
|
870 |
QCOMPARE( result, true );
|
|
871 |
QCOMPARE( mTest->size(), QString::number( size / 1000 ) );
|
|
872 |
|
|
873 |
result = false;
|
|
874 |
size = 4300;
|
|
875 |
mTest->mSize = QString( "5" );
|
|
876 |
result = mTest->setSize( size );
|
|
877 |
QCOMPARE( result, true );
|
|
878 |
QCOMPARE( mTest->size(), QString::number( size / 1000 ) );
|
|
879 |
}
|
|
880 |
|
|
881 |
/*!
|
|
882 |
Test setModified
|
|
883 |
*/
|
|
884 |
void TestMpSongData::testSetModified()
|
|
885 |
{
|
|
886 |
bool result;
|
|
887 |
QString modified( "5.7.2010 14:35:08" );
|
|
888 |
mTest->mModified = QString();
|
|
889 |
result = mTest->setModified( modified );
|
|
890 |
QCOMPARE( result, true );
|
|
891 |
QCOMPARE( mTest->modified(), modified );
|
|
892 |
|
|
893 |
result = false;
|
|
894 |
modified = QString( "5.7.2010 14:35:08" );
|
|
895 |
mTest->mModified = QString( "9.7.2010 16:35:08" );
|
|
896 |
result = mTest->setModified( modified );
|
|
897 |
QCOMPARE( result, true );
|
|
898 |
QCOMPARE( mTest->modified(), modified );
|
|
899 |
|
|
900 |
result = false;
|
|
901 |
modified = QString();
|
|
902 |
mTest->mModified = QString();
|
|
903 |
result = mTest->setModified( modified );
|
|
904 |
QCOMPARE( result, false );
|
|
905 |
QCOMPARE( mTest->modified().isNull(), true );
|
|
906 |
|
|
907 |
result = false;
|
|
908 |
modified = QString();
|
|
909 |
mTest->mModified = QString( "9.7.2010 16:35:08" );
|
|
910 |
result = mTest->setModified( modified );
|
|
911 |
QCOMPARE( result, true );
|
|
912 |
QCOMPARE( mTest->modified().isNull(), true );
|
|
913 |
}
|
|
914 |
|
|
915 |
/*!
|
|
916 |
Test setCopyright
|
|
917 |
*/
|
|
918 |
void TestMpSongData::testSetCopyright()
|
|
919 |
{
|
|
920 |
bool result;
|
|
921 |
QString copyright( "copyright" );
|
|
922 |
mTest->mCopyright = QString();
|
|
923 |
result = mTest->setCopyright( copyright );
|
|
924 |
QCOMPARE( result, true );
|
|
925 |
QCOMPARE( mTest->copyright(), copyright );
|
|
926 |
|
|
927 |
result = false;
|
|
928 |
copyright = QString( "copyright" );
|
|
929 |
mTest->mCopyright = QString( "copyrightTwo" );
|
|
930 |
result = mTest->setCopyright( copyright );
|
|
931 |
QCOMPARE( result, true );
|
|
932 |
QCOMPARE( mTest->copyright(), copyright );
|
|
933 |
|
|
934 |
result = false;
|
|
935 |
copyright = QString();
|
|
936 |
mTest->mCopyright = QString();
|
|
937 |
result = mTest->setCopyright( copyright );
|
|
938 |
QCOMPARE( result, false );
|
|
939 |
QCOMPARE( mTest->copyright().isNull(), true );
|
|
940 |
|
|
941 |
result = false;
|
|
942 |
copyright = QString();
|
|
943 |
mTest->mCopyright = QString( "copyrightTwo" );
|
|
944 |
result = mTest->setCopyright( copyright );
|
|
945 |
QCOMPARE( result, true );
|
|
946 |
QCOMPARE( mTest->copyright().isNull(), true );
|
|
947 |
}
|
|
948 |
|
|
949 |
/*!
|
|
950 |
Test setMusicURL
|
|
951 |
*/
|
|
952 |
void TestMpSongData::testSetMusicURL()
|
|
953 |
{
|
|
954 |
bool result;
|
|
955 |
QString musicURL( "musicURL" );
|
|
956 |
mTest->mMusicURL = QString();
|
|
957 |
result = mTest->setMusicURL( musicURL );
|
|
958 |
QCOMPARE( result, true );
|
|
959 |
QCOMPARE( mTest->musicURL(), musicURL );
|
|
960 |
|
|
961 |
result = false;
|
|
962 |
musicURL = QString( "musicURL" );
|
|
963 |
mTest->mMusicURL = QString( "musicURLTwo" );
|
|
964 |
result = mTest->setMusicURL( musicURL );
|
|
965 |
QCOMPARE( result, true );
|
|
966 |
QCOMPARE( mTest->musicURL(), musicURL );
|
|
967 |
|
|
968 |
result = false;
|
|
969 |
musicURL = QString();
|
|
970 |
mTest->mMusicURL = QString();
|
|
971 |
result = mTest->setMusicURL( musicURL );
|
|
972 |
QCOMPARE( result, false );
|
|
973 |
QCOMPARE( mTest->musicURL().isNull(), true );
|
|
974 |
|
|
975 |
result = false;
|
|
976 |
musicURL = QString();
|
|
977 |
mTest->mMusicURL = QString( "musicURLTwo" );
|
|
978 |
result = mTest->setMusicURL( musicURL );
|
|
979 |
QCOMPARE( result, true );
|
|
980 |
QCOMPARE( mTest->musicURL().isNull(), true );
|
|
981 |
}
|
|
982 |
|
|
983 |
/*!
|
|
984 |
Test setDrmProtected
|
|
985 |
*/
|
|
986 |
void TestMpSongData::testSetDrmProtected()
|
|
987 |
{
|
|
988 |
bool result;
|
|
989 |
bool drmProtected = false;
|
|
990 |
mTest->mDrmProtected = true;
|
|
991 |
result = mTest->setDrmProtected( drmProtected );
|
|
992 |
QCOMPARE( result, true );
|
|
993 |
QCOMPARE( mTest->isDrmProtected(), false );
|
|
994 |
|
|
995 |
result = false;
|
|
996 |
drmProtected = false;
|
|
997 |
mTest->mDrmProtected = false;
|
|
998 |
result = mTest->setDrmProtected( drmProtected );
|
|
999 |
QCOMPARE( result, false );
|
|
1000 |
QCOMPARE( mTest->isDrmProtected(), false );
|
|
1001 |
|
|
1002 |
result = false;
|
|
1003 |
drmProtected = true;
|
|
1004 |
mTest->mDrmProtected = true;
|
|
1005 |
result = mTest->setDrmProtected( drmProtected);
|
|
1006 |
QCOMPARE( result, false );
|
|
1007 |
QCOMPARE( mTest->isDrmProtected(), true );
|
|
1008 |
|
|
1009 |
result = false;
|
|
1010 |
drmProtected = true;
|
|
1011 |
mTest->mDrmProtected = false;
|
|
1012 |
result = mTest->setDrmProtected( drmProtected );
|
|
1013 |
QCOMPARE( result, true );
|
|
1014 |
QCOMPARE( mTest->isDrmProtected(), true );
|
|
1015 |
}
|
|
1016 |
|
|
1017 |
|
|
1018 |
/*!
|
|
1019 |
Test setAlbumArtUri()
|
|
1020 |
*/
|
|
1021 |
void TestMpSongData::testSetAlbumArtUri()
|
|
1022 |
{
|
|
1023 |
const QString albumArtUri( "AlbumArt" );
|
|
1024 |
const QString albumArtUriEmpty( "" );
|
|
1025 |
|
|
1026 |
QSignalSpy spy( mTest, SIGNAL( albumArtReady() ) );
|
|
1027 |
|
|
1028 |
QVERIFY( spy.isValid() );
|
|
1029 |
QCOMPARE( spy.count(), 0 );
|
|
1030 |
|
|
1031 |
mTest->setAlbumArtUri( albumArtUri );
|
|
1032 |
QCOMPARE( spy.count(), 0 );
|
|
1033 |
|
|
1034 |
mTest->mThumbnailManager->mGetThumbFails = true;
|
|
1035 |
mTest->setAlbumArtUri( albumArtUri );
|
|
1036 |
QCOMPARE( spy.count(), 1 );
|
|
1037 |
QCOMPARE( mTest->mAlbumArt, mTest->mDefaultAlbumArt );
|
|
1038 |
|
|
1039 |
mTest->setAlbumArtUri( albumArtUriEmpty );
|
|
1040 |
QCOMPARE( spy.count(), 2 );
|
|
1041 |
QCOMPARE( mTest->mAlbumArt, mTest->mDefaultAlbumArt );
|
|
1042 |
}
|
|
1043 |
|
|
1044 |
/*!
|
|
1045 |
Test thumbnailReady()()
|
|
1046 |
*/
|
|
1047 |
void TestMpSongData::testThumbnailReady()
|
|
1048 |
{
|
|
1049 |
connect( this, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
|
|
1050 |
mTest->mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)) );
|
|
1051 |
|
|
1052 |
QSignalSpy spy(mTest, SIGNAL(albumArtReady()));
|
|
1053 |
QVERIFY( spy.isValid() );
|
|
1054 |
QCOMPARE( spy.count(), 0 );
|
|
1055 |
|
|
1056 |
QPixmap dummyAlbumArt(":/playbackviewicons/someAlbumArt.png" );
|
|
1057 |
|
|
1058 |
emit thumbnailReady(dummyAlbumArt, 0, -1, 0);
|
|
1059 |
QCOMPARE( spy.count(), 1 );
|
|
1060 |
HbIcon dummyAlbumArtCompare;
|
|
1061 |
mTest->albumArt(dummyAlbumArtCompare);
|
|
1062 |
QCOMPARE( dummyAlbumArtCompare.isNull(), false );
|
|
1063 |
|
|
1064 |
emit thumbnailReady(dummyAlbumArt, 0, -1 , 1);
|
|
1065 |
QCOMPARE( spy.count(), 2 );
|
|
1066 |
mTest->albumArt(dummyAlbumArtCompare);
|
|
1067 |
QCOMPARE( dummyAlbumArtCompare.isNull(), false );
|
|
1068 |
|
|
1069 |
}
|
|
1070 |
|
|
1071 |
|
|
1072 |
/*!
|
|
1073 |
Test commitPlaybackInfo()
|
|
1074 |
*/
|
|
1075 |
void TestMpSongData::testCommitPlaybackInfo()
|
|
1076 |
{
|
|
1077 |
QSignalSpy spy( mTest, SIGNAL( playbackInfoChanged() ) );
|
|
1078 |
|
|
1079 |
QVERIFY( spy.isValid() );
|
|
1080 |
QCOMPARE( spy.count(), 0 );
|
|
1081 |
|
|
1082 |
mTest->commitPlaybackInfo();
|
|
1083 |
QCOMPARE( spy.count(), 1 );
|
|
1084 |
|
|
1085 |
}
|
|
1086 |
|
|
1087 |
/*!
|
|
1088 |
Test commitSongDetailInfo()
|
|
1089 |
*/
|
|
1090 |
void TestMpSongData::testCommitSongDetailInfo()
|
|
1091 |
{
|
|
1092 |
QSignalSpy spy( mTest, SIGNAL( songDetailInfoChanged() ) );
|
|
1093 |
|
|
1094 |
QVERIFY( spy.isValid() );
|
|
1095 |
QCOMPARE( spy.count(), 0 );
|
|
1096 |
|
|
1097 |
mTest->commitSongDetailInfo();
|
|
1098 |
QCOMPARE( spy.count(), 1 );
|
|
1099 |
|
|
1100 |
}
|