From cacd3f5676b4d5fd55e48454db71ed33b907be90 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Dec 2017 14:39:48 +0900 Subject: [PATCH 1/2] Fix previous tests not correctly getting removed from TestBrowser --- osu.Framework/Testing/TestBrowser.cs | 2 +- osu.Framework/Testing/TestCase.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Framework/Testing/TestBrowser.cs b/osu.Framework/Testing/TestBrowser.cs index 7e671bd0d6..d0b6b694b5 100644 --- a/osu.Framework/Testing/TestBrowser.cs +++ b/osu.Framework/Testing/TestBrowser.cs @@ -306,7 +306,7 @@ public void LoadTest(Type testType = null, Action onCompletion = null) { if (lastTest?.Parent != null) { - testContentContainer.Remove(lastTest); + testContentContainer.Remove(lastTest.Parent); lastTest.Clear(); } diff --git a/osu.Framework/Testing/TestCase.cs b/osu.Framework/Testing/TestCase.cs index f1900bd0ca..f38f22f8dc 100644 --- a/osu.Framework/Testing/TestCase.cs +++ b/osu.Framework/Testing/TestCase.cs @@ -181,10 +181,7 @@ private void runNextStep(Action onCompletion, Action onError) if (actionIndex < 0) text += $"{GetType().ReadableName()}"; else - { - text += $"step {actionIndex + 1}"; - text = text.PadRight(16) + $"{loadableStep?.ToString() ?? string.Empty}"; - } + text += $"step {actionIndex + 1} {loadableStep?.ToString() ?? string.Empty}"; } Console.Write(text); From 0354c98341c7ba68652265f9563929cd147c6124 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Dec 2017 20:14:48 +0900 Subject: [PATCH 2/2] Add missing case --- osu.Framework/Testing/TestBrowser.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Framework/Testing/TestBrowser.cs b/osu.Framework/Testing/TestBrowser.cs index d0b6b694b5..752d6a3f5f 100644 --- a/osu.Framework/Testing/TestBrowser.cs +++ b/osu.Framework/Testing/TestBrowser.cs @@ -312,7 +312,8 @@ public void LoadTest(Type testType = null, Action onCompletion = null) if (CurrentTest != newTest) { - testContentContainer.Remove(newTest); + // There could have been multiple loads fired after us. In such a case we want to silently remove ourselves. + testContentContainer.Remove(newTest.Parent); return; }