Skip to content

Commit

Permalink
SecureMemoryTests.cs: Fix failing test on GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-lucas6 committed Dec 8, 2024
1 parent 889bdd8 commit 861f3f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Geralt.Tests/SecureMemoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public void LockMemory_UnlockAndZeroMemory_InvalidOperation()
var b = new byte[SecureMemory.PageSize * 65536];

Assert.ThrowsException<OutOfMemoryException>(() => SecureMemory.LockMemory(b));
Assert.ThrowsException<InvalidOperationException>(() => SecureMemory.UnlockAndZeroMemory(b));
// This test fails on Linux/macOS - munlock() must not return an error despite no locking taking place
if (OperatingSystem.IsWindows()) {
Assert.ThrowsException<InvalidOperationException>(() => SecureMemory.UnlockAndZeroMemory(b));
}
}
}

0 comments on commit 861f3f1

Please sign in to comment.