| 22 | } |
| 23 | |
| 24 | static void testFlash(int r, int g, int b, double power, int frames) { |
| 25 | const MockGame mg(MockMap::ePassBlock20x15); |
| 26 | |
| 27 | auto& ch = *mg.GetEvent(1); |
| 28 | |
| 29 | CAPTURE(r); |
| 30 | CAPTURE(g); |
| 31 | CAPTURE(b); |
| 32 | CAPTURE(power); |
| 33 | CAPTURE(frames); |
| 34 | |
| 35 | ch.Flash(r, g, b, power, frames); |
| 36 | |
| 37 | testChar(ch, Flash::MakeColor(r, g, b, power), power, frames); |
| 38 | |
| 39 | while (power > 0) { |
| 40 | ForceUpdate(ch); |
| 41 | Flash::Update(power, frames); |
| 42 | |
| 43 | testChar(ch, Flash::MakeColor(r, g, b, power), power, frames); |
| 44 | } |
| 45 | |
| 46 | for (int i = 0; i < 8; ++i) { |
| 47 | ForceUpdate(ch); |
| 48 | testChar(ch, Flash::MakeColor(r, g, b, 0.0), 0.0, frames); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | TEST_CASE("Flash") { |
| 53 | for (auto r: {0, 7}) { |
no test coverage detected