diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-09 11:07:44 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-09 11:07:44 +0000 |
commit | 44ea07f39e5d05a9c1d47f0ae9803c66c426368a (patch) | |
tree | 582527d6e54c7b18a95116b08ed48224d2ee9506 | |
parent | 78da1cc51d6832f7827f70f89b420cfcc3777d59 (diff) | |
download | ATCD-44ea07f39e5d05a9c1d47f0ae9803c66c426368a.tar.gz |
*** empty log message ***
-rw-r--r-- | tests/Collection_Test.cpp | 78 | ||||
-rw-r--r-- | tests/Makefile | 1 | ||||
-rw-r--r-- | tests/Timeprobe_Test.cpp | 2 | ||||
-rw-r--r-- | tests/run_tests.bat | 1 | ||||
-rwxr-xr-x | tests/run_tests.psosim | 1 | ||||
-rwxr-xr-x | tests/run_tests.sh | 1 | ||||
-rw-r--r-- | tests/run_tests.vxworks | 4 |
7 files changed, 87 insertions, 1 deletions
diff --git a/tests/Collection_Test.cpp b/tests/Collection_Test.cpp new file mode 100644 index 00000000000..782fcc8c022 --- /dev/null +++ b/tests/Collection_Test.cpp @@ -0,0 +1,78 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// tests +// +// = FILENAME +// Collection_Test.cpp +// +// = DESCRIPTION +// This is a simple test of the ACE collection classes and its +// iterators. +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#include "test_config.h" + +ACE_RCSID(tests, Collection_Test, "$Id$") + +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + +#include "ace/Containers.h" + +typedef int DATA; + +typedef ACE_Unbounded_Set<DATA> COLLECTION; +typedef ACE_Unbounded_Set_Iterator<DATA> ITERATOR; + +int main (int argc, char **argv) +{ + ACE_START_TEST (ASYS_TEXT ("Collection_Test")); + + COLLECTION collection; + + collection.insert (1); + collection.insert (2); + + for (COLLECTION::iterator iterator1 = collection.begin (); + iterator1 != collection.end (); + iterator1++) + { + ACE_DEBUG ((LM_DEBUG, "%d\n", + (*iterator1))); + } + + ITERATOR iterator2 (collection); + while (!iterator2.done ()) + { + int *data = 0; + iterator2.next (data); + ACE_DEBUG ((LM_DEBUG, "%d\n", + (*data))); + iterator2.advance (); + } + + ACE_END_TEST; + + return 0; +} + + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Unbounded_Set_Iterator<DATA>; +template class ACE_Unbounded_Set<DATA>; +template class ACE_Node<DATA>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Unbounded_Set_Iterator<DATA> +#pragma instantiate ACE_Unbounded_Set<DATA> +#pragma instantiate ACE_Node<DATA> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/tests/Makefile b/tests/Makefile index 835eea556f4..41f46e1f16e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -14,6 +14,7 @@ BIN = Aio_Platform_Test \ Barrier_Test \ Basic_Types_Test \ Buffer_Stream_Test \ + Collection_Test \ Conn_Test \ DLList_Test \ DLL_Test\ diff --git a/tests/Timeprobe_Test.cpp b/tests/Timeprobe_Test.cpp index d9638a9cae9..84414c5379d 100644 --- a/tests/Timeprobe_Test.cpp +++ b/tests/Timeprobe_Test.cpp @@ -16,7 +16,7 @@ // // ============================================================================ -//#define ACE_ENABLE_TIMEPROBES +#define ACE_ENABLE_TIMEPROBES //#define ACE_MT_TIMEPROBES //#define ACE_TSS_TIMEPROBES diff --git a/tests/run_tests.bat b/tests/run_tests.bat index cdbcba162b2..08e30400650 100644 --- a/tests/run_tests.bat +++ b/tests/run_tests.bat @@ -26,6 +26,7 @@ call %0 %dopure% Atomic_Op_Test call %0 %dopure% Barrier_Test call %0 %dopure% Basic_Types_Test call %0 %dopure% Buffer_Stream_Test +call %0 %dopure% Collection_Test call %0 %dopure% Conn_Test call %0 %dopure% DLL_Test call %0 %dopure% DLList_Test diff --git a/tests/run_tests.psosim b/tests/run_tests.psosim index 11c84bcbd15..9d15fae142b 100755 --- a/tests/run_tests.psosim +++ b/tests/run_tests.psosim @@ -43,6 +43,7 @@ run Basic_Types_Test run Time_Value_Test run High_Res_Timer_Test run SString_Test +run Collection_Test # SYS V IPC not supported #run Naming_Test # uses Naming_Context, WString diff --git a/tests/run_tests.sh b/tests/run_tests.sh index a2ec05da309..7fdffa946f0 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -104,6 +104,7 @@ run Timeprobe_Test # tests ACE_Timeprobes run Time_Value_Test # tests Time_Value run High_Res_Timer_Test # tests High_Res_Timer run SString_Test # tests ACE_CString and ACE_SString +run Collection_Test # tests ACE Collection classes test $chorus || test $LynxOS || run Naming_Test # tests ACE_Naming_Context, ACE_WString run Handle_Set_Test # tests ACE_Handle_Set diff --git a/tests/run_tests.vxworks b/tests/run_tests.vxworks index 28b505369bb..9b4dfa33d2a 100644 --- a/tests/run_tests.vxworks +++ b/tests/run_tests.vxworks @@ -71,6 +71,10 @@ ld < SString_Test write 2, "SString_Test ", 13 ace_main; unld "SString_Test" +ld < Collection_Test +write 2, "Collection_Test ", 16 +ace_main; unld "Collection_Test" + ld < Handle_Set_Test write 2, "Handle_Set_Test ", 16 ace_main; unld "Handle_Set_Test" |