Skip to content

Commit

Permalink
Start testing for unrealistic weary fluctuations
Browse files Browse the repository at this point in the history
Start on adding tests for unrealistic fluctuations in weary level;
see CleverRaven#46384 (and some cases in CleverRaven#46941) for example problems. The initial
tests look for problems with the weary_recovery task of digging for 8
hours then waiting for 8 hours; weary level should not go down in the
first 8 hours, and should not go up in the second 8 hours.
  • Loading branch information
actual-nh committed Feb 6, 2021
1 parent c4ab6b2 commit bdd942b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/weary_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ TEST_CASE( "weary_recovery", "[weary][activities]" )
REQUIRE( !info.empty() );
CHECK( info.transition_minutes( 4, 3, 520_minutes ) == Approx( 520 ).margin( 5 ) );
CHECK( info.transition_minutes( 3, 2, 670_minutes ) == Approx( 670 ).margin( 5 ) );
CHECK( info.transition_minutes( 1, 0, 0_minutes ) > ( 8 * 60 ) ); // should be INT_MAX
CHECK( info.transition_minutes( 2, 1, 0_minutes ) > ( 8 * 60 ) );
CHECK( info.transition_minutes( 1, 2, 16_hours ) <= ( 8 * 60 ) );
CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) );
CHECK( info.transition_minutes( 3, 4, 16_hours ) <= ( 8 * 60 ) );
CHECK( guy.weariness_level() == 1 );
}

Expand Down

0 comments on commit bdd942b

Please sign in to comment.