Skip to content

Commit

Permalink
Check on what weariness is prior to do_activity
Browse files Browse the repository at this point in the history
Realized that weariness being above 0 at the start could cause the level fluctuations.

(cherry picked from commit 686c1f3)
  • Loading branch information
actual-nh committed Jan 15, 2021
1 parent 8ea1d96 commit 4b24660
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/weary_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TEST_CASE( "weary_assorted_tasks", "[weary][activities]" )

SECTION( "Light tasks" ) {
INFO( "\nFirst Aid 8 hours:" );
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( desk_8h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand All @@ -49,6 +50,7 @@ TEST_CASE( "weary_assorted_tasks", "[weary][activities]" )

SECTION( "Moderate tasks" ) {
INFO( "\nPlanting 8 hours:" );
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( moderate_8h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand All @@ -59,6 +61,7 @@ TEST_CASE( "weary_assorted_tasks", "[weary][activities]" )

SECTION( "Heavy tasks" ) {
INFO( "\nDigging Pits 8 hours:" );
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( soldier_8h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand Down Expand Up @@ -115,6 +118,7 @@ TEST_CASE( "weary_recovery", "[weary][activities]" )

SECTION( "Heavy tasks" ) {
INFO( "\nDigging Pits 8 hours, then waiting 8:" );
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( soldier_8h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand All @@ -126,6 +130,7 @@ TEST_CASE( "weary_recovery", "[weary][activities]" )

SECTION( "1 day vehicle work" ) {
INFO( "\n3 meals, 10h vehicle work, 4h reading, 10h sleep, 16h waiting" );
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( mechanic_day );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand All @@ -148,6 +153,7 @@ TEST_CASE( "weary_24h_tasks", "[weary][activities]" )
digging_24h.enschedule( task_dig, 24_hours );

SECTION( "Waiting 24 hours" ) {
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( waiting_24h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand All @@ -156,6 +162,7 @@ TEST_CASE( "weary_24h_tasks", "[weary][activities]" )
}

SECTION( "Digging 24 hours" ) {
INFO( guy.debug_weary_info() );
weariness_events info = do_activity( digging_24h );
INFO( info.summarize() );
INFO( guy.debug_weary_info() );
Expand Down

0 comments on commit 4b24660

Please sign in to comment.