Skip to content

Commit

Permalink
Fix some tests that relied on previous ordering, maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Dec 17, 2024
1 parent 272fc83 commit fbb058d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/melee_dodge_hit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ TEST_CASE( "player_get_dodge", "[player][melee][dodge]" )

avatar &dummy = get_avatar();
clear_character( dummy );
dodge_base_with_dex_and_skill( dummy, 10, 10 );
dummy.set_dodges_left( 1 );

const float base_dodge = dummy.get_dodge_base();

Expand All @@ -241,6 +243,7 @@ TEST_CASE( "player_get_dodge_with_effects", "[player][melee][dodge][effect]" )

avatar &dummy = get_avatar();
clear_character( dummy );
dodge_base_with_dex_and_skill( dummy, 10, 10 );

// Compare all effects against base dodge ability
const float base_dodge = dummy.get_dodge_base();
Expand Down Expand Up @@ -298,6 +301,7 @@ TEST_CASE( "player_get_dodge_stamina_effects", "[player][melee][dodge][stamina]"
{
avatar &dummy = get_avatar();
clear_character( dummy );
dodge_base_with_dex_and_skill( dummy, 8, 0 );

SECTION( "8/8/8/8, no skills, unencumbered" ) {
const int stamina_max = dummy.get_stamina_max();
Expand Down
3 changes: 3 additions & 0 deletions tests/mongroup_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ static void test_multi_spawn( const mtype_id &old_mon, int range, int min, int m
{
const int upgrade_attempts = 100;
clear_avatar();
// make sure tested scenarios haven't messed with our start time
calendar::start_of_cataclysm = calendar::turn_zero;
calendar::start_of_game = calendar::turn_zero;

for( int i = 0; i < upgrade_attempts; i++ ) {
clear_map();
Expand Down
3 changes: 3 additions & 0 deletions tests/npc_talk_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,9 @@ TEST_CASE( "npc_arithmetic", "[npc_talk]" )
d.add_topic( "TALK_TEST_ARITHMETIC" );
gen_response_lines( d, 31 );

// make sure tested scenarios haven't messed with our start time
calendar::start_of_cataclysm = calendar::turn_zero;
calendar::start_of_game = calendar::turn_zero;
calendar::turn = calendar::turn_zero;
REQUIRE( calendar::turn == time_point( 0 ) );
// "Sets time since cataclysm to 1."
Expand Down
1 change: 1 addition & 0 deletions tests/vehicle_power_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ TEST_CASE( "Daily_solar_power", "[vehicle][power]" )

TEST_CASE( "maximum_reverse_velocity", "[vehicle][power][reverse]" )
{
clear_map();
reset_player();
build_test_map( ter_id( "t_pavement" ) );
clear_vehicles();
Expand Down
2 changes: 2 additions & 0 deletions tests/vehicle_split_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ static const vproto_id vehicle_prototype_cross_split_test( "cross_split_test" );

TEST_CASE( "vehicle_split_section", "[vehicle]" )
{
wipe_map_terrain();
clear_vehicles();
map &here = get_map();
Character &player_character = get_player_character();
for( units::angle dir = 0_degrees; dir < 360_degrees; dir += vehicles::steer_increment ) {
Expand Down

0 comments on commit fbb058d

Please sign in to comment.