Remove user(doc) visible change to zero_plus_zero_is_zero_with_action

Tests via Fixture::teardown that the assertion is fulfilled
This commit is contained in:
Alexander Grund 2022-01-06 14:24:07 +01:00
parent 40a4b3ceb4
commit 728dfd06eb
No known key found for this signature in database
GPG key ID: AA48A0760367A42B

View file

@ -149,6 +149,7 @@ BOOST_AUTO_TEST_CASE( add_several_numbers_in_sequences )
}
//]
}
BOOST_AUTO_TEST_SUITE_END()
namespace action
{
@ -174,7 +175,7 @@ public:
void add( int a, int b ){ v.display(a + b); }
};
struct CatchFailureFixture
struct CatchFailureFixture: Fixture
{
static bool aborted;
static std::string fail_msg;
@ -200,14 +201,20 @@ struct CatchFailureFixture
bool CatchFailureFixture::aborted = false;
std::string CatchFailureFixture::fail_msg;
struct AssertMissingAction: CatchFailureFixture{
void teardown(){
assert_failure("missing action");
}
};
BOOST_FIXTURE_TEST_SUITE( MissingReturnActionSuite, AssertMissingAction)
//[ action_test
BOOST_FIXTURE_TEST_CASE( zero_plus_zero_is_zero_with_action, CatchFailureFixture )
BOOST_AUTO_TEST_CASE( zero_plus_zero_is_zero_with_action )
{
mock_view v;
calculator c( v );
MOCK_EXPECT( v.display ).once().with( 0 ); // missing returns( true )
c.add( 0, 0 );
assert_failure("missing action");
}
//]
}