mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
27 lines
620 B
C#
27 lines
620 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using NUnit.Framework;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.UnitTesting.Shared.Utility;
|
|
|
|
[TestFixture]
|
|
[Parallelizable(ParallelScope.All)]
|
|
[TestOf(typeof(DebugTools))]
|
|
public sealed class DebugTools_Test
|
|
{
|
|
[Test]
|
|
[TestCase(true, 5)]
|
|
[Conditional("DEBUG")]
|
|
public void TestAssertFormatNoAlloc(bool check, int val)
|
|
{
|
|
var allocA = GC.GetAllocatedBytesForCurrentThread();
|
|
|
|
DebugTools.Assert(check, $"Oops: {val}");
|
|
|
|
var allocB = GC.GetAllocatedBytesForCurrentThread();
|
|
|
|
Assert.That(allocB, Is.EqualTo(allocA));
|
|
}
|
|
}
|