mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
feat: add Handled Exception self-test step
This commit is contained in:
parent
7a1e78cb48
commit
06035f5901
2 changed files with 36 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Test dedicated to handling of Access Violations.
|
||||||
|
/// </summary>
|
||||||
|
internal class HandledExceptionAgingStep : IAgingStep
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string Name => "Test Handled Exception";
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public SelfTestStepResult RunStep(Dalamud dalamud)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Marshal.ReadByte(IntPtr.Zero);
|
||||||
|
}
|
||||||
|
catch (AccessViolationException)
|
||||||
|
{
|
||||||
|
return SelfTestStepResult.Pass;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SelfTestStepResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public void CleanUp(Dalamud dalamud)
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -39,6 +39,7 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest
|
||||||
new HoverAgingStep(),
|
new HoverAgingStep(),
|
||||||
new LuminaAgingStep<TerritoryType>(),
|
new LuminaAgingStep<TerritoryType>(),
|
||||||
new PartyFinderAgingStep(),
|
new PartyFinderAgingStep(),
|
||||||
|
new HandledExceptionAgingStep(),
|
||||||
new LogoutEventAgingStep(),
|
new LogoutEventAgingStep(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue