1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 19:54:15 +08:00

Fix tests

This commit is contained in:
Bartłomiej Dach
2025-03-27 12:39:19 +01:00
Unverified
parent 1f77ef5544
commit 2ba621550c
5 changed files with 25 additions and 4 deletions
@@ -61,6 +61,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("import beatmap", () =>
{
beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
Realm.Write(r =>
{
foreach (var beatmapInfo in r.All<BeatmapInfo>())
beatmapInfo.OnlineMD5Hash = beatmapInfo.MD5Hash;
});
importedSet = beatmaps.GetAllUsableBeatmapSets().First();
InitialBeatmap = importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0);
OtherBeatmap = importedSet.Beatmaps.Last(b => b.Ruleset.OnlineID == 0);
@@ -81,6 +81,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("import beatmap", () =>
{
beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
Realm.Write(r =>
{
foreach (var beatmapInfo in r.All<BeatmapInfo>())
beatmapInfo.OnlineMD5Hash = beatmapInfo.MD5Hash;
});
importedSet = beatmaps.GetAllUsableBeatmapSets().First();
});
@@ -176,6 +176,7 @@ namespace osu.Game.Tests.Visual.Playlists
RulesetID = new OsuRuleset().RulesetInfo.OnlineID
}
];
room.EndDate = DateTimeOffset.Now.AddHours(1);
});
AddAssert("match has default beatmap", () => match.Beatmap.IsDefault);
@@ -212,6 +213,11 @@ namespace osu.Game.Tests.Visual.Playlists
Debug.Assert(beatmap.BeatmapInfo.BeatmapSet != null);
importedBeatmap = manager.Import(beatmap.BeatmapInfo.BeatmapSet)!.Value.Detach();
Realm.Write(r =>
{
foreach (var beatmapInfo in r.All<BeatmapInfo>())
beatmapInfo.OnlineMD5Hash = beatmapInfo.MD5Hash;
});
});
private partial class TestPlaylistsRoomSubScreen : PlaylistsRoomSubScreen
@@ -65,7 +65,8 @@ namespace osu.Game.Tests.Visual.Playlists
OnlineID = 1,
DifficultyName = "Osu 1",
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = "11111111",
OnlineMD5Hash = "11111111",
Ruleset = new OsuRuleset().RulesetInfo,
Metadata =
{
@@ -79,7 +80,8 @@ namespace osu.Game.Tests.Visual.Playlists
OnlineID = 2,
DifficultyName = "Osu 2",
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = "22222222",
OnlineMD5Hash = "22222222",
Ruleset = new OsuRuleset().RulesetInfo,
Metadata =
{
@@ -93,7 +95,8 @@ namespace osu.Game.Tests.Visual.Playlists
OnlineID = 3,
DifficultyName = "Taiko 1",
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = "33333333",
OnlineMD5Hash = "33333333",
Ruleset = new TaikoRuleset().RulesetInfo,
Metadata =
{
@@ -107,7 +110,8 @@ namespace osu.Game.Tests.Visual.Playlists
OnlineID = 4,
DifficultyName = "Taiko 2",
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
MD5Hash = "44444444",
OnlineMD5Hash = "44444444",
Ruleset = new TaikoRuleset().RulesetInfo,
Metadata =
{
+1
View File
@@ -68,6 +68,7 @@ namespace osu.Game.Tests.Beatmaps
var b = Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
b.BeatmapInfo.MD5Hash = test_beatmap_hash.Value.md5;
b.BeatmapInfo.OnlineMD5Hash = test_beatmap_hash.Value.md5;
b.BeatmapInfo.Hash = test_beatmap_hash.Value.sha2;
return b;