Skip to content

Commit

Permalink
Merge pull request #78540 from PatrikLundell/vehicle_turret_test
Browse files Browse the repository at this point in the history
attempt to identify randomly failed vehicle_turret_test cause
  • Loading branch information
Night-Pryanik authored Dec 14, 2024
2 parents 00c49c4 + b7cbd16 commit 448d1e0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/vehicle_turrets_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const vpart_info *> all_turret_types()
{
std::vector<const vpart_info *> res;
Expand All @@ -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();

Expand Down

0 comments on commit 448d1e0

Please sign in to comment.