mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:02:54 +08:00
Remove all usage of !something!.something
aka don't mix NRT forgiving syntax with not syntax
This commit is contained in:
parent
ae2896ba7e
commit
8978f2ddd8
@ -163,7 +163,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
InputManager.Key(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
AddAssert("ensure selection changed", () => selected != Beatmap.Value);
|
AddAssert("ensure selection changed", () => selected != Beatmap.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
InputManager.Key(Key.Down);
|
InputManager.Key(Key.Down);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
AddAssert("ensure selection didn't change", () => selected == Beatmap.Value);
|
AddAssert("ensure selection didn't change", () => selected == Beatmap.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
InputManager.Key(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
AddAssert("ensure selection changed", () => selected != Beatmap.Value);
|
AddAssert("ensure selection changed", () => selected != Beatmap.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
InputManager.ReleaseButton(MouseButton.Left);
|
InputManager.ReleaseButton(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
AddAssert("ensure selection didn't change", () => selected == Beatmap.Value);
|
AddAssert("ensure selection didn't change", () => selected == Beatmap.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
createSongSelect();
|
createSongSelect();
|
||||||
|
|
||||||
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
|
|
||||||
AddStep("return", () => songSelect!.MakeCurrent());
|
AddStep("return", () => songSelect!.MakeCurrent());
|
||||||
AddUntilStep("wait for current", () => songSelect!.IsCurrentScreen());
|
AddUntilStep("wait for current", () => songSelect!.IsCurrentScreen());
|
||||||
@ -275,7 +275,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
createSongSelect();
|
createSongSelect();
|
||||||
|
|
||||||
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
|
|
||||||
AddStep("change convert setting", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
|
AddStep("change convert setting", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
createSongSelect();
|
createSongSelect();
|
||||||
|
|
||||||
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
|
||||||
AddUntilStep("wait for not current", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
|
|
||||||
AddStep("update beatmap", () =>
|
AddStep("update beatmap", () =>
|
||||||
{
|
{
|
||||||
@ -1011,7 +1011,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for results screen presented", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
|
|
||||||
AddAssert("check beatmap is correct for score", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(getPresentBeatmap()));
|
AddAssert("check beatmap is correct for score", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(getPresentBeatmap()));
|
||||||
AddAssert("check ruleset is correct for score", () => Ruleset.Value.OnlineID == 0);
|
AddAssert("check ruleset is correct for score", () => Ruleset.Value.OnlineID == 0);
|
||||||
@ -1040,7 +1040,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
songSelect!.PresentScore(TestResources.CreateTestScoreInfo(getPresentBeatmap()));
|
songSelect!.PresentScore(TestResources.CreateTestScoreInfo(getPresentBeatmap()));
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for results screen presented", () => !songSelect!.IsCurrentScreen());
|
waitForDismissed();
|
||||||
|
|
||||||
AddAssert("check beatmap is correct for score", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(getPresentBeatmap()));
|
AddAssert("check beatmap is correct for score", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(getPresentBeatmap()));
|
||||||
AddAssert("check ruleset is correct for score", () => Ruleset.Value.OnlineID == 0);
|
AddAssert("check ruleset is correct for score", () => Ruleset.Value.OnlineID == 0);
|
||||||
@ -1161,6 +1161,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
rulesets.Dispose();
|
rulesets.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void waitForDismissed() => AddUntilStep("wait for not current", () => !songSelect.AsNonNull().IsCurrentScreen());
|
||||||
|
|
||||||
private partial class TestSongSelect : PlaySongSelect
|
private partial class TestSongSelect : PlaySongSelect
|
||||||
{
|
{
|
||||||
public Action? StartRequested;
|
public Action? StartRequested;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using osu.Framework.Development;
|
using osu.Framework.Development;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Statistics;
|
using osu.Framework.Statistics;
|
||||||
using Realms;
|
using Realms;
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
Debug.Assert(ThreadSafety.IsUpdateThread);
|
Debug.Assert(ThreadSafety.IsUpdateThread);
|
||||||
|
|
||||||
if (dataIsFromUpdateThread && !data.Realm!.IsClosed)
|
if (dataIsFromUpdateThread && !data.Realm.AsNonNull().IsClosed)
|
||||||
{
|
{
|
||||||
RealmLiveStatistics.USAGE_UPDATE_IMMEDIATE.Value++;
|
RealmLiveStatistics.USAGE_UPDATE_IMMEDIATE.Value++;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user