1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Increase test lenience

This commit is contained in:
smoogipoo 2021-10-01 22:58:40 +09:00
parent 0ee148b53f
commit 4e3d9da22d

View File

@ -84,17 +84,17 @@ namespace osu.Game.Tests.Visual.Gameplay
Remove(expectedComponentsAdjustmentContainer); Remove(expectedComponentsAdjustmentContainer);
return almostEqual(actualInfo, expectedInfo); return almostEqual(actualInfo, expectedInfo);
}
static bool almostEqual(SkinnableInfo info, SkinnableInfo other) => private static bool almostEqual(SkinnableInfo info, SkinnableInfo other) =>
other != null other != null
&& info.Type == other.Type && info.Type == other.Type
&& info.Anchor == other.Anchor && info.Anchor == other.Anchor
&& info.Origin == other.Origin && info.Origin == other.Origin
&& Precision.AlmostEquals(info.Position, other.Position) && Precision.AlmostEquals(info.Position, other.Position, 1)
&& Precision.AlmostEquals(info.Scale, other.Scale) && Precision.AlmostEquals(info.Scale, other.Scale)
&& Precision.AlmostEquals(info.Rotation, other.Rotation) && Precision.AlmostEquals(info.Rotation, other.Rotation)
&& info.Children.SequenceEqual(other.Children, new FuncEqualityComparer<SkinnableInfo>(almostEqual)); && info.Children.SequenceEqual(other.Children, new FuncEqualityComparer<SkinnableInfo>(almostEqual));
}
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null) protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
=> new CustomSkinWorkingBeatmap(beatmap, storyboard, Clock, Audio, currentBeatmapSkin); => new CustomSkinWorkingBeatmap(beatmap, storyboard, Clock, Audio, currentBeatmapSkin);