Commit d8a3d991 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵 Committed by Nate Graham
Browse files

adapt automated tests of playlist proxy model to shuffle mode

in shuffle mode it is well possible that the current track is changed a
random number of times when inserting tracks one by one

takes this into account to still check the number of times the current
track is changed
parent fe8e7af7
Pipeline #221206 passed with stage
in 6 minutes and 22 seconds
......@@ -1715,7 +1715,7 @@ void MediaPlayListProxyModelTest::testSaveAndRestoreSettings()
QVERIFY(dataChangedSaveSpy.wait());
QCOMPARE(currentTrackChangedSaveSpy.count(), 1);
QVERIFY(currentTrackChangedSaveSpy.count() >= 1);
QCOMPARE(shufflePlayListChangedSaveSpy.count(), 1);
QCOMPARE(repeatModeChangedSaveSpy.count(), 1);
QCOMPARE(playListFinishedSaveSpy.count(), 0);
......@@ -1726,9 +1726,11 @@ void MediaPlayListProxyModelTest::testSaveAndRestoreSettings()
QCOMPARE(myPlayListSaveProxyModel.currentTrack(), QPersistentModelIndex(myPlayListSaveProxyModel.index(0, 0)));
const auto oldCurrentTrackChangedCount = currentTrackChangedSaveSpy.count();
myPlayListSaveProxyModel.skipNextTrack();
QCOMPARE(currentTrackChangedSaveSpy.count(), 2);
QCOMPARE(currentTrackChangedSaveSpy.count(), oldCurrentTrackChangedCount + 1);
QCOMPARE(shufflePlayListChangedSaveSpy.count(), 1);
QCOMPARE(repeatModeChangedSaveSpy.count(), 1);
QCOMPARE(playListFinishedSaveSpy.count(), 0);
......@@ -1739,7 +1741,7 @@ void MediaPlayListProxyModelTest::testSaveAndRestoreSettings()
myPlayListSaveProxyModel.skipNextTrack();
QCOMPARE(currentTrackChangedSaveSpy.count(), 3);
QCOMPARE(currentTrackChangedSaveSpy.count(), oldCurrentTrackChangedCount + 2);
QCOMPARE(shufflePlayListChangedSaveSpy.count(), 1);
QCOMPARE(repeatModeChangedSaveSpy.count(), 1);
QCOMPARE(playListFinishedSaveSpy.count(), 0);
......@@ -1750,7 +1752,7 @@ void MediaPlayListProxyModelTest::testSaveAndRestoreSettings()
myPlayListRestoreProxyModel.setPersistentState(myPlayListSaveProxyModel.persistentState());
QCOMPARE(currentTrackChangedSaveSpy.count(), 3);
QCOMPARE(currentTrackChangedSaveSpy.count(), oldCurrentTrackChangedCount + 2);
QCOMPARE(shufflePlayListChangedSaveSpy.count(), 1);
QCOMPARE(repeatModeChangedSaveSpy.count(), 1);
QCOMPARE(playListFinishedSaveSpy.count(), 0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment