engine/particle/src/test/test_particle.cpp
/**
 * Verify total amount of spawned particles over time
 */
Verify total amount of spawned particles over time
Verify total amount of spawned particles over time
TEST_F(ParticleTest, RateTotal)
{
    float dt = 1.0f;
    uint32_t samples = 4;
    ASSERT_TRUE(LoadPrototype("rate_total.particlefxc", &m_Prototype));
    dmParticle::HInstance instance = dmParticle::CreateInstance(m_Context, m_Prototype, 0x0);
    dmParticle::Emitter* e = GetEmitter(m_Context, instance, 0);
    dmParticle::StartInstance(m_Context, instance);
    for (uint32_t i = 0; i < samples; ++i)
    {
        dmParticle::Update(m_Context, dt, 0x0);
    }
    ASSERT_EQ(10u, ParticleCount(e));
    dmParticle::DestroyInstance(m_Context, instance);
}
TEST_F ( ParticleTest , RateTotal ) { float dt = 1.0f ; uint32_t samples = 4 ; ASSERT_TRUE ( LoadPrototype ( " " , & m_Prototype ) ) ; dmParticle :: HInstance instance = dmParticle :: CreateInstance ( m_Context , m_Prototype , 0x0 ) ; dmParticle :: Emitter * e = GetEmitter ( m_Context , instance , 0 ) ; dmParticle :: StartInstance ( m_Context , instance ) ; for ( uint32_t i = 0 ; i < samples ; ++ i ) { dmParticle :: Update ( m_Context , dt , 0x0 ) ; } ASSERT_EQ ( 10u , ParticleCount ( e ) ) ; dmParticle :: DestroyInstance ( m_Context , instance ) ; }
Verify total amount of spawned particles over time
Verify total amount of spawned particles over time