diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp |
Diffstat (limited to 'Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp')
-rw-r--r-- | Runtime/Graphics/ParticleSystem/ParticleSystemRendererTests.cpp | 29 |
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 |