diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-10-06 22:51:08 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-10-06 22:51:08 +0000 |
commit | 4ef866d04c7d7a16a38b5f3e25bbdcb5c9ca1b88 (patch) | |
tree | a9a7fe53a79884da8a911944a46bc2702d6c9874 /tests | |
parent | c9f6dc25a4f98211c824ebd3128062b223d0dbb1 (diff) | |
download | ATCD-4ef866d04c7d7a16a38b5f3e25bbdcb5c9ca1b88.tar.gz |
ChangeLogTag:Thu Oct 6 15:42:29 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DLL_Test.cpp | 5 | ||||
-rw-r--r-- | tests/DLL_Test.h | 35 | ||||
-rw-r--r-- | tests/DLL_Test_Impl.cpp | 17 | ||||
-rw-r--r-- | tests/DLL_Test_Parent.cpp | 19 | ||||
-rw-r--r-- | tests/DLL_Test_Parent.h | 34 | ||||
-rw-r--r-- | tests/DLL_Test_Parent_Export.h | 58 | ||||
-rw-r--r-- | tests/dll_test_parent_lib.mpb | 10 | ||||
-rw-r--r-- | tests/tests.mpc | 26 |
8 files changed, 174 insertions, 30 deletions
diff --git a/tests/DLL_Test.cpp b/tests/DLL_Test.cpp index f93b0e10d9c..8a478254b6f 100644 --- a/tests/DLL_Test.cpp +++ b/tests/DLL_Test.cpp @@ -42,7 +42,6 @@ ACE_RCSID(tests, DLL_Test, "$Id$") // Declare the type of the symbol: typedef Hello *(*Hello_Factory)(void); -// for dynamic_cast_test typedef int ( *PFN )( Parent* ); int handle_test (ACE_DLL &dll) @@ -133,9 +132,7 @@ int dynamic_cast_test (ACE_DLL &dll) Parent *parent = &child; - void *foo; - - foo = dll.symbol (ACE_TEXT ("dynamic_cast_test")); + void * foo = dll.symbol (ACE_TEXT ("dynamic_cast_test")); // Cast the void* to long first. ptrdiff_t tmp = reinterpret_cast<ptrdiff_t> (foo); diff --git a/tests/DLL_Test.h b/tests/DLL_Test.h index 7c6c0b1e15e..fb55875eff9 100644 --- a/tests/DLL_Test.h +++ b/tests/DLL_Test.h @@ -1,3 +1,5 @@ +// -*- C++ -*- + // ================================================================ /** * @file DLL_Test.h @@ -8,16 +10,20 @@ */ // ================================================================ + #ifndef ACE_TESTS_DLL_TEST_H #define ACE_TESTS_DLL_TEST_H -#include "ace/Log_Msg.h" -#include "ace/Trace.h" +#include "DLL_Test_Parent.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Log_Msg.h" +#include "ace/Trace.h" +#include "ace/svc_export.h" + /** * @class Hello * @@ -53,29 +59,16 @@ public: //@} }; -// These classes are used to test dynamic_cast in shared libraries. -class Parent + +// Used to test dynamic_cast<> in shared libraries. +class ACE_Svc_Export Child : public Parent { public: - Parent() {}; - virtual ~Parent() {}; - virtual void test() - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("parent called\n"))); - } -}; + virtual ~Child (void); + + virtual void test (void); -class Child : public Parent -{ - public: - Child() {}; - virtual~ Child() {}; - - virtual void test() - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("child called\n"))); - } }; #endif /* ACE_TESTS_DLL_TEST_H */ diff --git a/tests/DLL_Test_Impl.cpp b/tests/DLL_Test_Impl.cpp index bd38d12428f..87ed155dcc9 100644 --- a/tests/DLL_Test_Impl.cpp +++ b/tests/DLL_Test_Impl.cpp @@ -76,7 +76,7 @@ void Hello_Impl::operator delete (void *ptr) { ACE_DEBUG ((LM_INFO, "Hello_Impl::delete\n")); - delete [] ((char *) ptr); + ::delete [] static_cast<char *> (ptr); } extern "C" ACE_Svc_Export Hello * @@ -108,6 +108,21 @@ public: static Static_Constructor_Test the_instance; +// -------------------------------------------------------- + +Child::~Child (void) +{ +} + +void +Child::test (void) +{ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("child called\n"))); +} + +// -------------------------------------------------------- + + #if !defined (ACE_LACKS_RTTI) // Test dynamic cast extern "C" ACE_Svc_Export int diff --git a/tests/DLL_Test_Parent.cpp b/tests/DLL_Test_Parent.cpp new file mode 100644 index 00000000000..0664f5a7c92 --- /dev/null +++ b/tests/DLL_Test_Parent.cpp @@ -0,0 +1,19 @@ +// $Id$ + +#include "DLL_Test_Parent.h" +#include "ace/Log_Msg.h" + +ACE_RCSID (tests, + DLL_Test_Parent, + "$Id$") + + +Parent::~Parent (void) +{ +} + +void +Parent::test (void) +{ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("parent called\n"))); +} diff --git a/tests/DLL_Test_Parent.h b/tests/DLL_Test_Parent.h new file mode 100644 index 00000000000..3046dad48d4 --- /dev/null +++ b/tests/DLL_Test_Parent.h @@ -0,0 +1,34 @@ +// -*- C++ -*- + +// ================================================================ +/** + * @file DLL_Test_Parent.h + * + * $Id$ + * + * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> + * @author Ossama Othman <ossama@dre.vanderbilt.edu> + */ +// ================================================================ + +#ifndef ACE_TESTS_DLL_TEST_PARENT_H +#define ACE_TESTS_DLL_TEST_PARENT_H + +#include "DLL_Test_Parent_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +class DLL_Test_Parent_Export Parent +{ +public: + + virtual ~Parent (void); + + virtual void test (void); + +}; + +#endif /* ACE_TESTS_DLL_TEST_PARENT_H */ diff --git a/tests/DLL_Test_Parent_Export.h b/tests/DLL_Test_Parent_Export.h new file mode 100644 index 00000000000..226d40f5097 --- /dev/null +++ b/tests/DLL_Test_Parent_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s DLL_Test_Parent +// ------------------------------ +#ifndef DLL_TEST_PARENT_EXPORT_H +#define DLL_TEST_PARENT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DLL_TEST_PARENT_HAS_DLL) +# define DLL_TEST_PARENT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DLL_TEST_PARENT_HAS_DLL */ + +#if !defined (DLL_TEST_PARENT_HAS_DLL) +# define DLL_TEST_PARENT_HAS_DLL 1 +#endif /* ! DLL_TEST_PARENT_HAS_DLL */ + +#if defined (DLL_TEST_PARENT_HAS_DLL) && (DLL_TEST_PARENT_HAS_DLL == 1) +# if defined (DLL_TEST_PARENT_BUILD_DLL) +# define DLL_Test_Parent_Export ACE_Proper_Export_Flag +# define DLL_TEST_PARENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DLL_TEST_PARENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DLL_TEST_PARENT_BUILD_DLL */ +# define DLL_Test_Parent_Export ACE_Proper_Import_Flag +# define DLL_TEST_PARENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DLL_TEST_PARENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DLL_TEST_PARENT_BUILD_DLL */ +#else /* DLL_TEST_PARENT_HAS_DLL == 1 */ +# define DLL_Test_Parent_Export +# define DLL_TEST_PARENT_SINGLETON_DECLARATION(T) +# define DLL_TEST_PARENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DLL_TEST_PARENT_HAS_DLL == 1 */ + +// Set DLL_TEST_PARENT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DLL_TEST_PARENT_NTRACE) +# if (ACE_NTRACE == 1) +# define DLL_TEST_PARENT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DLL_TEST_PARENT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DLL_TEST_PARENT_NTRACE */ + +#if (DLL_TEST_PARENT_NTRACE == 1) +# define DLL_TEST_PARENT_TRACE(X) +#else /* (DLL_TEST_PARENT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DLL_TEST_PARENT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DLL_TEST_PARENT_NTRACE == 1) */ + +#endif /* DLL_TEST_PARENT_EXPORT_H */ + +// End of auto generated file. diff --git a/tests/dll_test_parent_lib.mpb b/tests/dll_test_parent_lib.mpb new file mode 100644 index 00000000000..fc6877e33e1 --- /dev/null +++ b/tests/dll_test_parent_lib.mpb @@ -0,0 +1,10 @@ +// -*- MPC -*- +// +// $Id$ + +project { + + after += DLL Test Parent Lib + libs += DLL_Test_Parent + +} diff --git a/tests/tests.mpc b/tests/tests.mpc index 3f98ed02855..b07ce6975f4 100644 --- a/tests/tests.mpc +++ b/tests/tests.mpc @@ -34,9 +34,25 @@ project(Framework Component DLL) : acelib { } } -project(DLL Test Lib) : acelib { + +project(DLL Test Parent Lib) : acelib { + sharedname = DLL_Test_Parent + dynamicflags = DLL_TEST_PARENT_BUILD_DLL + + Source_Files { + DLL_Test_Parent.cpp + } + Header_Files { + DLL_Test_Parent_Export.h + test_config.h + } + Resource_Files { + } +} + +project(DLL Test Lib) : acelib, dll_test_parent_lib { sharedname = DLL_Test - dynamicflags = ACE_BUILD_SVC_DLL + dynamicflags = ACE_SVC_BUILD_DLL Source_Files { DLL_Test_Impl.cpp @@ -50,7 +66,7 @@ project(DLL Test Lib) : acelib { project(Based Pointer Test Lib) : acelib { sharedname = Based_Pointer_Test - dynamicflags = ACE_BUILD_SVC_DLL + dynamicflags = ACE_SVC_BUILD_DLL Source_Files { Based_Pointer_Test_Lib.cpp @@ -282,7 +298,8 @@ project(DLList Test) : acetest { } } -project(DLL Test) : acetest { +project(DLL Test) : acetest, dll_test_parent_lib { + libs += DLL_Test exename = DLL_Test Source_Files { DLL_Test.cpp @@ -1208,6 +1225,7 @@ project(QtReactor Test) : acetest, ace_qtreactor { } project(Based Pointer Test) : acetest { + after += Based Pointer Test Lib exename = Based_Pointer_Test Source_Files { Based_Pointer_Test.cpp |