diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index d9133efe8cf87..3339b25d944f3 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -25,6 +25,8 @@ static const ammo_effect_str_id ammo_effect_RECYCLED( "RECYCLED" ); +static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); + static std::vector all_turret_types() { std::vector res; @@ -45,10 +47,17 @@ TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) clear_avatar(); map &here = get_map(); Character &player_character = get_player_character(); + const tripoint_bub_ms veh_pos( 65, 65, here.get_abs_sub().z() ); + // TODO: Get rid of this set of tests when the cause of this test randomly failing has been eliminated. + REQUIRE( veh_pos.z() == 0 ); + REQUIRE( vehicle_prototype_test_turret_rig.is_valid() ); + REQUIRE( here.inbounds( veh_pos ) ); + // TODO: End + for( const vpart_info *turret_vpi : all_turret_types() ) { SECTION( turret_vpi->name() ) { - vehicle *veh = here.add_vehicle( STATIC( vproto_id( "test_turret_rig" ) ), - tripoint_bub_ms( 65, 65, here.get_abs_sub().z() ), 270_degrees, 0, 0, false ); + vehicle *veh = here.add_vehicle( vehicle_prototype_test_turret_rig, veh_pos, 270_degrees, 0, 0, + false ); REQUIRE( veh ); veh->unlock();