summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-12 23:22:03 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-12 23:22:03 +0000
commit7ba367951ae0a69cc03e5bada9565317d2adf5b9 (patch)
treef96ff8b242eec6f7ba6385cf68d141fa1d9e3f97 /tests
parent7d0a77d616c138f09461e832454e0ce7cc87735b (diff)
downloadATCD-7ba367951ae0a69cc03e5bada9565317d2adf5b9.tar.gz
ChangeLogTag:Mon Jul 12 18:24:34 1999 Kirthika Parameswaran <kirthika@cs.wustl.edu>
Diffstat (limited to 'tests')
-rw-r--r--tests/Cached_Conn_Test.cpp141
-rw-r--r--tests/Makefile2
-rwxr-xr-xtests/run_pharlap_tests.bat1
-rw-r--r--tests/run_tests.bat1
-rwxr-xr-xtests/run_tests.psosim11
-rwxr-xr-xtests/run_tests.sh1
-rw-r--r--tests/run_tests.vxworks14
7 files changed, 113 insertions, 58 deletions
diff --git a/tests/Cached_Conn_Test.cpp b/tests/Cached_Conn_Test.cpp
index 799e5f9831e..2f347caf26e 100644
--- a/tests/Cached_Conn_Test.cpp
+++ b/tests/Cached_Conn_Test.cpp
@@ -25,7 +25,7 @@
#include "test_config.h"
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
+#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ < 8
#define ACE_HAS_BROKEN_EXTENDED_TEMPLATES
#endif /* __GNUC__ */
@@ -58,31 +58,36 @@ class Svc_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
{
public:
- Svc_Handler (ACE_Thread_Manager *t = 0)
- : ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> (t)
- {
- }
+ Svc_Handler (ACE_Thread_Manager *t = 0);
+ int open (void *v = 0);
+ int close (u_long flags = 0);
+};
- int open (void *v = 0)
- {
- ACE_UNUSED_ARG (v);
- if (debug)
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("opening Svc_Handler %d with handle %d\n"),
- this,
- this->peer ().get_handle ()));
- return 0;
- }
+Svc_Handler::Svc_Handler (ACE_Thread_Manager *t)
+ : ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> (t)
+{
+}
- int close (u_long flags = 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("Closing Svc_Handler %d with handle %d\n"),
- this,
- this->peer ().get_handle ()));
- return ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>::close (flags);
- }
-};
+int
+Svc_Handler::open (void *)
+{
+ if (debug)
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("opening Svc_Handler %d with handle %d\n"),
+ this,
+ this->peer ().get_handle ()));
+ return 0;
+}
+
+int
+Svc_Handler::close (u_long flags)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("Closing Svc_Handler %d with handle %d\n"),
+ this,
+ this->peer ().get_handle ()));
+ return ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>::close (flags);
+}
typedef size_t ATTRIBUTES;
typedef ACE_Pair<Svc_Handler *, ATTRIBUTES>
@@ -98,22 +103,29 @@ typedef ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_M
HASH_MAP_ITERATOR;
typedef ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>
HASH_MAP_REVERSE_ITERATOR;
+
typedef ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>
CLEANUP_STRATEGY;
typedef ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>
CACHING_UTILITY;
-typedef ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
- CACHING_STRATEGY;
typedef ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
LRU_CACHING_STRATEGY;
+
+#if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES)
+
+typedef LRU_CACHING_STRATEGY
+ CACHING_STRATEGY;
+
+#else
+
typedef ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
LFU_CACHING_STRATEGY;
typedef ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
FIFO_CACHING_STRATEGY;
typedef ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
NULL_CACHING_STRATEGY;
-typedef ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY >
+typedef ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>
LRU_CACHING_STRATEGY_ADAPTER;
typedef ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>
LFU_CACHING_STRATEGY_ADAPTER;
@@ -121,6 +133,10 @@ typedef ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_S
FIFO_CACHING_STRATEGY_ADAPTER;
typedef ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>
NULL_CACHING_STRATEGY_ADAPTER;
+typedef ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+ CACHING_STRATEGY;
+
+#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */
typedef ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR>
ACCEPTOR;
@@ -291,6 +307,19 @@ test_connection_management (CACHING_STRATEGY &caching_strategy)
}
}
+#if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES)
+
+void
+test_caching_strategy_type (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "\nLRU_Caching_Strategy\n\n"));
+ CACHING_STRATEGY caching_strategy;
+ caching_strategy.purge_percent (purge_percentage);
+ test_connection_management (caching_strategy);
+}
+
+#else
+
void
test_caching_strategy_type (void)
{
@@ -331,6 +360,7 @@ test_caching_strategy_type (void)
delete caching_strategy;
}
+#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */
int
parse_args (int argc, char *argv[])
@@ -477,12 +507,28 @@ template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS
// = Caching_Strategy
template class ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>;
+template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
+
#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES)
+
+template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
+template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
+template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
+template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
+
+template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>;
+template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>;
+template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>;
+template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>;
+
template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>;
template class ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>;
template class ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>;
+
#else
+
template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>;
+
#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */
template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>;
@@ -492,17 +538,6 @@ template class ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>;
template class ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>;
template class ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>;
-template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
-template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
-template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
-template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
-template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>;
-
-template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>;
-template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>;
-template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>;
-template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>;
-
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
@@ -540,7 +575,7 @@ template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CA
#pragma instantiate ACE_Hash_Map_Manager<ADDR, Svc_Handler *, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>
-#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>
#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>
@@ -556,12 +591,28 @@ template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CA
// = Caching_Strategy
#pragma instantiate ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>
+#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+
#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES)
+
+#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
+
+#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>
+#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>
+#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>
+#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>
+
#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>
#pragma instantiate ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>
#pragma instantiate ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>
+
#else
+
#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>
+
#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */
#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>
@@ -571,18 +622,6 @@ template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CA
#pragma instantiate ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>
#pragma instantiate ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>
-#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
-#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
-#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
-#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
-#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
-
-#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>
-#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>
-#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>
-#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>
-
-
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
#endif /* CACHED_CONNECT_TEST */
diff --git a/tests/Makefile b/tests/Makefile
index f3378c6c912..83ca363dadf 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -15,6 +15,7 @@ BIN = Aio_Platform_Test \
Basic_Types_Test \
Buffer_Stream_Test \
Cache_Map_Manager_Test \
+ Cached_Conn_Test \
CDR_Test \
Collection_Test \
Conn_Test \
@@ -6392,3 +6393,4 @@ realclean: clean
$(ACE_ROOT)/ace/Token_Invariants.i
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/tests/run_pharlap_tests.bat b/tests/run_pharlap_tests.bat
index 8b34bfcf42c..d87c9a5840a 100755
--- a/tests/run_pharlap_tests.bat
+++ b/tests/run_pharlap_tests.bat
@@ -22,6 +22,7 @@ call %0 Buffer_Stream_Test
call %0 CDR_Test
call %0 Collection_Test
call %0 Conn_Test
+call %0 Cached_Conn_Test
call %0 DLL_Test
call %0 DLList_Test
call %0 Enum_Interfaces_Test
diff --git a/tests/run_tests.bat b/tests/run_tests.bat
index f0625695664..dd5ed5efcba 100644
--- a/tests/run_tests.bat
+++ b/tests/run_tests.bat
@@ -81,6 +81,7 @@ call %run_cmd% %dopure% %platform% High_Res_Timer_Test
call %run_cmd% %dopure% %platform% IOStream_Test
call %run_cmd% %dopure% %platform% Map_Manager_Test
call %run_cmd% %dopure% %platform% Cache_Map_Manager_Test
+call %run_cmd% %dopure% %platform% Cached_Conn_Test
call %run_cmd% %dopure% %platform% Map_Test
call %run_cmd% %dopure% %platform% Mem_Map_Test
call %run_cmd% %dopure% %platform% Message_Block_Test
diff --git a/tests/run_tests.psosim b/tests/run_tests.psosim
index 0d810f84ede..d0502bf7454 100755
--- a/tests/run_tests.psosim
+++ b/tests/run_tests.psosim
@@ -136,7 +136,11 @@ run Reverse_Lock_Test # uses ACE_Reverse_Lock
#Tokens_Test: threads not supported on this platform
#run Tokens_Test
-# run Map_Manager_Test # uses Map Manager and Hash Map Manager + Forward and Reverse Map Iterators.
+run Map_Manager_Test # uses Map Manager and Hash Map Manager + Forward and Reverse Map Iterators.
+
+run Cache_Map_Manager_Test # uses Cache Map Manager and Hash Cache Map Manager + Forward and Reverse Map Iterators.
+
+run Cached_Conn_Test # uses Cached connection management
run Map_Test # uses Map + Forward and Reverse Map Iterators.
@@ -167,12 +171,11 @@ run Service_Config_Test # uses Service_Config
run IOStream_Test # uses ACE_IOStream and ACE_SOCK_Stream
run Enum_Interfaces_Test # uses ACE::get_ip_interfaces()
-#Conn_Test: requires either fork or threads
-#run Conn_Test # uses Thread_Manager, Acceptor/Connector, SOCK_SAP
+run Conn_Test # uses Thread_Manager, Acceptor/Connector, SOCK_SAP
run Upgradable_RW_Test # uses RW locks
-run Svc_Handler_Test
+run Svc_Handler_Test
echo "Tests complete..."
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index e114b02649f..7c6760e2dde 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -188,6 +188,7 @@ fi
test $TOKEN && (test $chorus || test $Unicos || run Tokens_Test) # tests ACE_Token
run Cache_Map_Manager_Test # tests ACE_Cache_Map_Manager and ACE_Hash_Cache_Manager and caching features.
+run Cached_Conn_Test # tests connection management features.
run Map_Manager_Test # tests ACE_Map Manager and ACE_Hash_Map_Manager + Forward and Reverse Map Iterators.
run Map_Test # tests ACE_Map + Forward and Reverse Map Iterators.
run Message_Queue_Notifications_Test # tests ACE_Message_Queue + ACE_Reactor
diff --git a/tests/run_tests.vxworks b/tests/run_tests.vxworks
index 4b7d45e8f5d..75dc6ab9e2c 100644
--- a/tests/run_tests.vxworks
+++ b/tests/run_tests.vxworks
@@ -171,6 +171,10 @@ ld < Conn_Test
write 2, "Conn_Test ", 10
ace_main; unld "Conn_Test"
+ld < Cached_Conn_Test
+write 2, "Cached_Conn_Test ", 17
+ace_main; unld "Cached_Conn_Test"
+
ld < Barrier_Test
write 2, "Barrier_Test ", 13
ace_main; unld "Barrier_Test"
@@ -196,9 +200,13 @@ ld < Reverse_Lock_Test
write 2, "Reverse_Lock_Test ", 18
ace_main; unld "Reverse_Lock_Test"
-#### ld < Map_Manager_Test
-#### write 2, "Map_Manager_Test ", 17
-#### ace_main; unld "Map_Manager_Test"
+ld < Map_Manager_Test
+write 2, "Map_Manager_Test ", 17
+ace_main; unld "Map_Manager_Test"
+
+ld < Cache_Map_Manager_Test
+write 2, "Cache_Map_Manager_Test ", 23
+ace_main; unld "Cache_Map_Manager_Test"
ld < Map_Test
write 2, "Map_Test ", 9