Index: test/all_pairs_shortest_path_test.cc
===================================================================
--- test/all_pairs_shortest_path_test.cc	(revision 1956)
+++ test/all_pairs_shortest_path_test.cc	(revision 2242)
@@ -37,5 +37,4 @@
 
 int main(int argc, const char *argv[]) {
-  srand(time(0));
   typedef SmartGraph Graph;
   typedef Graph::Node Node;
@@ -44,10 +43,10 @@
   typedef Graph::EdgeIt EdgeIt;
 
-  typedef Graph::EdgeMap<double> LengthMap;
-  typedef Graph::NodeMap<double> DistMap;
+  typedef Graph::EdgeMap<int> LengthMap;
+  typedef Graph::NodeMap<int> DistMap;
 
   const int n = argc > 1 ? atoi(argv[1]) : 20;
   const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log((double)n));
-  const double m = argc > 3 ? (double)atoi(argv[3]) : 100.0;
+  const int m = argc > 3 ? atoi(argv[3]) : 100;
 
   Graph graph;
@@ -59,13 +58,12 @@
     Node node = graph.addNode();
     nodes.push_back(node);
-    shift[node] = m * (double)rand() / (RAND_MAX + 1.0);
+    shift[node] = rnd[m];
   }
 
   for (int i = 0; i < e; ++i) {
-    int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
-    int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
-    double c = m * (double)rand() / (RAND_MAX + 1.0);
+    int s = rnd[n];
+    int t = rnd[n];
     Edge edge = graph.addEdge(nodes[s], nodes[t]);
-    length[edge] = c - shift[nodes[s]] + shift[nodes[t]];
+    length[edge] = rnd[m] - shift[nodes[s]] + shift[nodes[t]];
   }
 
@@ -77,6 +75,6 @@
   }
 
-  typedef FibHeap<Node, double, Graph::NodeMap<int> > DoubleFibHeap;
-  Johnson<Graph, LengthMap>::DefStandardHeap<DoubleFibHeap>
+  typedef FibHeap<Node, int, Graph::NodeMap<int> > IntFibHeap;
+  Johnson<Graph, LengthMap>::DefStandardHeap<IntFibHeap>
     ::Create fibJohnson(graph, length);
   {
Index: test/arborescence_test.cc
===================================================================
--- test/arborescence_test.cc	(revision 2180)
+++ test/arborescence_test.cc	(revision 2242)
@@ -48,5 +48,4 @@
 
 int main() {
-  srand(time(0));
   typedef SmartGraph Graph;
   GRAPH_TYPEDEFS(Graph);
Index: test/graph_utils_test.cc
===================================================================
--- test/graph_utils_test.cc	(revision 2236)
+++ test/graph_utils_test.cc	(revision 2242)
@@ -117,5 +117,5 @@
     for (int i = 0; i < edgeNum; ++i) {
       edges[i] = 
-	graph.addEdge(nodes[urandom(nodeNum)], nodes[urandom(nodeNum)]);
+	graph.addEdge(nodes[rnd[nodeNum]], nodes[rnd[nodeNum]]);
     }
     for (int i = 0; i < nodeNum; ++i) {
Index: test/graph_utils_test.h
===================================================================
--- test/graph_utils_test.h	(revision 2229)
+++ test/graph_utils_test.h	(revision 2242)
@@ -57,6 +57,6 @@
     typename DescriptorMap<Graph, Node>::InverseMap invNodes(nodes);
     for (int i = 0; i < 100; ++i) {
-      int src = rnd.getInt(invNodes.size());
-      int trg = rnd.getInt(invNodes.size());
+      int src = rnd[invNodes.size()];
+      int trg = rnd[invNodes.size()];
       graph.addEdge(invNodes[src], invNodes[trg]);
     }
Index: test/heap_test.h
===================================================================
--- test/heap_test.h	(revision 2229)
+++ test/heap_test.h	(revision 2242)
@@ -46,5 +46,5 @@
 
   for (int i = 0; i < n; ++i) {
-    v[i] = rnd.getInt(1000);
+    v[i] = rnd[1000];
     heap.push(i, v[i]);
   }
@@ -66,9 +66,9 @@
 
   for (int i = 0; i < n; ++i) {
-    v[i] = rnd.getInt(1000);
+    v[i] = rnd[1000];
     heap.push(i, v[i]);
   }
   for (int i = 0; i < n; ++i) {
-    v[i] += rnd.getInt(1000);
+    v[i] += rnd[1000];
     heap.increase(i, v[i]);
   }
Index: test/matrix_maps_test.cc
===================================================================
--- test/matrix_maps_test.cc	(revision 2039)
+++ test/matrix_maps_test.cc	(revision 2242)
@@ -68,5 +68,5 @@
     for (Graph::NodeIt it(graph); it != INVALID; ++it) {
       for (Graph::NodeIt jt(graph); jt != INVALID; ++jt) {
-	int val = urandom(100);
+	int val = rnd[100];
 	matrix.set(it, jt, val);
 	check(matrix(it, jt) == val, "Wrong assign");
@@ -109,5 +109,5 @@
     for (Graph::NodeIt it(graph); it != INVALID; ++it) {
       for (Graph::NodeIt jt(graph); jt != INVALID; ++jt) {
-	int val = urandom(100);
+	int val = rnd[100];
 	matrix.set(it, jt, val);
 	check(matrix(it, jt) == val, "Wrong assign");
@@ -155,5 +155,5 @@
     for (Graph::NodeIt it(graph1); it != INVALID; ++it) {
       for (Graph::EdgeIt jt(graph2); jt != INVALID; ++jt) {
-	int val = urandom(100);
+	int val = rnd[100];
 	matrix.set(it, jt, val);
 	check(matrix(it, jt) == val, "Wrong assign");
@@ -199,5 +199,5 @@
     for (Graph::NodeIt it(graph); it != INVALID; ++it) {
       for (Graph::NodeIt jt(graph); jt != INVALID; ++jt) {
-	int val = urandom(100);
+	int val = rnd[100];
 	matrix.set(it, jt, val);
 	check(matrix(it, jt) == val, "Wrong assign");
Index: test/radix_sort_test.cc
===================================================================
--- test/radix_sort_test.cc	(revision 1956)
+++ test/radix_sort_test.cc	(revision 2242)
@@ -38,5 +38,5 @@
     vector<int> data1(n), data2(n);
     for (int i = 0; i < n; ++i) {
-      data1[i] = data2[i] = (int)(1000 * (rand() / (RAND_MAX + 1.0))) - 500;
+      data1[i] = data2[i] = rnd[1000] - 500;
     }
     radixSort(data1.begin(), data1.end());
@@ -49,5 +49,5 @@
     vector<unsigned char> data1(n), data2(n);
     for (int i = 0; i < n; ++i) {
-      data1[i] = data2[i] = (int)(200 * (rand() / (RAND_MAX + 1.0)));
+      data1[i] = data2[i] = rnd[(unsigned char)200];
     }
     radixSort(data1.begin(), data1.end());
@@ -65,5 +65,5 @@
     vector<int> data1(n), data2(n);
     for (int i = 0; i < n; ++i) {
-      data1[i] = data2[i] = (int)(1000 * (rand() / (RAND_MAX + 1.0))) - 500;
+      data1[i] = data2[i] = rnd[1000] - 500;
     }
     counterSort(data1.begin(), data1.end());
@@ -76,5 +76,5 @@
     vector<unsigned char> data1(n), data2(n);
     for (int i = 0; i < n; ++i) {
-      data1[i] = data2[i] = (int)(200 * (rand() / (RAND_MAX + 1.0)));
+      data1[i] = data2[i] = rnd[(unsigned char)200];
     }
     counterSort(data1.begin(), data1.end());
@@ -107,6 +107,6 @@
   vector<Edge> edges;
   for (int i = 0; i < e; ++i) {
-    int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
-    int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
+    int s = rnd[n];
+    int t = rnd[n];
     edges.push_back(graph.addEdge(nodes[s], nodes[t]));
   }
@@ -146,6 +146,6 @@
   vector<Edge> edges;
   for (int i = 0; i < e; ++i) {
-    int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
-    int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
+    int s = rnd[n];
+    int t = rnd[n];
     edges.push_back(graph.addEdge(nodes[s], nodes[t]));
   }
Index: test/simann_test.cc
===================================================================
--- test/simann_test.cc	(revision 1956)
+++ test/simann_test.cc	(revision 2242)
@@ -24,8 +24,8 @@
 public:
   double d, prev_d;
-  MyEntity() : d(100000.0) { srand48(time(0)); }
+  MyEntity() : d(100000.0) {}
   double mutate() {
     prev_d = d;
-    if (drand48() < 0.8) { d += 1.0; }
+    if (rnd.boolean(0.8)) { d += 1.0; }
     else { d -= 1.0; }
     return d;
Index: test/test_tools.h
===================================================================
--- test/test_tools.h	(revision 2229)
+++ test/test_tools.h	(revision 2242)
@@ -175,11 +175,7 @@
    n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%5]));
    n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));
-  }
+ }
  return n;
 }
 
-int urandom(int n) {
-  return rnd.getInt(n);
-}
-
 #endif
