summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-07-30 14:44:22 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-07-30 14:44:22 +0000
commit50c729f6a63d449e729aa9030af55d0e0fb6712d (patch)
treee61a42793ac0e374325e4498a6ae330efeeb73cb /ACE/tests
parentc27bbdb7f01766b7d62b2f5024d43915342e7803 (diff)
downloadATCD-50c729f6a63d449e729aa9030af55d0e0fb6712d.tar.gz
ChangeLogTag: Mon Jul 30 14:45:00 UTC 2007 Simon Massey <sma@prismtech.com>
Diffstat (limited to 'ACE/tests')
-rw-r--r--ACE/tests/Timer_Queue_Reference_Counting_Test.cpp4
-rw-r--r--ACE/tests/Timer_Queue_Test.cpp16
2 files changed, 13 insertions, 7 deletions
diff --git a/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp b/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp
index 08fbe99698a..7b36fd5f115 100644
--- a/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp
+++ b/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp
@@ -337,7 +337,7 @@ expire (ACE_Timer_Queue &timer_queue,
ACE_Time_Value (1));
ACE_ASSERT (timer_id != -1);
- timer_id =
+ result =
timer_queue.schedule (handler,
two_second_timeout,
ACE_Time_Value (2) + timer_queue.gettimeofday ());
@@ -370,6 +370,8 @@ expire (ACE_Timer_Queue &timer_queue,
i += result;
}
+
+ timer_queue.cancel (timer_id, 0, 0);
}
template<class TIMER_QUEUE>
diff --git a/ACE/tests/Timer_Queue_Test.cpp b/ACE/tests/Timer_Queue_Test.cpp
index 1a788f1fc26..2b3e87343a6 100644
--- a/ACE/tests/Timer_Queue_Test.cpp
+++ b/ACE/tests/Timer_Queue_Test.cpp
@@ -169,15 +169,17 @@ test_functionality (ACE_Timer_Queue *tq)
tq->gettimeofday ());
ACE_ASSERT (result != -1);
- ACE_NEW (timer_act, int (42));
+ const void *timer_act1 = 0;
+ ACE_NEW (timer_act1, int (42));
result = tq->schedule (&eh,
- timer_act,
+ timer_act1,
tq->gettimeofday () + ACE_Time_Value (100));
ACE_ASSERT (result != -1);
- ACE_NEW (timer_act, int (42));
+ const void *timer_act2 = 0;
+ ACE_NEW (timer_act2, int (42));
result = tq->schedule (&eh,
- timer_act,
+ timer_act2,
tq->gettimeofday () + ACE_Time_Value (100));
ACE_ASSERT (result != -1);
@@ -194,6 +196,8 @@ test_functionality (ACE_Timer_Queue *tq)
ACE_ASSERT (eh.close_count_ == 2);
ACE_ASSERT (tq->is_empty () != 0);
+ delete (int *) timer_act2;
+ delete (int *) timer_act1;
ACE_NEW (timer_act, int (4));
timer_id = tq->schedule (&eh,
@@ -252,14 +256,14 @@ test_functionality (ACE_Timer_Queue *tq)
ACE_ASSERT (eh.close_count_ == 3);
result = tq->cancel (timer_id, &timer_act);
- delete (int *) timer_act;
ACE_ASSERT (result == 1);
ACE_ASSERT (eh.close_count_ == 3);
+ delete (int *) timer_act;
result = tq->cancel (timer_id2, &timer_act);
- delete (int *) timer_act;
ACE_ASSERT (result == 1);
ACE_ASSERT (eh.close_count_ == 3);
+ delete (int *) timer_act;
result = tq->expire ();
ACE_ASSERT (result == 0);