[autotests] Verify the directChildServerSurfaces in TestSubSurface::testSurfaceAt

Unused variable warnings were reported. Let's do some testing with those
variables.
This commit is contained in:
Martin Gräßlin 2016-06-29 11:24:35 +02:00
parent d52485ffb7
commit 4a3bdbbd7b

View file

@ -944,9 +944,11 @@ void TestSubSurface::testSurfaceAt()
QScopedPointer<Surface> directChild1(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *directChild1ServerSurface = serverSurfaceCreated.last().first().value<KWayland::Server::SurfaceInterface*>();
QVERIFY(directChild1ServerSurface);
QScopedPointer<Surface> directChild2(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *directChild2ServerSurface = serverSurfaceCreated.last().first().value<KWayland::Server::SurfaceInterface*>();
QVERIFY(directChild2ServerSurface);
// create the sub surfaces for them
QScopedPointer<SubSurface> directChild1SubSurface(m_subCompositor->createSubSurface(directChild1.data(), parent.data()));
@ -989,6 +991,11 @@ void TestSubSurface::testSurfaceAt()
QVERIFY(treeChangedSpy.isValid());
QVERIFY(treeChangedSpy.wait());
QCOMPARE(directChild1ServerSurface->subSurface()->parentSurface().data(), parentServerSurface);
QCOMPARE(directChild2ServerSurface->subSurface()->parentSurface().data(), parentServerSurface);
QCOMPARE(childFor1ServerSurface->subSurface()->parentSurface().data(), directChild1ServerSurface);
QCOMPARE(childFor2ServerSurface->subSurface()->parentSurface().data(), directChild2ServerSurface);
// now let's test a few positions
QCOMPARE(parentServerSurface->surfaceAt(QPointF(0, 0)), childFor1ServerSurface);
QCOMPARE(parentServerSurface->surfaceAt(QPointF(49, 49)), childFor1ServerSurface);