Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
khang06 committed Aug 24, 2022
1 parent 9c6968e commit adea29c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -931,16 +931,14 @@ public void TestNaNControlPoints()
var controlPoints = (LegacyControlPointInfo)decoder.Decode(stream).ControlPointInfo;

Assert.That(controlPoints.TimingPoints.Count, Is.EqualTo(1));
Assert.That(controlPoints.DifficultyPoints.Count, Is.EqualTo(3));
Assert.That(controlPoints.DifficultyPoints.Count, Is.EqualTo(2));

Assert.That(controlPoints.TimingPointAt(1000).BeatLength, Is.EqualTo(500));

Assert.That(controlPoints.DifficultyPointAt(1000).SliderVelocity, Is.EqualTo(1));
Assert.That(controlPoints.DifficultyPointAt(2000).SliderVelocity, Is.EqualTo(1));
Assert.That(controlPoints.DifficultyPointAt(3000).SliderVelocity, Is.EqualTo(1));

#pragma warning disable 618
Assert.That(((LegacyBeatmapDecoder.LegacyDifficultyControlPoint)controlPoints.DifficultyPointAt(1000)).GenerateTicks, Is.True);
Assert.That(((LegacyBeatmapDecoder.LegacyDifficultyControlPoint)controlPoints.DifficultyPointAt(2000)).GenerateTicks, Is.False);
Assert.That(((LegacyBeatmapDecoder.LegacyDifficultyControlPoint)controlPoints.DifficultyPointAt(3000)).GenerateTicks, Is.True);
#pragma warning restore 618
Expand Down
5 changes: 2 additions & 3 deletions osu.Game/Beatmaps/Formats/LegacyDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ public LegacyDifficultyControlPoint()
}

public override bool IsRedundant(ControlPoint? existing)
=> existing is LegacyDifficultyControlPoint existingLegacyDifficulty
&& base.IsRedundant(existing)
&& GenerateTicks == existingLegacyDifficulty.GenerateTicks;
=> base.IsRedundant(existing)
&& GenerateTicks == ((existing as LegacyDifficultyControlPoint)?.GenerateTicks ?? true);

public override void CopyFrom(ControlPoint other)
{
Expand Down

0 comments on commit adea29c

Please sign in to comment.