Skip to content

Commit

Permalink
Fix StringLoader GetString
Browse files Browse the repository at this point in the history
  • Loading branch information
AliveDevil committed Sep 3, 2024
1 parent ca94ddb commit f517ea9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageReference Update="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
<PackageReference Update="Microsoft.Windows.CsWin32" Version="0.3.106" />
<PackageReference Update="Microsoft.Windows.SDK.Contracts" Version="10.0.22000.196" />
<PackageReference Update="NUnit" Version="4.1.0" />
<PackageReference Update="NUnit" Version="4.2.0" />
<PackageReference Update="NUnit.Console" Version="3.17.0" />
<PackageReference Update="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Update="ObjectListView.Official" Version="2.9.1" />
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/csharp/Windows/Win32/PCWSTR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public static PCWSTR DangerousFromSpan(in ReadOnlySpan<char> value)

public PWSTR DangerousAsPWSTR() => Value;

public string ToString(int length) => Value is null ? new string(Value, 0, length) : null;
public readonly string ToString(int length) => Value is null ? null : new string(Value, 0, length);
}
16 changes: 16 additions & 0 deletions core/src/test/csharp/ch/cyberduck/core/I18n/StringLoaderTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Ch.Cyberduck.Core.I18n;
using NUnit.Framework;

namespace Cyberduck.Core.Test.I18n
{
[TestFixture]
public class StringLoaderTest
{
[Test]
public void LoadString()
{
using StringLoader stringLoader = new();
Assert.That(stringLoader.GetString(30396u), Is.Not.WhiteSpace);
}
}
}

0 comments on commit f517ea9

Please sign in to comment.