Skip to content

Commit f42ee17

Browse files
update GarbageCollectionTests
1 parent 593403f commit f42ee17

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Assets/Reflex.EditModeTests/GarbageCollectionTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using FluentAssertions;
55
using NUnit.Framework;
66
using Reflex.Core;
7+
using UnityEditor.Compilation;
78
using UnityEngine;
89

910
namespace Reflex.EditModeTests
@@ -20,6 +21,15 @@ public static void ForceGarbageCollection()
2021
GC.Collect();
2122
GC.WaitForPendingFinalizers();
2223
}
24+
25+
[OneTimeSetUp]
26+
public void Setup()
27+
{
28+
if (CompilationPipeline.codeOptimization == CodeOptimization.Debug)
29+
{
30+
Assert.Inconclusive("GC works differently in Debug mode. Please run tests in Release mode.");
31+
}
32+
}
2333

2434
[Test, Retry(3)]
2535
public void Singleton_ShouldBeFinalized_WhenOwnerIsDisposed()

0 commit comments

Comments
 (0)