From fbb058d6125afe38186f0b40a53469c8d3b00de7 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:58:42 -0500 Subject: [PATCH] Fix some tests that relied on previous ordering, maybe --- tests/melee_dodge_hit_test.cpp | 4 ++++ tests/mongroup_test.cpp | 3 +++ tests/npc_talk_test.cpp | 3 +++ tests/vehicle_power_test.cpp | 1 + tests/vehicle_split_test.cpp | 2 ++ 5 files changed, 13 insertions(+) diff --git a/tests/melee_dodge_hit_test.cpp b/tests/melee_dodge_hit_test.cpp index 8ec5bf9ec7095..d6a2490c48b09 100644 --- a/tests/melee_dodge_hit_test.cpp +++ b/tests/melee_dodge_hit_test.cpp @@ -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(); @@ -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(); @@ -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(); diff --git a/tests/mongroup_test.cpp b/tests/mongroup_test.cpp index dded8c1657c6b..49e0d5d93f3c9 100644 --- a/tests/mongroup_test.cpp +++ b/tests/mongroup_test.cpp @@ -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(); diff --git a/tests/npc_talk_test.cpp b/tests/npc_talk_test.cpp index 16790e6e44028..eea6b093e2e2f 100644 --- a/tests/npc_talk_test.cpp +++ b/tests/npc_talk_test.cpp @@ -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." diff --git a/tests/vehicle_power_test.cpp b/tests/vehicle_power_test.cpp index dab37235a3ee0..16d566e38a502 100644 --- a/tests/vehicle_power_test.cpp +++ b/tests/vehicle_power_test.cpp @@ -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(); diff --git a/tests/vehicle_split_test.cpp b/tests/vehicle_split_test.cpp index ae784ee10a3b4..c60acca121b12 100644 --- a/tests/vehicle_split_test.cpp +++ b/tests/vehicle_split_test.cpp @@ -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 ) {