summaryrefslogtreecommitdiffstats
path: root/tests/auto/unit
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2012-01-19 14:07:44 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-19 05:13:31 +0100
commitb48009ce9e5ae4e0aa902bd6b621e008cf0301a2 (patch)
tree2be48ad3374b48b9a437da13e98d7054f5be997e /tests/auto/unit
parent69cef0c24c1f6500d6047ae9c093fda26cf203a6 (diff)
QAudioRecorder: fixed handling the missing inputs control.
Added check for null audioEndpointSelector control in QAudioRecorder::audioInputs() Change-Id: I506dcea9e8d3a468319acf2489cd4d803a5c187d Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'tests/auto/unit')
-rw-r--r--tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp
index 461a0bc76..8b8c8723b 100644
--- a/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp
+++ b/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp
@@ -68,8 +68,8 @@ public slots:
void cleanup();
private slots:
- //void testNullService();
- //void testNullControl();
+ void testNullService();
+ void testNullControl();
void testAudioSource();
void testOptions();
void testDevices();
@@ -86,46 +86,47 @@ void tst_QAudioRecorder::init()
{
mockMediaRecorderService = new MockMediaRecorderService(this, new MockMediaRecorderControl(this));
mockProvider = new MockMediaServiceProvider(mockMediaRecorderService);
+ audiosource = 0;
}
void tst_QAudioRecorder::cleanup()
{
- delete audiosource;
+ delete mockMediaRecorderService;
delete mockProvider;
- audiosource = 0;
+ delete audiosource;
+ mockMediaRecorderService = 0;
mockProvider = 0;
+ audiosource = 0;
}
-/*
+
void tst_QAudioRecorder::testNullService()
{
- MockProvider provider(0);
- QAudioRecorder source(0, &provider);
+ mockProvider->service = 0;
+ QAudioRecorder source(0, mockProvider);
QCOMPARE(source.audioInputs().size(), 0);
QCOMPARE(source.defaultAudioInput(), QString());
- QCOMPARE(source.activeAudioInput(), QString());
+ QCOMPARE(source.audioInput(), QString());
}
-*/
-/*
+
+
void tst_QAudioRecorder::testNullControl()
{
- MockRecorderService service;
- service.hasAudioDeviceControl = false;
- MockProvider provider(&service);
- QAudioRecorder source(0, &provider);
+ mockMediaRecorderService->hasControls = false;
+ QAudioRecorder source(0, mockProvider);
QCOMPARE(source.audioInputs().size(), 0);
QCOMPARE(source.defaultAudioInput(), QString());
- QCOMPARE(source.activeAudioInput(), QString());
+ QCOMPARE(source.audioInput(), QString());
- QCOMPARE(source.audioDescription("blah"), QString());
+ QCOMPARE(source.audioInputDescription("blah"), QString());
- QSignalSpy deviceNameSpy(&source, SIGNAL(activeAudioInputChanged(QString)));
+ QSignalSpy deviceNameSpy(&source, SIGNAL(audioInputChanged(QString)));
source.setAudioInput("blah");
QCOMPARE(deviceNameSpy.count(), 0);
}
-*/
+
void tst_QAudioRecorder::testAudioSource()
{
audiosource = new QAudioRecorder(0, mockProvider);