summaryrefslogtreecommitdiffstats
path: root/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-10-06 12:54:12 +0200
committerLars Knoll <lars.knoll@qt.io>2021-10-11 11:49:18 +0200
commitbce240a6c2415ecde8a6936592e7be6f26874ef3 (patch)
treed533c905213402703a0c2f3cef176aef78c15020 /tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
parent3c215df0155189083cd8921f1c4fd9c3147c7c11 (diff)
Fix qcamerabackend autotest for gstreamer
Mainly fixes in the auto test to ensure it works correctly. Add one log message to the image capture backend in case we fail to save to a file. Pick-to: 6.2 Change-Id: Ie631ebfdd45d16a16a5b7e22d8bbe00db78afd6f Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp')
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index 70f68e2ab..4bad5bbcf 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -322,8 +322,9 @@ void tst_QCameraBackend::testCameraFormat()
camera.stop();
spy.clear();
- camera.setCameraDevice({});
- QCOMPARE(spy.count(), 1);
+ // Shouldn't change anything as it's the same device
+ camera.setCameraDevice(device);
+ QCOMPARE(spy.count(), 0);
}
void tst_QCameraBackend::testCameraCapture()
@@ -450,7 +451,9 @@ void tst_QCameraBackend::testCameraCaptureMetadata()
QTRY_VERIFY(imageCapture.isReadyForCapture());
- int id = imageCapture.captureToFile(QString::fromLatin1("/dev/null"));
+ QTemporaryDir dir;
+ auto tmpFile = dir.filePath("testImage");
+ int id = imageCapture.captureToFile(tmpFile);
QTRY_VERIFY(!savedSignal.isEmpty());
QVERIFY(!metadataSignal.isEmpty());
QCOMPARE(metadataSignal.first().first().toInt(), id);
@@ -465,7 +468,7 @@ void tst_QCameraBackend::testExposureCompensation()
QCamera camera;
session.setCamera(&camera);
- QSignalSpy exposureCompensationSignal(&camera, SIGNAL(exposureCompensationChanged(qreal)));
+ QSignalSpy exposureCompensationSignal(&camera, SIGNAL(exposureCompensationChanged(float)));
//it should be possible to set exposure parameters in Unloaded state
QCOMPARE(camera.exposureCompensation(), 0.);