diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
commit | a4a7690c336d4c8a16b3041c86d501ba38226e96 (patch) | |
tree | 9e9f93a98edd2591453f092d178ad29a1c5fb519 /tests/Message_Queue_Test.cpp | |
parent | a5c4d8047ab58df5c45092e18ae503ad40518f0e (diff) | |
download | ATCD-unlabeled-4.1.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.1.2
'unlabeled-4.1.2'.
Diffstat (limited to 'tests/Message_Queue_Test.cpp')
-rw-r--r-- | tests/Message_Queue_Test.cpp | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/tests/Message_Queue_Test.cpp b/tests/Message_Queue_Test.cpp deleted file mode 100644 index 3e9c51ec825..00000000000 --- a/tests/Message_Queue_Test.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Message_Queue_Test.cpp -// -// = DESCRIPTION -// This is a simple test of the ACE_Message_Queue that -// illustrates how to use the forward and reverse iterators. -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ - -#include "ace/Message_Queue.h" -#include "ace/Synch.h" -#include "test_config.h" - -typedef ACE_Message_Queue <ACE_NULL_SYNCH> QUEUE; -typedef ACE_Message_Queue_Iterator <ACE_NULL_SYNCH> ITERATOR; -typedef ACE_Message_Queue_Reverse_Iterator <ACE_NULL_SYNCH> REVERSE_ITERATOR; - -int -main (int, char *[]) -{ - ACE_START_TEST ("Message_Queue_Test"); - - const int ITERATIONS = 5; - QUEUE queue; - - for (int i = 1; i <= ITERATIONS; i++) - { - char *buffer; - ACE_NEW_RETURN (buffer, char[BUFSIZ], -1); - ::sprintf (buffer, "%d", i); - - ACE_Message_Block *entry; - - ACE_NEW_RETURN (entry, ACE_Message_Block (buffer, sizeof buffer), -1); - - if (queue.enqueue_prio (entry) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "QUEUE::enqueue_prio\n"), -1); - } - - ACE_DEBUG ((LM_DEBUG, "\nForward Iterations\n")); - { - ITERATOR iterator (queue); - - for (ACE_Message_Block *entry = 0; - iterator.next (entry) != 0; - iterator.advance ()) - ACE_DEBUG ((LM_DEBUG, "%s\n", entry->base ())); - } - - ACE_DEBUG ((LM_DEBUG, "\nReverse Iterations\n")); - { - REVERSE_ITERATOR iterator (queue); - - for (ACE_Message_Block *entry = 0; - iterator.next (entry) != 0; - iterator.advance ()) - ACE_DEBUG ((LM_DEBUG, "%s\n", entry->base ())); - } - - ACE_DEBUG ((LM_DEBUG, "\nForward Iterations\n")); - { - QUEUE::ITERATOR iterator (queue); - - for (ACE_Message_Block *entry = 0; - iterator.next (entry) != 0; - iterator.advance ()) - ACE_DEBUG ((LM_DEBUG, "%s\n", entry->base ())); - } - - ACE_DEBUG ((LM_DEBUG, "\nReverse Iterations\n")); - { - QUEUE::REVERSE_ITERATOR iterator (queue); - - for (ACE_Message_Block *entry = 0; - iterator.next (entry) != 0; - iterator.advance ()) - ACE_DEBUG ((LM_DEBUG, "%s\n", entry->base ())); - } - - ACE_END_TEST; - return 0; -} |