From 8c383ddc2735996b09874303f506a8f71e01dfae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Jun 2019 19:23:27 +0900 Subject: [PATCH] Fix dodgy test scheduling to other tests --- .../UserInterface/TestSceneNotificationOverlay.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneNotificationOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneNotificationOverlay.cs index 7cab21f157..d8a4514df1 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneNotificationOverlay.cs @@ -94,9 +94,8 @@ namespace osu.Game.Tests.Visual.UserInterface AddStep(@"progress #1", sendUploadProgress); AddStep(@"progress #2", sendDownloadProgress); - checkDisplayedCount(3); - checkProgressingCount(2); + checkDisplayedCount(3); } [Test] @@ -114,7 +113,7 @@ namespace osu.Game.Tests.Visual.UserInterface checkProgressingCount(0); - checkDisplayedCount(3); + checkDisplayedCount(2); AddStep(@"simple #1", sendHelloNotification); @@ -125,7 +124,7 @@ namespace osu.Game.Tests.Visual.UserInterface public void TestSpam() { setState(Visibility.Visible); - AddStep("send barrage", () => sendBarrage()); + AddRepeatStep("send barrage", sendBarrage, 10); } protected override void Update() @@ -191,7 +190,7 @@ namespace osu.Game.Tests.Visual.UserInterface private void checkProgressingCount(int expected) => AddAssert($"progressing count is {expected}", () => progressingNotifications.Count == expected); - private void sendBarrage(int remaining = 10) + private void sendBarrage() { switch (RNG.Next(0, 4)) { @@ -211,9 +210,6 @@ namespace osu.Game.Tests.Visual.UserInterface sendDownloadProgress(); break; } - - if (remaining > 0) - Scheduler.AddDelayed(() => sendBarrage(remaining - 1), 80); } private void sendAmazingNotification()