mirror of
https://github.com/ppy/osu.git
synced 2024-11-09 09:37:42 +08:00
a407e267a2
Upon investigating an user report in #6091 that indicated that viewing replays using the Perfect mod would also display the Sudden Death mod icon despite Perfect being the more restrictive of the two, it turned out that the logic of importing legacy scores was missing that corner case. A similar case of Double Time/Nightcore mutual exclusion was handled, but PF/SD was missed. Add analogous handling of PF/SD legacy mods for all four rulesets, and additionally cover a tiny fraction of all cases with unit tests. The most problematic cases (NC+HD and PF+SD) are covered in all four basic rulesets.
30 lines
1.6 KiB
C#
30 lines
1.6 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System;
|
|
using NUnit.Framework;
|
|
using osu.Game.Beatmaps.Legacy;
|
|
using osu.Game.Rulesets.Catch.Mods;
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Tests
|
|
{
|
|
[TestFixture]
|
|
public class CatchLegacyModConversionTest : LegacyModConversionTest
|
|
{
|
|
[TestCase(LegacyMods.Easy, new[] { typeof(CatchModEasy) })]
|
|
[TestCase(LegacyMods.HardRock | LegacyMods.DoubleTime, new[] { typeof(CatchModHardRock), typeof(CatchModDoubleTime) })]
|
|
[TestCase(LegacyMods.DoubleTime, new[] { typeof(CatchModDoubleTime) })]
|
|
[TestCase(LegacyMods.Nightcore, new[] { typeof(CatchModNightcore) })]
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(CatchModNightcore) })]
|
|
[TestCase(LegacyMods.Flashlight | LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(CatchModFlashlight), typeof(CatchModNightcore) })]
|
|
[TestCase(LegacyMods.Perfect, new[] { typeof(CatchModPerfect) })]
|
|
[TestCase(LegacyMods.SuddenDeath, new[] { typeof(CatchModSuddenDeath) })]
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(CatchModPerfect) })]
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath | LegacyMods.DoubleTime, new[] { typeof(CatchModDoubleTime), typeof(CatchModPerfect) })]
|
|
public new void Test(LegacyMods legacyMods, Type[] expectedMods) => base.Test(legacyMods, expectedMods);
|
|
|
|
protected override Ruleset CreateRuleset() => new CatchRuleset();
|
|
}
|
|
}
|