Skip to content

ParticleSystemComponent Tests

jgremlich edited this page Feb 20, 2016 · 2 revisions
  1. Invalid Input Data Test: the test will the component to throw an error if an of the following conditions are not met:
    1. Emitter name must contain at least one character (cannot be blank)
    2. Emitter Duration cannot be a negative value
    3. Emitter Delay cannot be a negative value
    4. Emitter Lifetime cannot contain negative values (both min and max must be positive)
    5. Initial Size cannot contain negative values (both x and y must be positive)
    6. Spawn Constant Rate cannot be a negative value
    7. Spawn Burst cannot be a negative value
    8. SubUV Images Horizontal cannot be a negative value
    9. SubUV Images Vertical cannot be a negative value
    10. SizeOverLife cannot contain negative values for either beginning or end
    11. ColorOverLife cannot contain negative values for any entry in the Beginning or End vector4
    12. SubImage Index Over Life cannot contain a negative value for either the Beginning or End index
    13. SubImage Index Random cannot contain a negative value for either the Min or Max value
  2. Functionality Test: Performed by creating a ParticleSystemComponent with values to test each of the functionalities specified in each of the below tests, then calling GetParticles() which returns an array of Particle Objects and checking any combination of particle position, orientation, scale or color for expected values. The test fails if the returned values do not match up with the expected values.
    1. Emitter Origin: do particles spawn at the specified non zero location
    2. Emitter Duration: Start the emitter with specified duration. Update System up to time of duration, count number of particles, update the system to past the emitter duration and make sure there are fewer or the same amount of particles.
    3. Looping: Run the Emitter Duration test with false looping. Run the Emitter Duration with true looping, make sure there are more or equal number of particles after specified duration.
    4. Emitter Delay: Start an emitter with specified delay. Check the number of particles before and after delay time. Make sure there are no particles before the delay, but there are particles after the delay.
    5. Lifetime: Start a system that spawns only on particle with a given lifetime. After that lifetime has expired, make sure there are no particles in the system.
    6. Initial Size: Start a system with a specified initial size. Get the particles and make sure they have the given size.
    7. Initial Velocity: Start a system that spawns a single particle with a given velocity. Get the particle's position at 0 seconds and at 1 second and verify velocity.
    8. Spawn Constant Rate: Start a system with a specified spawn rate. After 1 second verify that there are exactly the number of particles as the spawn rate.
    9. Spawn Burst Rate: Start a system with a specified spawn rate. Count number of particles at 0.1 seconds and at 1 second. Both number should be the same and equal to the spawn rate.
    10. Size Over Life: Start a system with a single particle and a given size over live, and set lifetime to 1. Compare the size of the particle at 0.1 seconds, 0.5 seconds, and 1 second to verify correct change in size.
    11. Color Over Life: Start a system with a single particle and a given color over live, and set lifetime to 1. Compare the color of the particle at 0.1 seconds, 0.5 seconds, and 1 second to verify correct change in color.
    12. Initial Rotation Constant: Stat a system with a single particle, and initial rotation both min and max set the the same value. Update, get the particles, and verify that the particle's rotation matches that value.
    13. Initial Rotation Random: Start a system with several particles, and initial rotation with different min and max. Update the system, get the particles, and verify that the particles' rotations are between the two values (inclusive).
    14. Initial Rotation Rate Constant:Start a system with a single particle and a given initial rotation rate, min and max set to the same value, and set lifetime to 1. Compare the rotation of the particle at 0.1 seconds, 0.5 seconds, and 1 second to verify correct change in rotation.