mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Add tests covering precision case
This commit is contained in:
parent
1a4817879e
commit
7c6ccce3ba
@ -362,6 +362,23 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeControlPointDifficultyChange()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("controlpoint-difficulty-multiplier.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var controlPointInfo = decoder.Decode(stream).ControlPointInfo;
|
||||
|
||||
Assert.That(controlPointInfo.DifficultyPointAt(5).SpeedMultiplier, Is.EqualTo(1));
|
||||
Assert.That(controlPointInfo.DifficultyPointAt(1000).SpeedMultiplier, Is.EqualTo(10));
|
||||
Assert.That(controlPointInfo.DifficultyPointAt(2000).SpeedMultiplier, Is.EqualTo(1.8518518518518519d));
|
||||
Assert.That(controlPointInfo.DifficultyPointAt(3000).SpeedMultiplier, Is.EqualTo(0.5));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeControlPointCustomSampleBank()
|
||||
{
|
||||
|
@ -0,0 +1,8 @@
|
||||
osu file format v7
|
||||
|
||||
[TimingPoints]
|
||||
0,100,4,2,0,100,1,0
|
||||
12,500,4,2,0,100,1,0
|
||||
1000,-10,4,2,0,100,0,0
|
||||
2000,-54,4,2,0,100,0,0
|
||||
3000,-200,4,2,0,100,0,0
|
Loading…
Reference in New Issue
Block a user