fix(test) Add #if MHP_ENABLE_SAFETY_CHECKS to Stack_AllocationFailsOutsideScope and VirtualStack_AllocationFailsOutsideScope

This commit is contained in:
2026-04-04 19:48:12 +09:00
parent 578da115b9
commit b57b7adc77
3 changed files with 5 additions and 1 deletions

View File

@@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);PLATFORM_WINDOWS;ENABLE_SAFETY_CHECKS</DefineConstants> <DefineConstants>$(DefineConstants);PLATFORM_WINDOWS;MHP_ENABLE_SAFETY_CHECKS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

View File

@@ -144,6 +144,7 @@ public unsafe class TestStack
Assert.IsNull(stack.Buffer); Assert.IsNull(stack.Buffer);
} }
#if MHP_ENABLE_SAFETY_CHECKS
[TestMethod] [TestMethod]
public void Stack_AllocationFailsOutsideScope() public void Stack_AllocationFailsOutsideScope()
{ {
@@ -157,6 +158,7 @@ public unsafe class TestStack
stack.Dispose(); stack.Dispose();
} }
} }
#endif
[TestMethod] [TestMethod]
public void Stack_InvalidAlignment_Throws() public void Stack_InvalidAlignment_Throws()

View File

@@ -145,6 +145,7 @@ public unsafe class TestVirtualStack
Assert.IsNull(stack.Buffer); Assert.IsNull(stack.Buffer);
} }
#if MHP_ENABLE_SAFETY_CHECKS
[TestMethod] [TestMethod]
public void VirtualStack_AllocationFailsOutsideScope() public void VirtualStack_AllocationFailsOutsideScope()
{ {
@@ -161,6 +162,7 @@ public unsafe class TestVirtualStack
stack.Dispose(); stack.Dispose();
} }
} }
#endif
[TestMethod] [TestMethod]
public void VirtualStack_InvalidAlignment_Throws() public void VirtualStack_InvalidAlignment_Throws()