Skip to content

Commit

Permalink
Fix corner case in rot test
Browse files Browse the repository at this point in the history
The test would fail if run when calendar::turn was start_of_cataclysm.
Fix that by avoiding that special case.
  • Loading branch information
jbytheway committed Apr 12, 2020
1 parent 32e7f59 commit 03b7ba9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/rot_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ TEST_CASE( "Rate of rotting" )
// In preserving containers and in freezer the item should not rot at all
// Item in freezer should not be frozen.

// Items created at turn zero are handled differently, so ensure we're
// not there.
if( calendar::turn <= calendar::start_of_cataclysm ) {
calendar::turn = calendar::start_of_cataclysm + 1_minutes;
}

item normal_item( "meat_cooked" );

item freeze_item( "offal_canned" );
Expand Down

0 comments on commit 03b7ba9

Please sign in to comment.