mirror of https://github.com/ppy/osu
Added tests for difficulty clamping
This commit is contained in:
parent
b25987ffe7
commit
f3cae73e2e
|
@ -1188,5 +1188,35 @@ public void TestSliderConversionWithCustomDistance([Values("taiko", "mania")] st
|
|||
Assert.That(beatmap.HitObjects[0].GetEndTime(), Is.EqualTo(3153));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBeatmapDifficultyIsClamped()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("out-of-range-difficulties.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoded = decoder.Decode(stream).Difficulty;
|
||||
Assert.That(decoded.DrainRate, Is.EqualTo(10));
|
||||
Assert.That(decoded.CircleSize, Is.EqualTo(10));
|
||||
Assert.That(decoded.OverallDifficulty, Is.EqualTo(10));
|
||||
Assert.That(decoded.ApproachRate, Is.EqualTo(10));
|
||||
Assert.That(decoded.SliderMultiplier, Is.EqualTo(3.6));
|
||||
Assert.That(decoded.SliderTickRate, Is.EqualTo(8));
|
||||
}
|
||||
}
|
||||
[Test]
|
||||
public void TestManiaBeatmapDifficultyCircleSizeClamp()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("out-of-range-difficulties-mania.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoded = decoder.Decode(stream).Difficulty;
|
||||
Assert.That(decoded.CircleSize, Is.EqualTo(14));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[General]
|
||||
Mode: 3
|
||||
|
||||
[Difficulty]
|
||||
CircleSize:14
|
|
@ -0,0 +1,10 @@
|
|||
[General]
|
||||
Mode: 0
|
||||
|
||||
[Difficulty]
|
||||
HPDrainRate:25
|
||||
CircleSize:25
|
||||
OverallDifficulty:25
|
||||
ApproachRate:30
|
||||
SliderMultiplier:30
|
||||
SliderTickRate:30
|
Loading…
Reference in New Issue