Skip to content

Commit

Permalink
Test for achievement hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed May 3, 2020
1 parent 12231d3 commit 8ecd8e2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/stats_tracker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,26 @@ TEST_CASE( "achievments_tracker", "[stats]" )
CHECK( achievements_completed.count( a_survive_one_day ) );
}

SECTION( "hidden_kills" ) {
const character_id u_id = g->u.getID();
const mtype_id mon_zombie( "mon_zombie" );
const cata::event avatar_zombie_kill =
cata::event::make<event_type::character_kills_monster>( u_id, mon_zombie );

string_id<achievement> a_kill_10( "achievement_kill_10_monsters" );
string_id<achievement> a_kill_100( "achievement_kill_100_monsters" );

b.send<event_type::game_start>( u_id );

CHECK( !a.is_hidden( &*a_kill_10 ) );
CHECK( a.is_hidden( &*a_kill_100 ) );
for( int i = 0; i < 10; ++i ) {
b.send( avatar_zombie_kill );
}
CHECK( !a.is_hidden( &*a_kill_10 ) );
CHECK( !a.is_hidden( &*a_kill_100 ) );
}

SECTION( "kills" ) {
time_duration time_since_game_start = GENERATE( 30_seconds, 10_minutes );
CAPTURE( time_since_game_start );
Expand Down

0 comments on commit 8ecd8e2

Please sign in to comment.