summaryrefslogtreecommitdiff
path: root/tests/test_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_config.h')
-rw-r--r--tests/test_config.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_config.h b/tests/test_config.h
index 4f964ccb05e..034dacb76f0 100644
--- a/tests/test_config.h
+++ b/tests/test_config.h
@@ -192,4 +192,26 @@ ACE_Test_Output::close (void)
this->output_file_.flush ();
this->output_file_.close ();
}
+
+static void
+randomize (int array[], size_t size)
+{
+ size_t i;
+
+ for (i = 0; i < size; i++)
+ array [i] = i;
+
+ ACE_OS::srand (ACE_OS::time (0L));
+
+ // Generate an array of random numbers from 0 .. size - 1.
+
+ for (i = 0; i < size; i++)
+ {
+ int index = ACE_OS::rand() % size--;
+ int temp = array [index];
+ array [index] = array [size];
+ array [size] = temp;
+ }
+}
+
#endif /* ACE_TEST_CONFIG_H */