summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp26
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiffbin0 -> 7740 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiffbin0 -> 9570 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiffbin0 -> 2382 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiffbin0 -> 5922 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_mono.tiffbin0 -> 786 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiffbin0 -> 12608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiffbin0 -> 15560 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiffbin0 -> 17972 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiffbin0 -> 17648 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp45
29 files changed, 71 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index a623b50..10f0e42 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -281,6 +281,7 @@ private slots:
void subFocus();
void reverseCreateAutoFocusProxy();
void focusProxyDeletion();
+ void negativeZStacksBehindParent();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -7558,5 +7559,30 @@ void tst_QGraphicsItem::focusProxyDeletion()
delete scene; // don't crash
}
+void tst_QGraphicsItem::negativeZStacksBehindParent()
+{
+ QGraphicsRectItem rect;
+ QCOMPARE(rect.zValue(), qreal(0.0));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(-1);
+ QCOMPARE(rect.zValue(), qreal(-1.0));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(0);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent);
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(-1);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+ rect.setZValue(0);
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false);
+ rect.setZValue(-1);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, true);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
new file mode 100644
index 0000000..3fcb8a9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
new file mode 100644
index 0000000..6f3e9d5
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
new file mode 100644
index 0000000..aab9cf2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
new file mode 100644
index 0000000..aad96ff
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
new file mode 100644
index 0000000..05d23dc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
new file mode 100644
index 0000000..9ffe7fc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
new file mode 100644
index 0000000..eeeb019
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
new file mode 100644
index 0000000..87cf2fd
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
new file mode 100644
index 0000000..3b589b2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
new file mode 100644
index 0000000..9a66223
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
new file mode 100644
index 0000000..eed2423
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
new file mode 100644
index 0000000..055480e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
new file mode 100644
index 0000000..b4d0974
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
new file mode 100644
index 0000000..3b1e02a
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
new file mode 100644
index 0000000..b752c74
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
new file mode 100644
index 0000000..e228d05
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
new file mode 100644
index 0000000..7507e52
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
new file mode 100644
index 0000000..8ff9db8
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
new file mode 100644
index 0000000..321ea3e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
new file mode 100644
index 0000000..2756a82
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
new file mode 100644
index 0000000..ae9af09
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
new file mode 100644
index 0000000..a2f4325
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
new file mode 100644
index 0000000..f35bfc4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
new file mode 100644
index 0000000..70e5478
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
new file mode 100644
index 0000000..b2635fe
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
new file mode 100644
index 0000000..1fb0cd9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
new file mode 100644
index 0000000..666b1b4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index dad771b..ba3d83e 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -149,6 +149,9 @@ private slots:
void tiffCompression_data();
void tiffCompression();
void tiffEndianness();
+
+ void tiffOrientation_data();
+ void tiffOrientation();
#endif
void autoDetectImageFormat();
@@ -1308,6 +1311,48 @@ void tst_QImageReader::tiffEndianness()
QCOMPARE(littleEndian, bigEndian);
}
+void tst_QImageReader::tiffOrientation_data()
+{
+ QTest::addColumn<QString>("expected");
+ QTest::addColumn<QString>("oriented");
+ QTest::newRow("Indexed TIFF, orientation1") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_1.tiff";
+ QTest::newRow("Indexed TIFF, orientation2") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_2.tiff";
+ QTest::newRow("Indexed TIFF, orientation3") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_3.tiff";
+ QTest::newRow("Indexed TIFF, orientation4") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_4.tiff";
+ QTest::newRow("Indexed TIFF, orientation5") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_5.tiff";
+ QTest::newRow("Indexed TIFF, orientation6") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_6.tiff";
+ QTest::newRow("Indexed TIFF, orientation7") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_7.tiff";
+ QTest::newRow("Indexed TIFF, orientation8") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_8.tiff";
+
+ QTest::newRow("Mono TIFF, orientation1") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_1.tiff";
+ QTest::newRow("Mono TIFF, orientation2") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_2.tiff";
+ QTest::newRow("Mono TIFF, orientation3") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_3.tiff";
+ QTest::newRow("Mono TIFF, orientation4") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_4.tiff";
+ QTest::newRow("Mono TIFF, orientation5") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_5.tiff";
+ QTest::newRow("Mono TIFF, orientation6") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_6.tiff";
+ QTest::newRow("Mono TIFF, orientation7") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_7.tiff";
+ QTest::newRow("Mono TIFF, orientation8") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_8.tiff";
+
+ QTest::newRow("RGB TIFF, orientation1") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_1.tiff";
+ QTest::newRow("RGB TIFF, orientation2") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_2.tiff";
+ QTest::newRow("RGB TIFF, orientation3") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_3.tiff";
+ QTest::newRow("RGB TIFF, orientation4") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_4.tiff";
+ QTest::newRow("RGB TIFF, orientation5") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_5.tiff";
+ QTest::newRow("RGB TIFF, orientation6") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_6.tiff";
+ QTest::newRow("RGB TIFF, orientation7") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_7.tiff";
+ QTest::newRow("RGB TIFF, orientation8") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_8.tiff";
+}
+
+void tst_QImageReader::tiffOrientation()
+{
+ QFETCH(QString, expected);
+ QFETCH(QString, oriented);
+
+ QImage expectedImage(prefix + expected);
+ QImage orientedImage(prefix + oriented);
+ QCOMPARE(expectedImage, orientedImage);
+}
+
#endif
void tst_QImageReader::dotsPerMeter_data()