Commit graph

1 commit

Author SHA1 Message Date
Ioannis Tzavaras
d7edc50eb4
tests: add unit tests for CDamageRing (#13995)
Adds GTest unit tests for CDamageRing in src/helpers/DamageRing.hpp.

Covers:
  - setSize: initial full damage, same-size no-op, resize re-damage, zero-size
  - damage: in-bounds accept, empty/out-of-bounds reject, partial clip
  - damageEntire: normal path and zero-size no-op
  - rotate: clears current, preserves as previous, wraps beyond ring length
  - getBufferDamage: age<=0 and age>ring return full screen, age=1 current only,
    age=2 accumulates previous, full ring accumulation, coalescing fallback,
    empty ring returns empty
  - hasChanged: false initially, true after damage/damageEntire, false after
    rotate, false for out-of-bounds damage

27 new test cases, all passing.
2026-04-05 14:47:58 +01:00