From 8ccd6a4e4a80dad2774f48df1a38ac2774a9db5d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 May 2025 18:16:45 +0900 Subject: [PATCH] Update test helper methods to use non-reference comparison This isn't strictly required, but there should be no gaurantee or requirement that the references are equal in these checks, so it's best change them as such. --- .../Visual/SongSelectV2/BeatmapCarouselTestScene.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs b/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs index f92abd1063..9073f7879d 100644 --- a/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs +++ b/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs @@ -220,7 +220,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2 // offset by one because the group itself is included in the items list. CarouselItem item = groupingFilter.GroupItems[g].ElementAt(panel + 1); - return ReferenceEquals(Carousel.CurrentSelection, item.Model); + return (Carousel.CurrentSelection as BeatmapInfo)? + .Equals(item.Model as BeatmapInfo) == true; }); } @@ -229,7 +230,10 @@ namespace osu.Game.Tests.Visual.SongSelectV2 AddUntilStep($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () => { if (diff != null) - return ReferenceEquals(Carousel.CurrentSelection, BeatmapSets[set].Beatmaps[diff.Value]); + { + return (Carousel.CurrentSelection as BeatmapInfo)? + .Equals(BeatmapSets[set].Beatmaps[diff.Value]) == true; + } return BeatmapSets[set].Beatmaps.Contains(Carousel.CurrentSelection); });