Skip to content

Commit

Permalink
Oops, update tests for cannibal vitamin
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Mar 8, 2024
1 parent 2b49781 commit 80b35fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/char_edible_rating_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static const trait_id trait_THRESH_BIRD( "THRESH_BIRD" );
static const trait_id trait_THRESH_CATTLE( "THRESH_CATTLE" );
static const trait_id trait_WATERSLEEP( "WATERSLEEP" );

static const vitamin_id vitamin_human_flesh_vitamin( "human_flesh_vitamin" );

static void expect_can_eat( avatar &dummy, item &food )
{
auto rate_can = dummy.can_eat( food );
Expand Down Expand Up @@ -504,7 +506,7 @@ TEST_CASE( "who_will_eat_cooked_human_flesh", "[will_eat][edible_rating][canniba

GIVEN( "some cooked human flesh" ) {
item flesh( "human_cooked" );
REQUIRE( flesh.has_flag( flag_CANNIBALISM ) );
REQUIRE( flesh.has_vitamin( vitamin_human_flesh_vitamin ) );

WHEN( "character is not a cannibal" ) {
REQUIRE_FALSE( dummy.has_trait( trait_CANNIBAL ) );
Expand Down
4 changes: 3 additions & 1 deletion tests/iteminfo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static const trait_id trait_ANTIFRUIT( "ANTIFRUIT" );
static const trait_id trait_CANNIBAL( "CANNIBAL" );
static const trait_id trait_WOOLALLERGY( "WOOLALLERGY" );

static const vitamin_id vitamin_human_flesh_vitamin( "human_flesh_vitamin" );

// ITEM INFO
// =========
//
Expand Down Expand Up @@ -2140,7 +2142,7 @@ TEST_CASE( "food_that_is_made_of_human_flesh", "[iteminfo][food][cannibal]" )
std::vector<iteminfo_parts> cannibal = { iteminfo_parts::FOOD_CANNIBALISM };

item thumb( "test_thumb" );
REQUIRE( thumb.has_flag( flag_CANNIBALISM ) );
REQUIRE( thumb.has_vitamin( vitamin_human_flesh_vitamin ) );

Check failure on line 2145 in tests/iteminfo_test.cpp

View workflow job for this annotation

GitHub Actions / Basic Build and Test (Clang 10, Ubuntu, Curses)

false

GIVEN( "character is not a cannibal" ) {
REQUIRE_FALSE( player_character.has_trait( trait_CANNIBAL ) );
Expand Down
4 changes: 3 additions & 1 deletion tests/modify_morale_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static const trait_id trait_URSINE_EYE( "URSINE_EYE" );
static const trait_id trait_URSINE_FUR( "URSINE_FUR" );
static const trait_id trait_VEGETARIAN( "VEGETARIAN" );

static const vitamin_id vitamin_human_flesh_vitamin( "human_flesh_vitamin" );

// Test cases for `Character::modify_morale` defined in `src/consumption.cpp`

TEST_CASE( "food_enjoyability", "[food][modify_morale][fun]" )
Expand Down Expand Up @@ -271,7 +273,7 @@ TEST_CASE( "cannibalism", "[food][modify_morale][cannibal]" )
dummy.worn.wear_item( dummy, item( "backpack" ), false, false );

item_location human = dummy.i_add( item( "bone_human" ) );
REQUIRE( human->has_flag( flag_CANNIBALISM ) );
REQUIRE( human->has_vitamin( vitamin_human_flesh_vitamin ) );

GIVEN( "character is not a cannibal or sapiovore" ) {
REQUIRE_FALSE( dummy.has_trait( trait_CANNIBAL ) );
Expand Down

0 comments on commit 80b35fe

Please sign in to comment.