diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-12 21:39:32 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-12 21:39:32 +0000 |
commit | 6c8d74487fcf8c8418ff5205d0bc08dd99e1e34e (patch) | |
tree | 557e544d8274c8e0404d336c0e9b0e6cb36e7e72 /tests/Timer_Queue_Test.cpp | |
parent | add7fcff0bc337851545e695aaf25c8c64b547b5 (diff) | |
download | ATCD-java-1_0_1a.tar.gz |
This commit was manufactured by cvs2svn to create tag 'java-1_0_1a'.java-1_0_1a
Diffstat (limited to 'tests/Timer_Queue_Test.cpp')
-rw-r--r-- | tests/Timer_Queue_Test.cpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/Timer_Queue_Test.cpp b/tests/Timer_Queue_Test.cpp deleted file mode 100644 index 956e4f38faa..00000000000 --- a/tests/Timer_Queue_Test.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// ============================================================================ -// $Id$ - -// -// = LIBRARY -// tests -// -// = FILENAME -// Timer_Queue_Test.cpp -// -// = DESCRIPTION -// This is a simple test of ACE_Timer_Queue. The test sets up a -// bunch of timers and then adds them to a timer queue. The -// functionality of the timer queue is then tested. No command line -// arguments are needed to run the test. -// -// = AUTHOR -// Prashant Jain -// -// ============================================================================ - -#include "ace/Log_Msg.h" -#include "ace/Timer_Queue.h" -#include "test_config.h" - -class Example_Handler : public ACE_Event_Handler -{ -public: - virtual int handle_timeout (const ACE_Time_Value &, - const void *arg) - { - ACE_ASSERT ((int) arg == 42); - return 0; - } -}; - -int -main (int, char *argv[]) -{ - ACE_START_TEST; - - ACE_Timer_Queue tq; - Example_Handler eh; - - ACE_ASSERT (tq.is_empty ()); - ACE_ASSERT (ACE_Time_Value::zero == ACE_Time_Value (0)); - int timer_id; - - timer_id = tq.schedule (&eh, (const void *) 1, ACE_OS::gettimeofday ()); - tq.schedule (&eh, (const void *) 42, ACE_OS::gettimeofday ()); - tq.schedule (&eh, (const void *) 42, ACE_OS::gettimeofday ()); - tq.cancel (timer_id); - ACE_ASSERT (!tq.is_empty ()); - - tq.expire (ACE_OS::gettimeofday ()); - - tq.schedule (&eh, (const void *) 4, ACE_OS::gettimeofday ()); - tq.schedule (&eh, (const void *) 5, ACE_OS::gettimeofday ()); - tq.cancel (&eh); - ACE_ASSERT (tq.is_empty ()); - tq.expire (ACE_OS::gettimeofday ()); - - ACE_END_TEST; - return 0; -} - |