Skip to content

Commit 8114fe2

Browse files
fix: CI errors/warnings - remove redundant usings, fix test assertions, fix WebSocket overflow detection
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/b965837f-dc52-435f-adcf-02194826dc56 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 108d9cb commit 8114fe2

12 files changed

Lines changed: 13 additions & 16 deletions

File tree

osu.Game.Rulesets.Catch.Tests/TestSceneHyperDashColouring.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private Drawable setupSkinHierarchy(Drawable child, ISkin skin)
187187

188188
private bool checkLegacyFruitHyperDashColour(DrawableFruit fruit, Colour4 expectedColour) =>
189189
fruit.ChildrenOfType<SkinnableDrawable>().FirstOrDefault()?.Drawable.ChildrenOfType<Sprite>()
190-
.Any(c => c.Colour.TopLeft.SRGB.R == expectedColour.R && c.Colour.TopLeft.SRGB.G == expectedColour.G && c.Colour.TopLeft.SRGB.B == expectedColour.B) == true;
190+
.Any(c => c.Colour == expectedColour) == true;
191191

192192
private class TestSkin : LegacySkin
193193
{

osu.Game.Rulesets.Osu/OsuRuleset.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4-
using System;
54
using System.Collections.Generic;
65
using System.Linq;
76
using System.Numerics;

osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
using System;
77
using System.Diagnostics;
8-
using System.Linq;
98
using JetBrains.Annotations;
109
using osu.Framework.Allocation;
1110
using osu.Framework.Bindables;

osu.Game.Tests/Skins/TestSceneSkinResources.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ public void TestSampleRetrievalOrder()
7777

7878
AddAssert("sample lookups were in correct order", () =>
7979
{
80+
// OptimizedResourceStore.AudioFallbackRules redirects .wav/.mp3 to try .ogg first (better compression).
81+
// The actual lookup order is: no-ext, ogg (wav fallback), wav, ogg (mp3 fallback), mp3, ogg (direct).
8082
string[] lookups = lookedUpFileNames.Where(f => f.StartsWith(TestSkin.SAMPLE_NAME, StringComparison.Ordinal)).ToArray();
81-
return Path.GetExtension(lookups[0]) == string.Empty
82-
&& Path.GetExtension(lookups[1]) == ".wav"
83-
&& Path.GetExtension(lookups[2]) == ".mp3"
84-
&& Path.GetExtension(lookups[3]) == ".ogg";
83+
return lookups.Length >= 6
84+
&& Path.GetExtension(lookups[0]) == string.Empty
85+
&& Path.GetExtension(lookups[1]) == ".ogg"
86+
&& Path.GetExtension(lookups[2]) == ".wav"
87+
&& Path.GetExtension(lookups[3]) == ".ogg"
88+
&& Path.GetExtension(lookups[4]) == ".mp3"
89+
&& Path.GetExtension(lookups[5]) == ".ogg";
8590
});
8691
}
8792

osu.Game.Tests/Visual/Gameplay/TestSceneDrawableScrollingRuleset.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ private void assertChildPosition(int index) => AddAssert($"hitobject {index} chi
235235
yScale * (float)((TestParentHitObject)d.HitObject).ChildTimeOffset / time_range, 0.1f);
236236
});
237237

238-
private void assertPosition(int index, float relativeY) => AddAssert($"hitobject {index} at {relativeY}",
239-
() => getDrawableHitObject(index)?.DrawPosition.Y / yScale ?? -1, () => Is.EqualTo(relativeY).Within(Precision.FLOAT_EPSILON));
238+
private void assertPosition(int index, float relativeY) => AddUntilStep($"hitobject {index} at {relativeY}",
239+
() => Precision.AlmostEquals(getDrawableHitObject(index)?.DrawPosition.Y / yScale ?? -1, relativeY, Precision.FLOAT_EPSILON));
240240

241241
private void setTime(double time)
242242
{

osu.Game.Tests/Visual/Gameplay/TestSceneScrollingHitObjects.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#nullable disable
55

6-
using System;
76
using System.Collections.Generic;
87
using System.Linq;
98
using System.Numerics;

osu.Game.Tests/Visual/Multiplayer/TestScenePlaylistsSongSelect.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4-
using System;
54
using System.Linq;
65
using NUnit.Framework;
76
using osu.Framework.Allocation;

osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#nullable disable
55

6-
using System;
76
using System.Collections.Generic;
87
using System.Linq;
98
using NUnit.Framework;

osu.Game.Tests/Visual/Online/TestSceneGraph.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4-
using System;
54
using System.Linq;
65
using System.Numerics;
76
using NUnit.Framework;

osu.Game.Tests/Visual/SongSelect/TestSceneSongSelectFiltering.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4-
using System;
54
using System.Linq;
65
using NUnit.Framework;
76
using osu.Framework.Graphics.Containers;

0 commit comments

Comments
 (0)