MCPcopy Create free account
hub / github.com/bwapi/bwapi / TEST_METHOD

Function TEST_METHOD

bwapi/BWAPICoreTest/APMCounterTest.cpp:20–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 Assert::AreEqual(0, counter.apm(false));
19 }
20 TEST_METHOD(APMCounterReflects204APM)
21 {
22 APMCounter counter;
23 counter.init();
24
25 // Send a command every 7th frame for 50 frames.
26 for (int frame = 1; frame < 50; ++frame)
27 {
28 if (frame % 7 == 0) counter.addSelect();
29 counter.update(frame);
30 }
31
32 // If you send a command every 7th frame for a full minute on fastest speed:
33 // (60000ms / 42ms/frame = 1428.57.. frames) / 7frames/action = 204.08.. actions in a minute
34 Assert::AreEqual(204, counter.apm());
35 }
36 };
37}

Callers

nothing calls this directly

Calls 4

addSelectMethod · 0.80
apmMethod · 0.80
initMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected