mirror of
https://github.com/ppy/osu.git
synced 2026-06-10 02:13:40 +08:00
Add failing encoder test case for too many combo colours
This commit is contained in:
@@ -28,6 +28,7 @@ using osu.Game.Skinning;
|
||||
using osu.Game.Storyboards;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Beatmaps.Formats
|
||||
{
|
||||
@@ -184,6 +185,32 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.That(decodedSlider.Path.ControlPoints.Count, Is.EqualTo(5));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestOnlyEightComboColoursEncoded()
|
||||
{
|
||||
var beatmapSkin = new LegacyBeatmapSkin(new BeatmapInfo(), null)
|
||||
{
|
||||
Configuration =
|
||||
{
|
||||
CustomComboColours =
|
||||
{
|
||||
new Color4(1, 1, 1, 255),
|
||||
new Color4(2, 2, 2, 255),
|
||||
new Color4(3, 3, 3, 255),
|
||||
new Color4(4, 4, 4, 255),
|
||||
new Color4(5, 5, 5, 255),
|
||||
new Color4(6, 6, 6, 255),
|
||||
new Color4(7, 7, 7, 255),
|
||||
new Color4(8, 8, 8, 255),
|
||||
new Color4(9, 9, 9, 255),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var decodedAfterEncode = decodeFromLegacy(encodeToLegacy((new Beatmap(), beatmapSkin)), string.Empty);
|
||||
Assert.That(decodedAfterEncode.skin.Configuration.CustomComboColours, Has.Count.EqualTo(8));
|
||||
}
|
||||
|
||||
private bool areComboColoursEqual(IHasComboColours a, IHasComboColours b)
|
||||
{
|
||||
// equal to null, no need to SequenceEqual
|
||||
@@ -212,6 +239,8 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
{
|
||||
var beatmap = new LegacyBeatmapDecoder { ApplyOffsets = false }.Decode(reader);
|
||||
var beatmapSkin = new TestLegacySkin(beatmaps_resource_store, name);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
beatmapSkin.Configuration = new LegacySkinDecoder().Decode(reader);
|
||||
return (convert(beatmap), beatmapSkin);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user