Make sure we don't include the null terminator

This commit is contained in:
Bond_009
2026-06-16 17:45:22 +02:00
parent 0022508889
commit 4c228eaf63

View File

@@ -13,6 +13,10 @@ public class ApplePlatformHelperTests
{
Assert.SkipUnless(OperatingSystem.IsMacOS(), "macOS-only test");
Assert.NotEmpty(ApplePlatformHelper.GetSysctlValue("machdep.cpu.brand_string"));
var value = ApplePlatformHelper.GetSysctlValue("machdep.cpu.brand_string");
Assert.NotEmpty(value);
// Make sure we don't include the null terminator
Assert.DoesNotContain("\0", value, StringComparison.Ordinal);
}
}