Skip to content

Commit

Permalink
Update InspectCode warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Nov 27, 2024
1 parent 9c9b8ad commit 62deab7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Bindables/BindableDoubleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void TestParsingNumberLocale(double value, string locale, string expected
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(locale);

var bindable = new BindableDouble(value);
string? asString = bindable.ToString();
string asString = bindable.ToString();
Assert.AreEqual(expected, asString);
Assert.DoesNotThrow(() => bindable.Parse(asString, CultureInfo.CurrentCulture));
Assert.AreEqual(value, bindable.Value, Precision.DOUBLE_EPSILON);
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Bindables/BindableFloatTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void TestParsingNumberLocale(float value, string locale, string expected)
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(locale);

var bindable = new BindableFloat(value);
string? asString = bindable.ToString();
string asString = bindable.ToString();
Assert.AreEqual(expected, asString);
Assert.DoesNotThrow(() => bindable.Parse(asString, CultureInfo.CurrentCulture));
Assert.AreEqual(value, bindable.Value, Precision.FLOAT_EPSILON);
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Bindables/BindableLeasingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void TestDoubleLeaseFails()
public void TestIncorrectEndLease()
{
// end a lease when no lease exists.
Assert.Throws<InvalidOperationException>(() => original.EndLease(null));
Assert.Throws<InvalidOperationException>(() => original.EndLease(null!));

// end a lease with an incorrect bindable
original.BeginLease(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ protected override void LoadComplete()
}));
}

private void updateText() => valueText.Text = bindable.ToString() ?? "<null>";
private void updateText() => valueText.Text = bindable?.ToString() ?? "<null>";

Check failure on line 62 in osu.Framework.Tests/Visual/Platform/FrameworkConfigVisualiser.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Conditional access qualifier expression is never null according to nullable reference types' annotations in osu.Framework.Tests\Visual\Platform\FrameworkConfigVisualiser.cs on line 62
}
}

0 comments on commit 62deab7

Please sign in to comment.