List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:August 26 2008 2:52pm
Subject:bzr commit into mysql-5.1 branch (stewart:2806)
View as plain text  
#At file:///home/stewart/mysql/ndbwin32/

 2806 Stewart Smith	2008-08-26
      use portable ndb_rand in testDict (as random() and srandom() aren't available on Win32)
modified:
  storage/ndb/test/ndbapi/testDict.cpp

=== modified file 'storage/ndb/test/ndbapi/testDict.cpp'
--- a/storage/ndb/test/ndbapi/testDict.cpp	2008-08-07 12:32:06 +0000
+++ b/storage/ndb/test/ndbapi/testDict.cpp	2008-08-26 12:51:57 +0000
@@ -27,6 +27,7 @@
 #include <NdbMixRestarter.hpp>
 #include <NdbSqlUtil.hpp>
 #include <NdbEnv.h>
+#include <ndb_rand.h>
 
 char f_tablename[256];
  
@@ -3500,7 +3501,7 @@ static uint
 urandom(uint m)
 {
   assert(m != 0);
-  uint n = (uint)random();
+  uint n = (uint)ndb_rand();
   return n % m;
 }
 
@@ -6021,7 +6022,7 @@ runSchemaTrans(NDBT_Context* ctx, NDBT_S
     st_random_seed = (short)getpid();
   if (st_random_seed != 0) {
     g_err << "random seed: " << st_random_seed << endl;
-    srandom(st_random_seed);
+    ndb_srand(st_random_seed);
   } else {
     g_err << "random seed: loop number" << endl;
   }
@@ -6040,7 +6041,7 @@ runSchemaTrans(NDBT_Context* ctx, NDBT_S
   for (c.loop = 0; numloops == 0 || c.loop < numloops; c.loop++) {
     g_err << "LOOP " << c.loop << endl;
     if (st_random_seed == 0)
-      srandom(c.loop);
+      ndb_srand(c.loop);
     int i;
     for (i = 0; i < st_test_count; i++) {
       const ST_Test& test = st_test_list[i];

Thread
bzr commit into mysql-5.1 branch (stewart:2806) Stewart Smith27 Aug