Skip to content

Commit

Permalink
Apply nullability to all remaining tests where it wasn't applied
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Aug 9, 2023
1 parent 6549ca5 commit 4e83245
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 20 deletions.
2 changes: 0 additions & 2 deletions osu.Game.Tournament.Tests/Components/TestSceneDateTextBox.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using NUnit.Framework;
using osu.Game.Tests.Visual;
using osu.Game.Tournament.Components;
Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
Expand All @@ -22,7 +20,7 @@ public partial class TestSceneSongBar : OsuTestScene
[Test]
public void TestSongBar()
{
SongBar songBar = null;
SongBar songBar = null!;

AddStep("create bar", () => Child = songBar = new SongBar
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand Down
2 changes: 0 additions & 2 deletions osu.Game.Tournament.Tests/NonVisual/DataLoadTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using System;
using System.IO;
using System.Threading.Tasks;
Expand Down
6 changes: 2 additions & 4 deletions osu.Game.Tournament.Tests/NonVisual/IPCLocationTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using System.IO;
using System.Linq;
using NUnit.Framework;
Expand Down Expand Up @@ -36,11 +34,11 @@ public void CheckIPCLocation()
{
var osu = LoadTournament(host);
TournamentStorage storage = (TournamentStorage)osu.Dependencies.Get<Storage>();
FileBasedIPC ipc = null;
FileBasedIPC? ipc = null;

WaitForOrAssert(() => (ipc = osu.Dependencies.Get<MatchIPCInfo>() as FileBasedIPC)?.IsLoaded == true, @"ipc could not be populated in a reasonable amount of time");

Assert.True(ipc.SetIPCLocation(testStableInstallDirectory));
Assert.True(ipc!.SetIPCLocation(testStableInstallDirectory));
Assert.True(storage.AllTournaments.Exists("stable.json"));
}
finally
Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Tournament.Tests/NonVisual/TournamentHostTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using System;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -13,7 +11,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
{
public abstract class TournamentHostTest
{
public static TournamentGameBase LoadTournament(GameHost host, TournamentGameBase tournament = null)
public static TournamentGameBase LoadTournament(GameHost host, TournamentGameBase? tournament = null)
{
tournament ??= new TournamentGameBase();
Task.Factory.StartNew(() => host.Run(tournament), TaskCreationOptions.LongRunning)
Expand Down
2 changes: 0 additions & 2 deletions osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
Expand Down
2 changes: 0 additions & 2 deletions osu.Game.Tournament.Tests/Screens/TestSceneScheduleScreen.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

#nullable disable

using System;
using NUnit.Framework;
using osu.Framework.Allocation;
Expand Down

0 comments on commit 4e83245

Please sign in to comment.