Improve MoveResizeWindowTest::testMove expected fail cases

Instead of having an expect fail on every check for the count of signals
emitted for clientStepUserMovedResized we reset after the first one which
is the actual issue.

Thus we can properly check that in the other cases the signals are
emitted.
This commit is contained in:
Martin Gräßlin 2017-01-26 20:41:58 +01:00
parent 6b0b4cf468
commit de444194ed

View file

@ -166,19 +166,19 @@ void MoveResizeWindowTest::testMove()
QCOMPARE(Cursor::pos(), cursorPos + QPoint(8, 0));
QEXPECT_FAIL("", "First event is ignored", Continue);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
clientStepUserMovedResizedSpy.clear();
windowStepUserMovedResizedSpy.clear();
c->keyPressEvent(Qt::Key_Right);
c->updateMoveResize(Cursor::pos());
QCOMPARE(Cursor::pos(), cursorPos + QPoint(16, 0));
QEXPECT_FAIL("", "First event is ignored", Continue);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
QEXPECT_FAIL("", "First event is ignored", Continue);
QCOMPARE(windowStepUserMovedResizedSpy.count(), 2);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
QCOMPARE(windowStepUserMovedResizedSpy.count(), 1);
c->keyPressEvent(Qt::Key_Down | Qt::ALT);
c->updateMoveResize(Cursor::pos());
QEXPECT_FAIL("", "First event is ignored", Continue);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 3);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
QCOMPARE(windowStepUserMovedResizedSpy.count(), 2);
QCOMPARE(c->geometry(), QRect(16, 32, 100, 50));
QCOMPARE(Cursor::pos(), cursorPos + QPoint(16, 32));