summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-10-28 13:28:58 +0200
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-10-28 13:28:58 +0200
commite7b9fb2e87641a36301babf457056b3350f0431c (patch)
tree3db3d29297d29ac1801a33d50c1273efec97352b /tests
parentb36e845dde90313cf98df118ce6ffd88502b943b (diff)
parent77819edac505823226c40033e76d2dda0e8b363a (diff)
Merge remote branch 'scm/qt/master'
Conflicts: mkspecs/symbian-gcce/qmake.conf
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp24
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp2
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index a2b8d5bfb5..c7d4617b68 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9692,14 +9692,25 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
child.setAutoFillBackground(true);
child.setPalette(Qt::blue);
+ QWidget grandChild(&child);
+ grandChild.setAutoFillBackground(true);
+ grandChild.setPalette(Qt::yellow);
+
QVBoxLayout layout(&parent);
layout.setContentsMargins(10, 10, 10, 10);
layout.addWidget(&child);
parent.setLayout(&layout);
- child.winId();
+ QVBoxLayout childLayout(&child);
+ childLayout.setContentsMargins(10, 10, 10, 10);
+ childLayout.addWidget(&grandChild);
+ child.setLayout(&childLayout);
+
+ // Ensure that this widget and all its ancestors are native
+ grandChild.winId();
parent.show();
+
QTest::qWaitForWindowShown(&parent);
// Check that child window does not obscure parent window
@@ -9708,18 +9719,24 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
// Native child widget should share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
// Make child widget full screen
child.setWindowFlags((child.windowFlags() | Qt::Window) ^ Qt::SubWindow);
child.setWindowState(child.windowState() | Qt::WindowFullScreen);
child.show();
+
+ // Paint into the child to ensure that it gets a backing store
+ QPainter painter(&child);
+ painter.fillRect(QRect(0, 0, 90, 90), Qt::white);
+
QTest::qWaitForWindowShown(&child);
// Ensure that 'window hidden' event is received by parent
qApp->processEvents();
// Check that child window obscures parent window
- QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Now that extent of child widget goes beyond parent's extent,
// a new backing store should be created for the child widget.
@@ -9735,11 +9752,12 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QTest::qWaitForWindowShown(&child);
// Check that parent is now visible again
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Native child widget should once again share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
}
// 6. Partial reveal followed by full reveal
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index 961605298c..eafcc24dca 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1007,6 +1007,7 @@ static inline __attribute__((optimize("no-unroll-loops"))) int ucstrncmp_sse2_al
return ucstrncmp_short_tail(a + counter, b + counter, len);
}
+#ifdef __SSSE3__
static inline __attribute__((optimize("no-unroll-loops"))) int ucstrncmp_ssse3_alignr_aligned(const ushort *a, const ushort *b, int len)
{
quintptr counter = 0;
@@ -1276,6 +1277,7 @@ static int ucstrncmp_ssse3_aligning2(const ushort *a, const ushort *b, int len)
}
#endif
+#endif
typedef int (* UcstrncmpFunction)(const ushort *, const ushort *, int);
Q_DECLARE_METATYPE(UcstrncmpFunction)