|
1 /* |
|
2 * Copyright (c) 2009 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 mpengine |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QSignalSpy> |
|
19 #include <EqualizerConstants.h> |
|
20 |
|
21 #include "unittest_mpengine.h" |
|
22 #include "mpmediakeyhandler.h" |
|
23 #include "mpmpxcollectionviewdefs.h" |
|
24 |
|
25 #define private public |
|
26 #include "mpengine.h" |
|
27 #undef private |
|
28 |
|
29 // help to test private function |
|
30 #include "../../src/mpengine.cpp" |
|
31 |
|
32 /*! |
|
33 Make our test case a stand-alone executable that runs all the test functions. |
|
34 */ |
|
35 int main(int argc, char *argv[]) |
|
36 { |
|
37 QApplication app(argc, argv); |
|
38 |
|
39 TestMpEngine 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_mpengine.txt"; |
|
49 |
|
50 return QTest::qExec(&tv, 3, pass); |
|
51 } |
|
52 } |
|
53 |
|
54 TestMpEngine::TestMpEngine() |
|
55 : mTest(0) |
|
56 { |
|
57 } |
|
58 |
|
59 TestMpEngine::~TestMpEngine() |
|
60 { |
|
61 delete mTest; |
|
62 } |
|
63 |
|
64 /*! |
|
65 Called before the first testfunction is executed. |
|
66 */ |
|
67 void TestMpEngine::initTestCase() |
|
68 { |
|
69 } |
|
70 |
|
71 /*! |
|
72 Called after the last testfunction was executed. |
|
73 */ |
|
74 void TestMpEngine::cleanupTestCase() |
|
75 { |
|
76 MpEngineFactory::close(); |
|
77 } |
|
78 |
|
79 /*! |
|
80 Called before each testfunction is executed. |
|
81 */ |
|
82 void TestMpEngine::init() |
|
83 { |
|
84 |
|
85 } |
|
86 |
|
87 /*! |
|
88 Called after every testfunction. |
|
89 */ |
|
90 void TestMpEngine::cleanup() |
|
91 { |
|
92 |
|
93 } |
|
94 |
|
95 /*! |
|
96 test initialize |
|
97 */ |
|
98 void TestMpEngine::testInitialize() |
|
99 { |
|
100 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
101 QVERIFY( mTest->mSongData != 0 ); |
|
102 QVERIFY( mTest->mMpxHarvesterWrapper != 0 ); |
|
103 QVERIFY( mTest->mMpxCollectionWrapper != 0 ); |
|
104 QVERIFY( mTest->mEqualizerWrapper != 0 ); |
|
105 QVERIFY( mTest->mMpxPlaybackWrapper != 0 ); |
|
106 QVERIFY( mTest->mAudioEffectsWrapper != 0 ); |
|
107 |
|
108 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::Fetch ); |
|
109 QVERIFY( mTest->mMpxHarvesterWrapper != 0 ); |
|
110 QVERIFY( mTest->mMpxCollectionWrapper != 0 ); |
|
111 QVERIFY( mTest->mMpxPlaybackWrapper != 0 ); |
|
112 QVERIFY( mTest->mEqualizerWrapper == 0 ); |
|
113 QVERIFY( mTest->mAudioEffectsWrapper == 0 ); |
|
114 |
|
115 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::MediaBrowsing ); |
|
116 QVERIFY( mTest->mMpxCollectionWrapper != 0 ); |
|
117 QVERIFY( mTest->mMpxHarvesterWrapper == 0 ); |
|
118 QVERIFY( mTest->mMpxPlaybackWrapper == 0 ); |
|
119 QVERIFY( mTest->mEqualizerWrapper == 0 ); |
|
120 QVERIFY( mTest->mAudioEffectsWrapper == 0 ); |
|
121 |
|
122 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::Embedded ); |
|
123 QVERIFY( mTest->mMpxPlaybackWrapper != 0 ); |
|
124 QVERIFY( mTest->mSongData != 0 ); |
|
125 } |
|
126 |
|
127 /*! |
|
128 test verifyUsbBlocking |
|
129 */ |
|
130 void TestMpEngine::testVerifyUsbBlocking() |
|
131 { |
|
132 bool result; |
|
133 QSignalSpy spy( mTest, SIGNAL( unableToCotinueDueUSB() ) ); |
|
134 |
|
135 mTest->mUsbBlockingState = MpEngine::USB_Connected; |
|
136 result = mTest->verifyUsbBlocking( true ); |
|
137 QVERIFY( result == true ); |
|
138 QVERIFY( spy.count() == 1 ); |
|
139 spy.clear(); |
|
140 |
|
141 mTest->mUsbBlockingState = MpEngine::USB_Connected; |
|
142 result = mTest->verifyUsbBlocking( false ); |
|
143 QVERIFY( result == true ); |
|
144 QVERIFY( spy.count() == 0 ); |
|
145 spy.clear(); |
|
146 |
|
147 mTest->mUsbBlockingState = MpEngine::USB_NotConnected; |
|
148 result = mTest->verifyUsbBlocking( true ); |
|
149 QVERIFY( result == false ); |
|
150 QVERIFY( spy.count() == 0 ); |
|
151 spy.clear(); |
|
152 |
|
153 mTest->mUsbBlockingState = MpEngine::USB_NotConnected; |
|
154 result = mTest->verifyUsbBlocking( false ); |
|
155 QVERIFY( result == false ); |
|
156 QVERIFY( spy.count() == 0 ); |
|
157 spy.clear(); |
|
158 |
|
159 mTest->mUsbBlockingState = MpEngine::USB_Synchronizing; |
|
160 result = mTest->verifyUsbBlocking( true ); |
|
161 QVERIFY( result == false ); |
|
162 QVERIFY( spy.count() == 0 ); |
|
163 spy.clear(); |
|
164 |
|
165 mTest->mUsbBlockingState = MpEngine::USB_Synchronizing; |
|
166 result = mTest->verifyUsbBlocking( false ); |
|
167 QVERIFY( result == false ); |
|
168 QVERIFY( spy.count() == 0 ); |
|
169 spy.clear(); |
|
170 } |
|
171 |
|
172 /*! |
|
173 test songScanner |
|
174 */ |
|
175 void TestMpEngine::testSongScanner() |
|
176 { |
|
177 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
178 QCOMPARE( mTest->mSongScanner, mTest->songScanner() ); |
|
179 } |
|
180 |
|
181 /*! |
|
182 test refreshLibrary |
|
183 */ |
|
184 void TestMpEngine::testRefreshLibrary() |
|
185 { |
|
186 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
187 QSignalSpy spy( mTest, SIGNAL( libraryAboutToUpdate() ) ); |
|
188 |
|
189 mTest->mUsbBlockingState = MpEngine::USB_Connected; |
|
190 QVERIFY( mTest->verifyUsbBlocking() == true ); |
|
191 mTest->refreshLibrary( true ); |
|
192 QVERIFY( mTest->mSongScanner == 0 ); |
|
193 QVERIFY( spy.count() == 0 ); |
|
194 |
|
195 mTest->mUsbBlockingState = MpEngine::USB_NotConnected; |
|
196 QVERIFY( mTest->verifyUsbBlocking() == false ); |
|
197 mTest->refreshLibrary( true ); |
|
198 QVERIFY( mTest->mSongScanner != 0 ); |
|
199 QVERIFY( spy.count() == 1 ); |
|
200 spy.clear(); |
|
201 |
|
202 mTest->mUsbBlockingState = MpEngine::USB_Synchronizing; |
|
203 QVERIFY( mTest->verifyUsbBlocking() == false ); |
|
204 mTest->refreshLibrary( true ); |
|
205 QVERIFY( mTest->mSongScanner != 0 ); |
|
206 QVERIFY( spy.count() == 1 ); |
|
207 spy.clear(); |
|
208 } |
|
209 |
|
210 /*! |
|
211 test handleScanStarted |
|
212 */ |
|
213 void TestMpEngine::testHandleScanStarted() |
|
214 { |
|
215 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
216 mTest->handleScanStarted(); |
|
217 QVERIFY( mTest->mHandleMediaCommands == false ); |
|
218 } |
|
219 |
|
220 /*! |
|
221 test handleScanEnded |
|
222 */ |
|
223 void TestMpEngine::testHandleScanEnded() |
|
224 { |
|
225 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
226 QSignalSpy spy( mTest, SIGNAL( libraryUpdated() ) ); |
|
227 |
|
228 mTest->handleScanEnded( 0, 0 ); |
|
229 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
230 |
|
231 QVERIFY( spy.count() == 1 ); |
|
232 spy.clear(); |
|
233 } |
|
234 |
|
235 /*! |
|
236 test handleDiskEvent |
|
237 */ |
|
238 void TestMpEngine::testHandleDiskEvent() |
|
239 { |
|
240 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
241 QSignalSpy spy( mTest, SIGNAL( libraryUpdated() ) ); |
|
242 QSignalSpy spyTwo( mTest, SIGNAL( libraryAboutToUpdate() ) ); |
|
243 |
|
244 mTest->handleDiskEvent( DiskFormatStarted ); |
|
245 QVERIFY( mTest->mHandleMediaCommands == false ); |
|
246 |
|
247 mTest->handleDiskEvent( DiskFormatEnded ); |
|
248 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
249 |
|
250 mTest->mUsbBlockingState = MpEngine::USB_Synchronizing; |
|
251 mTest->handleDiskEvent( DiskRemoved ); |
|
252 QVERIFY( spy.count() == 0 ); |
|
253 spy.clear(); |
|
254 |
|
255 mTest->mUsbBlockingState = MpEngine::USB_NotConnected; |
|
256 mTest->handleDiskEvent( DiskRemoved ); |
|
257 QVERIFY( spy.count() == 1 ); |
|
258 spy.clear(); |
|
259 |
|
260 mTest->mUsbBlockingState = MpEngine::USB_Connected; |
|
261 mTest->handleDiskEvent( DiskRemoved ); |
|
262 QVERIFY( spy.count() == 1 ); |
|
263 spy.clear(); |
|
264 |
|
265 mTest->mUsbBlockingState = MpEngine::USB_NotConnected; |
|
266 mTest->handleDiskEvent( DiskInserted ); |
|
267 QVERIFY( mTest->verifyUsbBlocking() == false ); |
|
268 QVERIFY( spyTwo.count() == 1 ); |
|
269 spyTwo.clear(); |
|
270 |
|
271 mTest->mUsbBlockingState = MpEngine::USB_Connected; |
|
272 mTest->handleDiskEvent( DiskInserted ); |
|
273 QVERIFY( spy.count() == 1 ); |
|
274 spy.clear(); |
|
275 } |
|
276 |
|
277 /*! |
|
278 test HandleUsbEvent |
|
279 */ |
|
280 void TestMpEngine::testHandleUsbEvent() |
|
281 { |
|
282 // no need to test here |
|
283 } |
|
284 |
|
285 /*! |
|
286 test handleUsbMassStorageStartEvent |
|
287 */ |
|
288 void TestMpEngine::testHandleUsbMassStorageStartEvent() |
|
289 { |
|
290 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
291 QSignalSpy spy( mTest, SIGNAL( usbBlocked( bool ) ) ); |
|
292 QSignalSpy spyTwo( mTest, SIGNAL( usbSynchronizationStarted() ) ); |
|
293 |
|
294 mTest->handleUsbMassStorageStartEvent(); |
|
295 QVERIFY( mTest->mHandleMediaCommands == false ); |
|
296 QVERIFY( spy.count() == 1 ); |
|
297 QList<QVariant> arguments = spy.takeFirst(); |
|
298 QVERIFY( arguments.at(0).toBool() == true ); |
|
299 |
|
300 QVERIFY( spyTwo.count() == 1 ); |
|
301 } |
|
302 |
|
303 /*! |
|
304 test handleUsbMassStorageEndEvent |
|
305 */ |
|
306 void TestMpEngine::testHandleUsbMassStorageEndEvent() |
|
307 { |
|
308 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
309 QSignalSpy spy( mTest, SIGNAL( usbBlocked( bool ) ) ); |
|
310 QSignalSpy spyTwo( mTest, SIGNAL( usbSynchronizationFinished() ) ); |
|
311 |
|
312 mTest->handleUsbMassStorageEndEvent(); |
|
313 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
314 QVERIFY( spy.count() == 1 ); |
|
315 QList<QVariant> arguments = spy.takeFirst(); |
|
316 QVERIFY(arguments.at(0).toBool() == false ); |
|
317 |
|
318 QVERIFY( spyTwo.count() == 1 ); |
|
319 } |
|
320 |
|
321 /*! |
|
322 test handleUsbMtpStartEvent |
|
323 */ |
|
324 void TestMpEngine::testHandleUsbMtpStartEvent() |
|
325 { |
|
326 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
327 QSignalSpy spy( mTest, SIGNAL( usbBlocked( bool ) ) ); |
|
328 QSignalSpy spyTwo( mTest, SIGNAL( libraryAboutToUpdate() ) ); |
|
329 QSignalSpy spyThree( mTest, SIGNAL( usbSynchronizationStarted() ) ); |
|
330 |
|
331 mTest->handleUsbMtpStartEvent(); |
|
332 QVERIFY( mTest->mHandleMediaCommands == false ); |
|
333 QVERIFY( spy.count() == 1 ); |
|
334 QList<QVariant> arguments = spy.takeFirst(); |
|
335 QVERIFY( arguments.at(0).toBool() == true ); |
|
336 QVERIFY( spyTwo.count() == 1 ); |
|
337 QVERIFY( spyThree.count() == 1 ); |
|
338 } |
|
339 |
|
340 /*! |
|
341 test handleUsbMtpEndEvent |
|
342 */ |
|
343 void TestMpEngine::testHandleUsbMtpEndEvent() |
|
344 { |
|
345 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
346 QSignalSpy spy( mTest, SIGNAL( usbBlocked( bool ) ) ); |
|
347 QSignalSpy spyTwo( mTest, SIGNAL( usbSynchronizationFinished() ) ); |
|
348 QSignalSpy spyThree( mTest, SIGNAL( libraryUpdated() ) ); |
|
349 QList<QVariant> arguments; |
|
350 |
|
351 mTest->mUsbBlockingState = MpEngine::USB_Synchronizing; |
|
352 mTest->handleUsbMtpEndEvent(); |
|
353 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
354 QVERIFY( spy.count() == 1 ); |
|
355 arguments = spy.takeFirst(); |
|
356 QVERIFY( arguments.at(0).toBool() == false ); |
|
357 QVERIFY( spyTwo.count() == 1 ); |
|
358 QVERIFY( spyThree.count() == 1 ); |
|
359 spyTwo.clear(); |
|
360 spyThree.clear(); |
|
361 arguments.clear(); |
|
362 |
|
363 mTest->mPreviousUsbState = MpEngine::USB_NotConnected; |
|
364 mTest->handleUsbMtpEndEvent(); |
|
365 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
366 QVERIFY( spy.count() == 1 ); |
|
367 arguments = spy.takeFirst(); |
|
368 QVERIFY( arguments.at(0).toBool() == false ); |
|
369 QVERIFY( spyTwo.count() == 0 ); |
|
370 QVERIFY( spyThree.count() == 0 ); |
|
371 spyTwo.clear(); |
|
372 spyThree.clear(); |
|
373 arguments.clear(); |
|
374 |
|
375 mTest->mPreviousUsbState = MpEngine::USB_Connected; |
|
376 mTest->handleUsbMtpEndEvent(); |
|
377 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
378 QVERIFY( spy.count() == 1 ); |
|
379 arguments = spy.takeFirst(); |
|
380 QVERIFY( arguments.at(0).toBool() == false ); |
|
381 QVERIFY( spyTwo.count() == 0 ); |
|
382 QVERIFY( spyThree.count() == 0 ); |
|
383 spyTwo.clear(); |
|
384 spyThree.clear(); |
|
385 arguments.clear(); |
|
386 } |
|
387 |
|
388 /*! |
|
389 test handleUsbMtpNotActive |
|
390 */ |
|
391 void TestMpEngine::testHandleUsbMtpNotActive() |
|
392 { |
|
393 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
394 QSignalSpy spy( mTest, SIGNAL( usbBlocked( bool ) ) ); |
|
395 |
|
396 mTest->handleUsbMtpNotActive(); |
|
397 QVERIFY( spy.count() == 1 ); |
|
398 QList<QVariant> arguments = spy.takeFirst(); |
|
399 QVERIFY( arguments.at(0).toBool() == true ); |
|
400 } |
|
401 |
|
402 /*! |
|
403 test changeUsbBlockingState |
|
404 */ |
|
405 void TestMpEngine::testChangeUsbBlockingState() |
|
406 { |
|
407 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
408 |
|
409 MpEngine::UsbBlockingState cState = mTest->mUsbBlockingState; |
|
410 mTest->changeUsbBlockingState( MpEngine::USB_Connected ); |
|
411 QCOMPARE( mTest->mPreviousUsbState, cState ); |
|
412 QCOMPARE( mTest->mUsbBlockingState, MpEngine::USB_Connected ); |
|
413 } |
|
414 |
|
415 /*! |
|
416 test handleDeleteStarted |
|
417 */ |
|
418 void TestMpEngine::testHandleDeleteStarted() |
|
419 { |
|
420 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
421 qRegisterMetaType<QModelIndex>("TCollectionContext"); |
|
422 QSignalSpy spy( mTest, SIGNAL( deleteStarted( TCollectionContext, int ) ) ); |
|
423 |
|
424 TCollectionContext context( ECollectionContextAllSongs ); |
|
425 mTest->handleDeleteStarted( context, 0 ); |
|
426 QVERIFY( mTest->mHandleMediaCommands == false ); |
|
427 QVERIFY( spy.count() == 1 ); |
|
428 } |
|
429 |
|
430 /*! |
|
431 test handleDeleteEnded |
|
432 */ |
|
433 void TestMpEngine::testHandleDeleteEnded() |
|
434 { |
|
435 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
436 QSignalSpy spy( mTest, SIGNAL( songsDeleted( bool ) ) ); |
|
437 QList<QVariant> arguments; |
|
438 |
|
439 mTest->handleDeleteEnded( true ); |
|
440 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
441 QVERIFY( spy.count() == 1 ); |
|
442 arguments = spy.takeFirst(); |
|
443 QVERIFY( arguments.at(0).toBool() == true ); |
|
444 spy.clear(); |
|
445 arguments.clear(); |
|
446 |
|
447 mTest->handleDeleteEnded( false ); |
|
448 QVERIFY( mTest->mHandleMediaCommands == true ); |
|
449 QVERIFY( spy.count() == 1 ); |
|
450 arguments = spy.takeFirst(); |
|
451 QVERIFY( arguments.at(0).toBool() == false ); |
|
452 spy.clear(); |
|
453 arguments.clear(); |
|
454 } |
|
455 |
|
456 /*! |
|
457 test playbackData |
|
458 */ |
|
459 void TestMpEngine::testPlaybackData() |
|
460 { |
|
461 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
462 QVERIFY( mTest->mMpxPlaybackWrapper->mPlaybackData == mTest->playbackData() ); |
|
463 } |
|
464 |
|
465 /*! |
|
466 test songData |
|
467 */ |
|
468 void TestMpEngine::testSongData() |
|
469 { |
|
470 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
471 QVERIFY( mTest->mSongData == mTest->songData() ); |
|
472 } |
|
473 |
|
474 /*! |
|
475 test balance |
|
476 */ |
|
477 void TestMpEngine::testBalance() |
|
478 { |
|
479 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
480 QVERIFY( mTest->mAudioEffectsWrapper->mBalance == mTest->balance() ); |
|
481 } |
|
482 |
|
483 /*! |
|
484 test loudness |
|
485 */ |
|
486 void TestMpEngine::testLoudness() |
|
487 { |
|
488 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
489 QVERIFY( mTest->mAudioEffectsWrapper->mLoudness == mTest->loudness() ); |
|
490 } |
|
491 |
|
492 /*! |
|
493 test setBalance |
|
494 */ |
|
495 void TestMpEngine::testSetBalance() |
|
496 { |
|
497 // nothing to test here |
|
498 } |
|
499 |
|
500 /*! |
|
501 test setLoudness |
|
502 */ |
|
503 void TestMpEngine::testSetLoudness() |
|
504 { |
|
505 // nothing to test here |
|
506 } |
|
507 |
|
508 /*! |
|
509 test applyPreset |
|
510 */ |
|
511 void TestMpEngine::testApplyPreset() |
|
512 { |
|
513 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
514 mTest->mCurrentPresetIndex = 2; |
|
515 |
|
516 mTest->applyPreset( 4 ); |
|
517 QCOMPARE( mTest->mCurrentPresetIndex, 4 ); |
|
518 } |
|
519 |
|
520 /*! |
|
521 test disableEqualizer |
|
522 */ |
|
523 void TestMpEngine::testDisableEqualizer() |
|
524 { |
|
525 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
526 mTest->disableEqualizer(); |
|
527 |
|
528 QCOMPARE( mTest->mCurrentPresetIndex, KEqualizerPresetNone ); |
|
529 } |
|
530 |
|
531 /*! |
|
532 test activePreset |
|
533 */ |
|
534 void TestMpEngine::testActivePreset() |
|
535 { |
|
536 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
537 |
|
538 QCOMPARE( mTest->mCurrentPresetIndex, mTest->activePreset() ); |
|
539 } |
|
540 |
|
541 /*! |
|
542 test presetNames |
|
543 */ |
|
544 void TestMpEngine::testPresetNames() |
|
545 { |
|
546 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
547 |
|
548 QCOMPARE( mTest->mEqualizerWrapper->mList, mTest->presetNames() ); |
|
549 } |
|
550 |
|
551 /*! |
|
552 test handleEqualizerReady |
|
553 */ |
|
554 void TestMpEngine::testHandleEqualizerReady() |
|
555 { |
|
556 mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone ); |
|
557 QSignalSpy spy( mTest, SIGNAL( equalizerReady() ) ); |
|
558 |
|
559 mTest->handleEqualizerReady(); |
|
560 QCOMPARE( mTest->mCurrentPresetIndex, 1 ); |
|
561 QVERIFY( spy.count() == 1 ); |
|
562 } |
|
563 |
|
564 |
|
565 // End of file |