Skip to content

Commit

Permalink
Merge pull request #1255 from peppy/fix-test-unload
Browse files Browse the repository at this point in the history
Fix previous tests not correctly getting removed from TestBrowser
  • Loading branch information
smoogipoo authored Dec 17, 2017
2 parents 675fb72 + f4de27f commit 5da6990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions osu.Framework/Testing/TestBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,14 @@ public void LoadTest(Type testType = null, Action onCompletion = null)
{
if (lastTest?.Parent != null)
{
testContentContainer.Remove(lastTest);
testContentContainer.Remove(lastTest.Parent);
lastTest.Clear();
}
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;
}
Expand Down
5 changes: 1 addition & 4 deletions osu.Framework/Testing/TestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ private void runNextStep(Action onCompletion, Action<Exception> 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);
Expand Down

0 comments on commit 5da6990

Please sign in to comment.