qtmobility/tests/auto/qradiotuner/tst_qradiotuner.cpp
changeset 5 453da2cfceef
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
4:90517678cc4f 5:453da2cfceef
    47 #include <qmediacontrol.h>
    47 #include <qmediacontrol.h>
    48 #include <qmediaservice.h>
    48 #include <qmediaservice.h>
    49 #include <qradiotunercontrol.h>
    49 #include <qradiotunercontrol.h>
    50 #include <qradiotuner.h>
    50 #include <qradiotuner.h>
    51 
    51 
    52 QTM_USE_NAMESPACE
    52 QT_USE_NAMESPACE
    53 class MockControl : public QRadioTunerControl
    53 class MockControl : public QRadioTunerControl
    54 {
    54 {
    55     Q_OBJECT
    55     Q_OBJECT
    56 
    56 
    57 public:
    57 public:
    68     }
    68     }
    69     bool isAvailable() const
    69     bool isAvailable() const
    70     {
    70     {
    71         return true;
    71         return true;
    72     }
    72     }
    73     QtMedia::AvailabilityError availabilityError() const
    73     QtMediaServices::AvailabilityError availabilityError() const
    74     {
    74     {
    75         return QtMedia::NoError;
    75         return QtMediaServices::NoError;
    76     }
    76     }
    77 
    77 
    78     QRadioTuner::Band band() const
    78     QRadioTuner::Band band() const
    79     {
    79     {
    80         return m_band;
    80         return m_band;
   309 
   309 
   310     radio->stop();
   310     radio->stop();
   311     QCOMPARE(radio->state(), QRadioTuner::StoppedState);
   311     QCOMPARE(radio->state(), QRadioTuner::StoppedState);
   312     QCOMPARE(stateSpy.count(), 1);
   312     QCOMPARE(stateSpy.count(), 1);
   313 
   313 
   314 #ifdef QTM_NAMESPACE
       
   315     QEXPECT_FAIL("", "QSignalSpy doesn't grab the correct value from signal because of QtMobility namespace", Continue);
       
   316 #endif
       
   317     QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState);
   314     QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState);
   318 
   315 
   319     delete radio;
   316     delete radio;
   320     delete service;
   317     delete service;
   321     delete provider;
   318     delete provider;