mirror of
https://github.com/boostorg/conversion.git
synced 2025-08-02 14:04:28 +02:00
Fixed warnings in tests
This commit is contained in:
@@ -53,16 +53,13 @@ int main( int argc, char * argv[] )
|
|||||||
// tests which should succeed
|
// tests which should succeed
|
||||||
Derived derived_instance;
|
Derived derived_instance;
|
||||||
Base * base = &derived_instance;
|
Base * base = &derived_instance;
|
||||||
Base2 * base2 = 0;
|
Derived * derived = polymorphic_downcast<Derived*>( base ); // downcast
|
||||||
Derived * derived = 0;
|
|
||||||
derived = polymorphic_downcast<Derived*>( base ); // downcast
|
|
||||||
assert( derived->kind() == 'D' );
|
assert( derived->kind() == 'D' );
|
||||||
|
|
||||||
derived = 0;
|
|
||||||
derived = polymorphic_cast<Derived*>( base ); // downcast, throw on error
|
derived = polymorphic_cast<Derived*>( base ); // downcast, throw on error
|
||||||
assert( derived->kind() == 'D' );
|
assert( derived->kind() == 'D' );
|
||||||
|
|
||||||
base2 = polymorphic_cast<Base2*>( base ); // crosscast
|
Base2 * base2 = polymorphic_cast<Base2*>( base ); // crosscast
|
||||||
assert( base2->kind2() == '2' );
|
assert( base2->kind2() == '2' );
|
||||||
|
|
||||||
// tests which should result in errors being detected
|
// tests which should result in errors being detected
|
||||||
|
@@ -154,7 +154,7 @@ static void test_polymorphic_pointer_cast()
|
|||||||
|
|
||||||
if( sp_base2 != 0 )
|
if( sp_base2 != 0 )
|
||||||
{
|
{
|
||||||
BOOST_TEST_EQ( base2->kind2(), "Base2" );
|
BOOST_TEST_EQ( sp_base2->kind2(), "Base2" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( std::bad_cast const& )
|
catch( std::bad_cast const& )
|
||||||
|
Reference in New Issue
Block a user