Mark the private property in the test case as non-null.

This commit is contained in:
andy840119
2022-07-04 20:33:03 +08:00
parent 2d45908690
commit 591b92eb04
19 changed files with 25 additions and 25 deletions

View File

@@ -14,7 +14,7 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public class BenchmarkBeginAbsoluteSequence : GameBenchmark
{
private TestGame game;
private TestGame game = null!;
[Test]
[Benchmark]

View File

@@ -11,7 +11,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkCompositeDrawableAllocations : GameBenchmark
{
private TestGame game;
private TestGame game = null!;
[Test]
[Benchmark]

View File

@@ -18,9 +18,9 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkDependencyContainer : GameBenchmark
{
private Game game;
private TestBdlReceiver bdlReceiver;
private TestCachedReceiver cachedReceiver;
private Game game = null!;
private TestBdlReceiver bdlReceiver = null!;
private TestCachedReceiver cachedReceiver = null!;
public override void SetUp()
{

View File

@@ -14,7 +14,7 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public class BenchmarkDrawableLoad : GameBenchmark
{
private TestGame game;
private TestGame game = null!;
private const int nesting_level = 100;

View File

@@ -12,7 +12,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkFillFlowContainerAllocations : GameBenchmark
{
private TestGame game;
private TestGame game = null!;
[Benchmark]
public void MultipleComputeLayoutPositions()

View File

@@ -16,8 +16,8 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkFontLoading : BenchmarkTest
{
private NamespacedResourceStore<byte[]> baseResources;
private TemporaryNativeStorage sharedTemp;
private NamespacedResourceStore<byte[]> baseResources = null!;
private TemporaryNativeStorage sharedTemp = null!;
public override void SetUp()
{

View File

@@ -12,7 +12,7 @@ namespace osu.Framework.Benchmarks
public class BenchmarkHashing
{
private const string test_string = @"A string with reasonable length";
private MemoryStream memoryStream;
private MemoryStream memoryStream = null!;
[Benchmark]
public string StringMD5() => test_string.ComputeMD5Hash();

View File

@@ -9,7 +9,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkLocalisableDescription
{
private LocalisableString[] descriptions;
private LocalisableString[] descriptions = null!;
[Params(1, 10, 100, 1000)]
public int Times { get; set; }

View File

@@ -10,8 +10,8 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public class BenchmarkLocalisableString
{
private string string1;
private string string2;
private string string1 = null!;
private string string2 = null!;
private LocalisableString localisableString1;
private LocalisableString localisableString2;
private LocalisableString romanisableString1;

View File

@@ -12,8 +12,8 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public class BenchmarkLocalisedBindableString
{
private LocalisationManager manager;
private TemporaryNativeStorage storage;
private LocalisationManager manager = null!;
private TemporaryNativeStorage storage = null!;
[GlobalSetup]
public void GlobalSetup()

View File

@@ -13,7 +13,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkManySpinningBoxes : GameBenchmark
{
private TestGame game;
private TestGame game = null!;
[Test]
[Benchmark]

View File

@@ -9,7 +9,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkScreenExtensions : GameBenchmark
{
private Screen testScreen;
private Screen testScreen = null!;
[Test]
[Benchmark]

View File

@@ -11,7 +11,7 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public class BenchmarkStreamExtensions
{
private MemoryStream memoryStream;
private MemoryStream memoryStream = null!;
[Params(100, 10000, 1000000)]
public int Length { get; set; }

View File

@@ -9,7 +9,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkTabletDriver : BenchmarkTest
{
private TabletDriver driver;
private TabletDriver driver = null!;
public override void SetUp()
{

View File

@@ -13,7 +13,7 @@ namespace osu.Framework.Benchmarks
{
private readonly ITexturedGlyphLookupStore store = new TestStore();
private TextBuilder textBuilder;
private TextBuilder textBuilder = null!;
[Benchmark]
public void AddCharacters() => initialiseBuilder(false);

View File

@@ -13,7 +13,7 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkTransform : BenchmarkTest
{
private Drawable target;
private Drawable target = null!;
public override void SetUp()
{

View File

@@ -11,8 +11,8 @@ namespace osu.Framework.Benchmarks
{
public class BenchmarkTransformUpdate : BenchmarkTest
{
private TestBox target;
private TestBox targetNoTransforms;
private TestBox target = null!;
private TestBox targetNoTransforms = null!;
public override void SetUp()
{

View File

@@ -14,7 +14,7 @@ namespace osu.Framework.Benchmarks
public int ItemCount { get; set; }
private readonly object[] objects = new object[1000];
private WeakList<object> weakList;
private WeakList<object> weakList = null!;
public override void SetUp()
{

View File

@@ -15,7 +15,7 @@ namespace osu.Framework.Benchmarks
[MemoryDiagnoser]
public abstract class GameBenchmark
{
private ManualGameHost gameHost;
private ManualGameHost gameHost = null!;
protected Game Game { get; private set; }