From: Wolfgang Bangerth Date: Fri, 11 Dec 2009 15:53:22 +0000 (+0000) Subject: Simplify testcase. X-Git-Tag: v8.0.0~6739 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b17b3946fa66e45451a3f618a3d91950e326a9f;p=dealii.git Simplify testcase. git-svn-id: https://svn.dealii.org/trunk@20237 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/config/tests/darwin-dynamic-cast/main.cc b/deal.II/contrib/config/tests/darwin-dynamic-cast/main.cc index 64a1f33864..d26cc39d47 100644 --- a/deal.II/contrib/config/tests/darwin-dynamic-cast/main.cc +++ b/deal.II/contrib/config/tests/darwin-dynamic-cast/main.cc @@ -1,93 +1,17 @@ - // C++ -#include - -// The first base class: #include "BaseClass.h" -// And now we define a second one: -template -class Base2 -{ -public: - Base2(); - ~Base2(); - virtual int return_int(){return 321;}; -}; - -template -class Derived2 : public Base2 -{ -public: - Derived2(); - ~Derived2(); - virtual int return_int(){ return 123;} -}; - -template -class DerivedDerived2 : public Derived2 -{ -public: - DerivedDerived2(); - ~DerivedDerived2(); - virtual int return_int(){ return 456;} -}; - -template -Base2::Base2() -{ } - -template -Derived2::Derived2() -{ } - -template -DerivedDerived2::DerivedDerived2() -{ } - -template -Base2::~Base2() -{ } - -template -Derived2::~Derived2() -{ } - -template -DerivedDerived2::~DerivedDerived2() -{ } - -/*************************************** - * - ***************************************/ int main ( ) { - const unsigned int dim = 2; - - //First test the dynamic library: - { - DerivedDerived *der = new DerivedDerived(); - - const Base* my_class_base_pointer = der; + const unsigned int dim = 2; - if(dynamic_cast *>(my_class_base_pointer) != 0) - std::cout<<"SUCCESS"< *der = new DerivedDerived2(); - - const Base2* my_class_base_pointer = der; - - if(dynamic_cast *>(my_class_base_pointer) != 0) - std::cout<<"SUCCESS"< *der = new DerivedDerived(); + + const Base* my_class_base_pointer = der; - return 0; + if(dynamic_cast *>(my_class_base_pointer) != 0) + return 0; + else + return 1; }