Skip to content

Commit

Permalink
Cover non-engaged access on const value_ptr (nonstd-lite project issu…
Browse files Browse the repository at this point in the history
…e 29, thanks to OpenCppCoverage)

- martinmoene/nonstd-lite-project#29
  • Loading branch information
martinmoene committed Feb 16, 2019
1 parent f2e9711 commit d5f3dc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/value_ptr.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,11 @@ CASE( "value_ptr: Allows to obtain moved-default via value_or() (C++11)" )

CASE( "value_ptr: Throws bad_value_access at disengaged access" )
{
EXPECT_THROWS_AS( value_ptr<int>().value(), bad_value_access );
value_ptr<int> vp;
value_ptr<int> const cvp;

EXPECT_THROWS_AS( vp.value(), bad_value_access );
EXPECT_THROWS_AS( cvp.value(), bad_value_access );
}

// modifiers:
Expand Down

0 comments on commit d5f3dc3

Please sign in to comment.