summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader/tst_qimagereader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qimagereader/tst_qimagereader.cpp')
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 121a8fa..99244c2 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1633,6 +1633,35 @@ void tst_QImageReader::autoDetectImageFormat()
QVERIFY(reader.canRead());
QVERIFY(!reader.read().isNull());
}
+
+#ifdef QTEST_HAVE_JPEG
+ {
+ QImageReader io(prefix + "YCbCr_rgb.jpg");
+ io.setAutoDetectImageFormat(false);
+ // This should fail since no format string is given
+ QImage image;
+ QVERIFY(!io.read(&image));
+ }
+ {
+ QImageReader io(prefix + "YCbCr_rgb.jpg", "jpg");
+ io.setAutoDetectImageFormat(false);
+ QImage image;
+ QVERIFY(io.read(&image));
+ }
+#endif
+ {
+ QImageReader io(prefix + "tst7.png");
+ io.setAutoDetectImageFormat(false);
+ // This should fail since no format string is given
+ QImage image;
+ QVERIFY(!io.read(&image));
+ }
+ {
+ QImageReader io(prefix + "tst7.png", "png");
+ io.setAutoDetectImageFormat(false);
+ QImage image;
+ QVERIFY(io.read(&image));
+ }
}
void tst_QImageReader::fileNameProbing()