summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-08 23:49:40 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-08 23:49:40 +0000
commit013f04adf7d4e6a055c50c031696a5e7807bae41 (patch)
treeec70c06a92f088e2a75f745aed0b35121ac5df8d
parent655b2c6e574f22a05bcb0c5d403a3c34e589bb08 (diff)
downloadATCD-013f04adf7d4e6a055c50c031696a5e7807bae41.tar.gz
do on
-rw-r--r--ChangeLog-97b7
-rw-r--r--tests/Handle_Set_Test.cpp20
2 files changed, 17 insertions, 10 deletions
diff --git a/ChangeLog-97b b/ChangeLog-97b
index e70c48c8f50..f11b6c86ebb 100644
--- a/ChangeLog-97b
+++ b/ChangeLog-97b
@@ -1,3 +1,10 @@
+Mon Sep 8 18:38:22 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * tests/Handle_Set_Test.cpp: It is possible for the order to get
+ the handles (using the iterator) will not agree with insert
+ order in ACE_Unbounded_Queue. It's best to use
+ ACE_Unbounded_Set. Thanks to Arturo for this fix.
+
Mon Sep 8 17:43:43 1997 Darrell Brunsch <brunsch@cs.wustl.edu>
* ace/Timer_{List,Wheel,Hash,Heap}_T.cpp: The iter() method now
diff --git a/tests/Handle_Set_Test.cpp b/tests/Handle_Set_Test.cpp
index 3a2df88b3fb..40bdff12292 100644
--- a/tests/Handle_Set_Test.cpp
+++ b/tests/Handle_Set_Test.cpp
@@ -73,7 +73,9 @@ static ACE_HANDLE handle_vector[] =
(ACE_HANDLE) 127,
(ACE_HANDLE) 128,
(ACE_HANDLE) 129,
+#if defined(ACE_DEFAULT_REACTOR_SIZE) && ACE_DEFAULT_REACTOR_SIZE >= 255
(ACE_HANDLE) 255,
+#endif
ACE_INVALID_HANDLE
};
@@ -81,7 +83,7 @@ static void
test_boundaries (void)
{
ACE_Handle_Set handle_set;
- ACE_Unbounded_Queue<ACE_HANDLE> queue;
+ ACE_Unbounded_Set<ACE_HANDLE> set;
ACE_HANDLE handle;
// First test an empty set.
@@ -98,18 +100,16 @@ test_boundaries (void)
i++)
{
handle_set.set_bit (handle_vector[i]);
- queue.enqueue_tail (handle_vector[i]);
+ set.insert (handle_vector[i]);
}
int count = 0;
ACE_Handle_Set_Iterator i2 (handle_set);
-
while ((handle = i2 ()) != ACE_INVALID_HANDLE)
{
- ACE_HANDLE temp;
- queue.dequeue_head (temp);
- ACE_ASSERT (handle == temp);
+ int done = set.remove(handle);
+ ACE_ASSERT(done == 0);
count++;
}
@@ -178,12 +178,12 @@ main (int argc, char *argv[])
}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Queue<ACE_HANDLE>;
-template class ACE_Unbounded_Queue_Iterator<ACE_HANDLE>;
+template class ACE_Unbounded_Set<ACE_HANDLE>;
+template class ACE_Unbounded_Set_Iterator<ACE_HANDLE>;
template class ACE_Node<ACE_HANDLE>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Unbounded_Queue<ACE_HANDLE>
-#pragma instantiate ACE_Unbounded_Queue_Iterator<ACE_HANDLE>
+#pragma instantiate ACE_Unbounded_Set<ACE_HANDLE>
+#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_HANDLE>
#pragma instantiate ACE_Node<ACE_HANDLE>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */