mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Fix TestImportOverIPC
This commit is contained in:
parent
92377b5810
commit
b84441ab87
@ -264,7 +264,8 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
private string createTemporaryBeatmap()
|
private string createTemporaryBeatmap()
|
||||||
{
|
{
|
||||||
var temp = new FileInfo(osz_path).CopyTo(Path.GetTempFileName(), true).FullName;
|
var temp = Path.GetTempFileName() + Guid.NewGuid() + ".osz";
|
||||||
|
File.Copy(osz_path, temp, true);
|
||||||
Assert.IsTrue(File.Exists(temp));
|
Assert.IsTrue(File.Exists(temp));
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
@ -344,12 +345,12 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
private void waitForOrAssert(Func<bool> result, string failureMessage, int timeout = 60000)
|
private void waitForOrAssert(Func<bool> result, string failureMessage, int timeout = 60000)
|
||||||
{
|
{
|
||||||
Action waitAction = () =>
|
Task task = Task.Run(() =>
|
||||||
{
|
{
|
||||||
while (!result()) Thread.Sleep(200);
|
while (!result()) Thread.Sleep(200);
|
||||||
};
|
});
|
||||||
|
|
||||||
Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), failureMessage);
|
Assert.IsTrue(task.Wait(timeout), failureMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user