Esempio n. 1
0
void
fiber_base::rethrow() const
{
    BOOST_ASSERT( has_exception() );

    rethrow_exception( except_);
}
Esempio n. 2
0
TEST( expect, copyable_expect_with_value )
{
	auto expect = q::fulfill< Copyable >( Copyable( ) );
	EXPECT_FALSE( expect.has_exception( ) );
	EXPECT_EQ( expect.exception( ), std::exception_ptr( ) );
	EXPECT_NO_THROW( expect.get( ) );
	EXPECT_NO_THROW( expect.consume( ) );
}
Esempio n. 3
0
TEST( expect, void_expect_with_value )
{
	auto expect = q::fulfill< void >( );
	EXPECT_FALSE( expect.has_exception( ) );
	EXPECT_EQ( expect.exception( ), std::exception_ptr( ) );
	EXPECT_NO_THROW( expect.get( ) );
	EXPECT_NO_THROW( expect.consume( ) );
}
Esempio n. 4
0
TEST( expect, movable_expect_with_exception )
{
	auto expect = q::refuse< Movable >( make_exception( ) );
	EXPECT_TRUE( expect.has_exception( ) );
	EXPECT_NO_THROW( expect.exception( ) );
	EXPECT_THROW( expect.get( ), test_exception );
	EXPECT_THROW( expect.consume( ), test_exception );
}
Esempio n. 5
0
TEST( expect, void_expect_With_exception )
{
	auto expect = q::refuse< void >( make_exception( ) );
	EXPECT_TRUE( expect.has_exception( ) );
	EXPECT_NO_THROW( expect.exception( ) );
	EXPECT_THROW( expect.get( ), test_exception );
	EXPECT_THROW( expect.consume( ), test_exception );
}
Esempio n. 6
0
TEST( expect, exception_expect_with_exception )
{
	auto expect = q::refuse< std::exception_ptr >( make_exception( ) );
	EXPECT_TRUE( expect.has_exception( ) );
	EXPECT_NE( expect.exception( ), std::exception_ptr( ) );
	EXPECT_THROW( expect.get( ), test_exception );
	EXPECT_THROW( expect.consume( ), test_exception );
}
Esempio n. 7
0
TEST( expect, exception_expect_with_null_value )
{
	auto expect = q::fulfill< std::exception_ptr >( make_null_exception( ) );
	EXPECT_FALSE( expect.has_exception( ) );
	EXPECT_EQ( expect.exception( ), std::exception_ptr( ) );
	EXPECT_NO_THROW( expect.get( ) );
	EXPECT_NO_THROW( expect.consume( ) );
}
Esempio n. 8
0
TEST( expect, any_expect_with_value )
{
	auto expect = q::fulfill< std::string >( std::string( ) );
	EXPECT_FALSE( expect.has_exception( ) );
	EXPECT_EQ( expect.exception( ), std::exception_ptr( ) );
	EXPECT_NO_THROW( expect.get( ) );
	EXPECT_NO_THROW( expect.consume( ) );
}
Esempio n. 9
0
 bool has_value() const
 {
     return !has_exception();
 }