diff options
author | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-10-14 17:42:10 +0200 |
---|---|---|
committer | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-10-17 18:47:11 +0200 |
commit | 9aa6f08a92ecfefdbfd120940ee954eaa57080a4 (patch) | |
tree | 0c23cd41bf7b42f2a217935d0082dcd407a91414 /tests/auto/integration/qcamerabackend | |
parent | 8d0e5dfe93536a682849cb49fa2276ceba58ca60 (diff) |
Don't fail tests when recording does not start due to format error
Recorders don't handle all camera formats and we should not fail test
in such case. Specifically Windows encoders do not handle Y8 format
that is produced by IR cameras.
Pick-to: 6.4
Change-Id: I964d7edc0cef294ceb92932b901af8f3c174fe11
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Diffstat (limited to 'tests/auto/integration/qcamerabackend')
-rw-r--r-- | tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp index acb787408..066d97fa7 100644 --- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp @@ -545,7 +545,7 @@ void tst_QCameraBackend::testVideoRecording() session.setRecorder(&recorder); QSignalSpy errorSignal(camera.data(), SIGNAL(errorOccurred(QCamera::Error, const QString &))); - QSignalSpy recorderErrorSignal(&recorder, SIGNAL(errorOccurred(Error, const QString &))); + QSignalSpy recorderErrorSignal(&recorder, SIGNAL(errorOccurred(QMediaRecorder::Error, const QString &))); QSignalSpy recorderStateChanged(&recorder, SIGNAL(recorderStateChanged(RecorderState))); QSignalSpy durationChanged(&recorder, SIGNAL(durationChanged(qint64))); @@ -565,11 +565,15 @@ void tst_QCameraBackend::testVideoRecording() QTRY_VERIFY(camera->isActive()); QTRY_VERIFY(camera->isActive()); - for (int recordings = 0; recordings < 2; ++recordings) { //record 200ms clip recorder.record(); durationChanged.clear(); + if (!recorderErrorSignal.empty() || recorderErrorSignal.wait(100)) { + QCOMPARE(recorderErrorSignal.last().first().toInt(), QMediaRecorder::FormatError); + break; + } + QTRY_VERIFY(durationChanged.size()); QCOMPARE(recorder.metaData(), metaData); |