MCPcopy Create free account
hub / github.com/EasyRPG/Player / testFlash

Function testFlash

tests/game_character_flash.cpp:24–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24static 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
52TEST_CASE("Flash") {
53 for (auto r: {0, 7}) {

Callers 1

Calls 6

MakeColorFunction · 0.85
testCharFunction · 0.70
ForceUpdateFunction · 0.70
UpdateFunction · 0.50
GetEventMethod · 0.45
FlashMethod · 0.45

Tested by

no test coverage detected