Fix a couple of remaining cases of tests not using the new temporary file location for storage

This commit is contained in:
Dean Herbert
2021-12-24 20:17:47 +09:00
parent 4b88e257e5
commit be02c3f9f8
2 changed files with 10 additions and 45 deletions

View File

@ -2,9 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using System.IO;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Platform;
using osu.Framework.Testing;
using osu.Game.Tournament.IO;
using osu.Game.Tournament.IPC;
@ -17,9 +19,9 @@ namespace osu.Game.Tournament.Tests.NonVisual
public void CheckIPCLocation()
{
// don't use clean run because files are being written before osu! launches.
using (HeadlessGameHost host = new HeadlessGameHost(nameof(CheckIPCLocation)))
using (var host = new TestRunHeadlessGameHost(nameof(CheckIPCLocation)))
{
string basePath = CustomTourneyDirectoryTest.PrepareBasePath(nameof(CheckIPCLocation));
string basePath = Path.Combine(host.UserStoragePaths.First(), nameof(CheckIPCLocation));
// Set up a fake IPC client for the IPC Storage to switch to.
string testStableInstallDirectory = Path.Combine(basePath, "stable-ce");
@ -42,15 +44,6 @@ namespace osu.Game.Tournament.Tests.NonVisual
finally
{
host.Exit();
try
{
if (Directory.Exists(basePath))
Directory.Delete(basePath, true);
}
catch
{
}
}
}
}