Skip to content

Commit

Permalink
Fix vitamins test flaking out, fingers crossed (CleverRaven#66083)
Browse files Browse the repository at this point in the history
  • Loading branch information
irwiss authored Jun 9, 2023
1 parent f9dc830 commit 41f05da
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/character_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void Character::update_body( const time_point &from, const time_point &to )
{
// Early return if we already did update previously on the same turn (e.g. when loading savegame).
if( to <= last_updated ) {
last_updated = to;
return;
}
if( !is_npc() ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/effect_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ TEST_CASE( "Vitamin Effects", "[effect][vitamins]" )
const int post_vitx = subject.vitamin_get( vitx );

// The effect roughly halves the absorbed vitamin x
CHECK( posteffect_vitx == 22 );
CHECK( posteffect_vitx == Approx( 22 ).margin( 3 ) );
CHECK( post_vitx == 46 );

// Without the effect, no vitamin v is gained
Expand Down
1 change: 1 addition & 0 deletions tests/player_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void clear_character( Character &dummy, bool skip_nutrition )
dummy.stomach.empty();
dummy.guts.empty();
dummy.clear_vitamins();
dummy.update_body( calendar::turn, calendar::turn ); // sets last_updated to current turn
if( !skip_nutrition ) {
item food( "debug_nutrition" );
dummy.consume( food );
Expand Down
1 change: 0 additions & 1 deletion tests/stomach_contents_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ static void reset_time()
{
calendar::turn = calendar::start_of_cataclysm;
Character &player_character = get_player_character();
player_character.set_stored_kcal( player_character.get_healthy_kcal() );
player_character.set_hunger( 0 );
clear_avatar();
}
Expand Down

0 comments on commit 41f05da

Please sign in to comment.