diff --git a/test/cast_test.cpp b/test/cast_test.cpp index e754dbb..7bbef05 100644 --- a/test/cast_test.cpp +++ b/test/cast_test.cpp @@ -53,16 +53,13 @@ int main( int argc, char * argv[] ) // tests which should succeed Derived derived_instance; Base * base = &derived_instance; - Base2 * base2 = 0; - Derived * derived = 0; - derived = polymorphic_downcast( base ); // downcast + Derived * derived = polymorphic_downcast( base ); // downcast assert( derived->kind() == 'D' ); - derived = 0; derived = polymorphic_cast( base ); // downcast, throw on error assert( derived->kind() == 'D' ); - base2 = polymorphic_cast( base ); // crosscast + Base2 * base2 = polymorphic_cast( base ); // crosscast assert( base2->kind2() == '2' ); // tests which should result in errors being detected diff --git a/test/polymorphic_cast_test.cpp b/test/polymorphic_cast_test.cpp index db44850..5204a93 100644 --- a/test/polymorphic_cast_test.cpp +++ b/test/polymorphic_cast_test.cpp @@ -154,7 +154,7 @@ static void test_polymorphic_pointer_cast() if( sp_base2 != 0 ) { - BOOST_TEST_EQ( base2->kind2(), "Base2" ); + BOOST_TEST_EQ( sp_base2->kind2(), "Base2" ); } } catch( std::bad_cast const& )