Skip to content

Commit

Permalink
NativeDetourTest on macOS shall not undo its failed detour either
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ade committed Mar 23, 2022
1 parent cd8f77a commit 5833f30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MonoMod.UnitTest/RuntimeDetour/NativeDetourTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,15 @@ public class NativeDetourTest {
d.Apply();
} catch (Win32Exception) {
// Modern macOS doesn't give us permission to mess with this anymore.
d.Dispose();
try {
d.Dispose();
} catch (Win32Exception) {
// Of course it might also throw while trying to undo any made changes.
}
}
}

if (d.IsValid) {
if (d.IsApplied) {
DidNothing = true;
Assert.Equal(-1, libc_rand());
Assert.False(DidNothing);
Expand Down

0 comments on commit 5833f30

Please sign in to comment.