diff --git a/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/HandledExceptionAgingStep.cs b/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/HandledExceptionAgingStep.cs new file mode 100644 index 000000000..cf64b03c3 --- /dev/null +++ b/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/HandledExceptionAgingStep.cs @@ -0,0 +1,35 @@ +using System; +using System.Runtime.InteropServices; + +namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps +{ + /// + /// Test dedicated to handling of Access Violations. + /// + internal class HandledExceptionAgingStep : IAgingStep + { + /// + public string Name => "Test Handled Exception"; + + /// + public SelfTestStepResult RunStep(Dalamud dalamud) + { + try + { + Marshal.ReadByte(IntPtr.Zero); + } + catch (AccessViolationException) + { + return SelfTestStepResult.Pass; + } + + return SelfTestStepResult.Fail; + } + + /// + public void CleanUp(Dalamud dalamud) + { + // ignored + } + } +} diff --git a/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs b/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs index 0f369b5ee..9f95c4d27 100644 --- a/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs @@ -39,6 +39,7 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest new HoverAgingStep(), new LuminaAgingStep(), new PartyFinderAgingStep(), + new HandledExceptionAgingStep(), new LogoutEventAgingStep(), };