From a966991b3af18d57182e5dc5a3ed4985d114b56d Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Fri, 19 Jan 2018 10:30:24 +0100 Subject: Fix a crash when QMovie::speed is set to 0 Setting speed to 0 means the current frame will continue to be shown, the finished signal is not emitted, and state remains QMovie::Running. Task-number: QTBUG-65758 Change-Id: I681d902e3211c5899b21043e5177b7c73d5d3fb5 Reviewed-by: Shawn Rutledge --- tests/auto/gui/image/qmovie/tst_qmovie.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index bcaa759faa..4e9e9b8115 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -170,6 +170,16 @@ void tst_QMovie::playMovie() QCOMPARE(movie.state(), QMovie::NotRunning); QCOMPARE(movie.frameCount(), frameCount); #endif + + movie.stop(); + QSignalSpy finishedSpy(&movie, &QMovie::finished); + movie.setSpeed(0); + movie.start(); + QCOMPARE(movie.state(), QMovie::Running); + QTestEventLoop::instance().enterLoop(2); + QCOMPARE(finishedSpy.count(), 0); + QCOMPARE(movie.state(), QMovie::Running); + QCOMPARE(movie.currentFrameNumber(), 0); } void tst_QMovie::jumpToFrame_data() -- cgit v1.2.3