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:
parent
a7853fc9cc
commit
44c34ca7b2
@ -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();
|
||||
}
|
||||
|
@ -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),
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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++)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user