Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to identify randomly failed vehicle_turret_test cause #78540

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading