Skip to content

Commit

Permalink
resolve some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AnakinRaW committed Jan 10, 2025
1 parent cbd4150 commit 207302f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions test/AET.SteamAbstraction.Test/Vdf/VObjectFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public void DeepCloneWorksCorrectly()
};

var clone = original.DeepClone() as VObject;
clone["key1"] = new VValue("value2");
clone!["key1"] = new VValue("value2");

Assert.True(((VValue)original["key1"]).Value.Equals("value1"));
Assert.True(((VValue)original["key1"]!).Value!.Equals("value1"));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion test/AET.SteamAbstraction.Test/Vdf/VPropertyFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void DeepCloneWorksCorrectly()
});

var clone = original.DeepClone() as VProperty;
clone.Value = new VValue("value3");
clone!.Value = new VValue("value3");

Assert.True(original.Value is VObject);
}
Expand Down
4 changes: 2 additions & 2 deletions test/AET.SteamAbstraction.Test/Vdf/VValueFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public void DeepCloneWorksCorrectly()
var original = new VValue("value1");

var clone = original.DeepClone() as VValue;
clone.Value = "value2";
clone!.Value = "value2";

Assert.True(original.Value.Equals("value1"));
Assert.True(original.Value!.Equals("value1"));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal WindowsSteamRegistry CreateWindowsRegistry(bool steamExists = true)
if (steamExists)
{
using var hkcu = InternalRegistry.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default);
using var steamKey = hkcu.CreateSubKey("Software\\Valve\\Steam");
using var steamKey = hkcu.CreateSubKey("Software\\Valve\\Steam")!;

steamKey.SetValue("SteamExe", FileSystem.Path.GetFullPath(SteamExePath));
steamKey.SetValue("SteamPath", FileSystem.Path.GetFullPath(SteamInstallPath));
Expand All @@ -40,7 +40,7 @@ private protected override ISteamRegistry CreateRegistry(bool steamExists = true
protected override void SetSteamPid(int pid)
{
using var hkcu = InternalRegistry.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default);
using var steamKey = hkcu.CreateSubKey("Software\\Valve\\Steam\\ActiveProcess");
using var steamKey = hkcu.CreateSubKey("Software\\Valve\\Steam\\ActiveProcess")!;
steamKey.SetValue("pid", pid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void TestEquality()

private class NamedArgB(string name, string value, bool isDebug) : NamedArgument<string>(name, value, isDebug);
private class NamedArgC(string name, uint value, bool isDebug) : NamedArgument<uint>(name, value, isDebug);
#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
private class NamedArgNullable(string name, uint? value, bool isDebug) : NamedArgument<uint?>(name, value, isDebug);
#pragma warning restore CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.

}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void Constructor_ThrowsForNotStartedProcess()
}

[Fact]
public async Task ClosedEvent_IsRaisedWhenProcessExits()
public void ClosedEvent_IsRaisedWhenProcessExits()
{
var process = StartStableTestProcess();
var processInfo = new GameProcessInfo(Game, GameBuildType.Release, ArgumentCollection.Empty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static void InstallModsLocations(this MockFileSystem fileSystem, IDirect

private static void CreateFile(IFileSystem fs, string path)
{
var dir = fs.Path.GetDirectoryName(path);
var dir = fs.Path.GetDirectoryName(path)!;
fs.Directory.CreateDirectory(dir);
using var file = fs.File.Create(path);
}
Expand Down

0 comments on commit 207302f

Please sign in to comment.