| 239 | } |
| 240 | |
| 241 | static 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 | |
| 262 | static void testActionNullptr(int start, int end, Game_Enemy& source) { |
| 263 | for (int rng = start; rng < end; ++rng) { |
no test coverage detected