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

Function testActionType

tests/enemyai.cpp:241–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void testActionType(int start, int end, Game_BattleAlgorithm::Type type_compat, Game_BattleAlgorithm::Type type_improved, Game_Enemy& source) {
242 for (int rng = start; rng < end; ++rng) {
243 CAPTURE(rng);
244 bool bugs = true;
245 CAPTURE(bugs);
246
247 Rand::LockGuard lk(rng);
248 bugs = true;
249 source.SetBattleAlgorithm(nullptr);
250 EnemyAi::SelectEnemyAiActionRpgRtCompat(source, bugs);
251 REQUIRE(source.GetBattleAlgorithm());
252 REQUIRE_EQ(static_cast<int>(type_compat), static_cast<int>(source.GetBattleAlgorithm()->GetType()));
253
254 bugs = false;
255 source.SetBattleAlgorithm(nullptr);
256 EnemyAi::SelectEnemyAiActionRpgRtCompat(source, bugs);
257 REQUIRE(source.GetBattleAlgorithm());
258 REQUIRE_EQ(static_cast<int>(type_improved), static_cast<int>(source.GetBattleAlgorithm()->GetType()));
259 }
260}
261
262static void testActionNullptr(int start, int end, Game_Enemy& source) {
263 for (int rng = start; rng < end; ++rng) {

Callers 1

enemyai.cppFile · 0.85

Calls 4

SetBattleAlgorithmMethod · 0.80
GetBattleAlgorithmMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected