summaryrefslogtreecommitdiff
path: root/examples/Reactor/Misc/test_handle_set.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
commitd9661aebab28abc0ec4fb1e716170d347d56c168 (patch)
treeecb671ab4b8e299bf5cbb8b2dfeed8a49b65fc06 /examples/Reactor/Misc/test_handle_set.cpp
parentea0d28240863caf437a18071bfd03e7b146c5ade (diff)
downloadATCD-unlabeled-4.3.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.3.2
'unlabeled-4.3.2'.
Diffstat (limited to 'examples/Reactor/Misc/test_handle_set.cpp')
-rw-r--r--examples/Reactor/Misc/test_handle_set.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/examples/Reactor/Misc/test_handle_set.cpp b/examples/Reactor/Misc/test_handle_set.cpp
deleted file mode 100644
index cfd4791f6e8..00000000000
--- a/examples/Reactor/Misc/test_handle_set.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-
-// $Id$
-
-#include "ace/Handle_Set.h"
-
-void
-test1 (int count)
-{
- int duplicates = 0;
- int sets = 0;
- int clears = 0;
-
- ACE_Handle_Set handle_set;
-
- ACE_OS::srand (ACE_OS::time (0L));
-
- for (int j = 0; j < count; j++)
- {
- int i = int (ACE_OS::rand () % ACE_Handle_Set::MAXSIZE);
-
- if (ACE_ODD (i))
- {
- if (handle_set.is_set (i))
- duplicates++;
-
- handle_set.set_bit (i);
- sets++;
- }
- else
- {
- if (handle_set.is_set (i))
- duplicates--;
-
- handle_set.clr_bit (i);
- clears++;
- }
- }
-
- ACE_DEBUG ((LM_DEBUG, "count = %d, set_size = %d, duplicates = %d\n",
- count, handle_set.num_set (), (sets - clears) == duplicates));
-}
-
-void
-test2 (void)
-{
- ACE_Handle_Set handle_set;
- ACE_HANDLE handle;
-
- handle_set.set_bit (0);
- handle_set.set_bit (1);
- handle_set.set_bit (32);
- handle_set.set_bit (63);
- handle_set.set_bit (64);
- handle_set.set_bit (65);
- handle_set.set_bit (122);
- handle_set.set_bit (129);
- handle_set.set_bit (245);
- handle_set.set_bit (255);
-
- for (ACE_Handle_Set_Iterator fi (handle_set);
- (handle = fi ()) != -1;
- ++fi)
- ACE_DEBUG ((LM_DEBUG, "handle = %d\n", handle));
-}
-
-int
-main (int argc, char *argv[])
-{
- int count = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_Handle_Set::MAXSIZE;
- test1 (count);
- test2 ();
-}
-