Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and consolidate wield #79719

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
more test
  • Loading branch information
marilynias committed Feb 21, 2025
commit 7cac5fc7cac088d4c63d07cf7c9423f1364717df
5 changes: 4 additions & 1 deletion tests/reloading_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,18 +997,21 @@
WHEN( "the player triggers auto reload until the second revolver is full" ) {

reload_a_revolver( dummy, gun2, *ammo );
gun2 = dummy.get_wielded_item();
REQUIRE( gun2->ammo_remaining( ) == gun2->ammo_capacity( ammo->ammo_type() ) );

THEN( "no activity is generated" ) {
CAPTURE( dummy.activity.id() );
CHECK( !dummy.activity );
}
gun2 = dummy.get_wielded_item();
WHEN( "the player triggers auto reload again" ) {
CAPTURE( gun2->ammo_remaining( ) );
REQUIRE(!dummy.activity);
CAPTURE( dummy.get_wielded_item()->ammo_remaining( ) );
g->reload_weapon( false );
THEN( "no activity is generated" ) {
CAPTURE( dummy.activity.id() );
CHECK( !dummy.activity );

Check failure on line 1014 in tests/reloading_test.cpp

View workflow job for this annotation

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

false
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/visitable_remove_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@

WHEN( "one of the bottles is wielded" ) {
CAPTURE( p.all_items_loc().size() );
p.wield( p.all_items_loc().back() );
REQUIRE( p.all_items_loc().front()->typeId() == container_id );

Check failure on line 162 in tests/visitable_remove_test.cpp

View workflow job for this annotation

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

string_id( "null" )
p.wield( p.all_items_loc().front() );
REQUIRE( p.get_wielded_item()->typeId() == container_id );
REQUIRE( count_items( p, container_id ) == count );
REQUIRE( count_items( p, liquid_id ) == count );
Expand Down
Loading