summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp')
-rw-r--r--Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp b/Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp
new file mode 100644
index 0000000..47db7ee
--- /dev/null
+++ b/Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp
@@ -0,0 +1,29 @@
+#include "UnityPrefix.h"
+
+#if ENABLE_UNIT_TESTS
+
+#include "External/UnitTest++/src/UnitTest++.h"
+#include "Runtime/Graphics/ParticleSystem/ParticleSystemRenderer.h"
+#include "Runtime/Filters/Mesh/LodMesh.h"
+#include "Runtime/Testing/TestFixtures.h"
+
+
+SUITE (ParticleSystemRendererTests)
+{
+ typedef ObjectTestFixture<ParticleSystemRenderer> Fixture;
+
+ TEST_FIXTURE (Fixture, DeletingMeshClearsOutCachedMeshPointers)
+ {
+ // Arrange.
+ PPtr<Mesh> mesh (NEW_OBJECT_RESET_AND_AWAKE (Mesh));
+ m_ObjectUnderTest->SetMesh (mesh);
+
+ // Act.
+ DestroySingleObject (mesh);
+
+ // Assert.
+ CHECK (m_ObjectUnderTest->GetData().cachedMesh[0] == NULL);
+ }
+}
+
+#endif