1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 18:23:20 +08:00

Use random generation in carousel stress test

This commit is contained in:
Dean Herbert 2025-02-07 02:10:08 +09:00
parent 0235928fda
commit 75ef6f6a0e
No known key found for this signature in database
2 changed files with 25 additions and 22 deletions

View File

@ -187,6 +187,10 @@ namespace osu.Game.Tests.Visual.SongSelect
protected void AddBeatmaps(int count, int? fixedDifficultiesPerSet = null, bool randomMetadata = false) => AddStep($"add {count} beatmaps{(randomMetadata ? " with random data" : "")}", () =>
{
for (int i = 0; i < count; i++)
BeatmapSets.Add(CreateTestBeatmapSetInfo(fixedDifficultiesPerSet, randomMetadata));
});
protected static BeatmapSetInfo CreateTestBeatmapSetInfo(int? fixedDifficultiesPerSet, bool randomMetadata)
{
var beatmapSetInfo = TestResources.CreateTestBeatmapSetInfo(fixedDifficultiesPerSet ?? RNG.Next(1, 4));
@ -206,9 +210,8 @@ namespace osu.Game.Tests.Visual.SongSelect
beatmap.Metadata = metadata.DeepClone();
}
BeatmapSets.Add(beatmapSetInfo);
return beatmapSetInfo;
}
});
private static long randomCharPointer;

View File

@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Task.Run(() =>
{
for (int j = 0; j < count; j++)
generated.Add(TestResources.CreateTestBeatmapSetInfo(RNG.Next(1, 4)));
generated.Add(CreateTestBeatmapSetInfo(3, true));
}).ConfigureAwait(true);
});