mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 04:32:57 +08:00
Added tests for difficulty clamping
This commit is contained in:
parent
b25987ffe7
commit
f3cae73e2e
@ -1188,5 +1188,35 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
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
|
10
osu.Game.Tests/Resources/out-of-range-difficulties.osu
Normal file
10
osu.Game.Tests/Resources/out-of-range-difficulties.osu
Normal file
@ -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
Block a user