diff options
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 f0ec1c90815..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/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 *[]) -{ - ACE_START_TEST ("Timer_Queue_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; -} - |