1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Revert changes causing BeatmapSet.Metadata to be expectedly null in some tests

This commit is contained in:
Dean Herbert 2021-11-24 14:32:18 +09:00
parent a7853fc9cc
commit 44c34ca7b2
6 changed files with 22 additions and 14 deletions

View File

@ -148,6 +148,7 @@ namespace osu.Game.Tests.Online
Debug.Assert(info.BeatmapSet != null);
info.BeatmapSet.Beatmaps.Add(info);
info.BeatmapSet.Metadata = info.Metadata;
info.MD5Hash = stream.ComputeMD5Hash();
info.Hash = stream.ComputeSHA2Hash();
}

View File

@ -47,10 +47,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
beatmaps = new List<BeatmapInfo>();
var metadata = new BeatmapMetadata
{
Artist = "Some Artist",
Title = "Some Beatmap",
AuthorString = "Some Author"
};
var beatmapSetInfo = new BeatmapSetInfo
{
OnlineID = 10,
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
Metadata = metadata,
DateAdded = DateTimeOffset.UtcNow
};
@ -61,13 +69,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
int length = RNG.Next(30000, 200000);
double bpm = RNG.NextSingle(80, 200);
var metadata = new BeatmapMetadata
{
Artist = "Some Artist",
Title = "Some Beatmap",
AuthorString = "Some Author"
};
var beatmap = new BeatmapInfo
{
Ruleset = rulesets.GetRuleset(i % 4),

View File

@ -53,6 +53,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
OnlineID = 10,
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
Metadata = metadata,
DateAdded = DateTimeOffset.UtcNow,
};

View File

@ -846,8 +846,10 @@ namespace osu.Game.Tests.Visual.SongSelect
var beatmapSet = new BeatmapSetInfo
{
ID = id,
OnlineID = id,
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
Metadata = metadata,
};
foreach (var b in getBeatmaps(randomDifficultyCount ? RNG.Next(1, 20) : 3, metadata))
@ -899,6 +901,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{
OnlineID = id,
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
Metadata = metadata,
};
for (int b = 1; b < 101; b++)

View File

@ -182,6 +182,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{
Hash = Guid.NewGuid().ToString(),
OnlineID = importID,
Metadata = metadata,
};
beatmapSet.Beatmaps.AddRange(difficultyRulesets.Select((ruleset, difficultyIndex) => new BeatmapInfo

View File

@ -907,13 +907,6 @@ namespace osu.Game.Tests.Visual.SongSelect
int setId = getImportId();
var beatmapSet = new BeatmapSetInfo
{
OnlineID = setId,
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
DateAdded = DateTimeOffset.UtcNow,
};
var metadata = new BeatmapMetadata
{
// Create random metadata, then we can check if sorting works based on these
@ -922,6 +915,14 @@ namespace osu.Game.Tests.Visual.SongSelect
AuthorString = "Some Guy " + RNG.Next(0, 9),
};
var beatmapSet = new BeatmapSetInfo
{
OnlineID = setId,
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
DateAdded = DateTimeOffset.UtcNow,
Metadata = metadata
};
for (int i = 0; i < countPerRuleset; i++)
{
int beatmapId = setId * 1000 + i;