mirror of
https://github.com/ppy/osu
synced 2025-01-11 16:49:39 +00:00
Add failing test
This commit is contained in:
parent
537c9e031d
commit
26855a2c04
@ -15,12 +15,14 @@ using osu.Game.IO;
|
|||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Catch;
|
using osu.Game.Rulesets.Catch;
|
||||||
using osu.Game.Rulesets.Catch.Beatmaps;
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mania;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Legacy;
|
using osu.Game.Rulesets.Objects.Legacy;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Taiko;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Tests.Resources;
|
using osu.Game.Tests.Resources;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -1156,5 +1158,35 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.That(((IHasComboInformation)playable.HitObjects[17]).ComboIndexWithOffsets, Is.EqualTo(9));
|
Assert.That(((IHasComboInformation)playable.HitObjects[17]).ComboIndexWithOffsets, Is.EqualTo(9));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSliderConversionWithCustomDistance([Values("taiko", "mania")] string rulesetName)
|
||||||
|
{
|
||||||
|
using (var resStream = TestResources.OpenResource("custom-slider-length.osu"))
|
||||||
|
using (var stream = new LineBufferedReader(resStream))
|
||||||
|
{
|
||||||
|
Ruleset ruleset;
|
||||||
|
|
||||||
|
switch (rulesetName)
|
||||||
|
{
|
||||||
|
case "taiko":
|
||||||
|
ruleset = new TaikoRuleset();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "mania":
|
||||||
|
ruleset = new ManiaRuleset();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(rulesetName), rulesetName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
var decoder = Decoder.GetDecoder<Beatmap>(stream);
|
||||||
|
var working = new TestWorkingBeatmap(decoder.Decode(stream));
|
||||||
|
IBeatmap beatmap = working.GetPlayableBeatmap(ruleset.RulesetInfo, Array.Empty<Mod>());
|
||||||
|
|
||||||
|
Assert.That(beatmap.HitObjects[0].GetEndTime(), Is.EqualTo(3153));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
osu.Game.Tests/Resources/custom-slider-length.osu
Normal file
19
osu.Game.Tests/Resources/custom-slider-length.osu
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[General]
|
||||||
|
Mode: 0
|
||||||
|
|
||||||
|
[Difficulty]
|
||||||
|
HPDrainRate:6
|
||||||
|
CircleSize:7
|
||||||
|
OverallDifficulty:7
|
||||||
|
ApproachRate:10
|
||||||
|
SliderMultiplier:1.7
|
||||||
|
SliderTickRate:1
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
29,333.333333333333,4,1,0,100,1,0
|
||||||
|
29,-10000,4,1,0,100,0,0
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
256,192,29,6,0,P|384:192|384:192,1,159.375
|
Loading…
Reference in New Issue
Block a user