summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-10-03 20:46:50 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-10-03 20:46:50 +0100
commit42c123d1d7b4b5fa1251b3ae7768912f480d36a3 (patch)
tree50d320ae44fde2d6d547cf4e74a547c7ae8c33b0 /src
parentde5ac3287002f21fb13f97ba635f6962664e3ebc (diff)
singularize srand in eina_init - only once in one place
simplify down to having a single srand() in eina_init and use urandom if it works and is there - if not, time(NULL) will do. it's the best we can...
Diffstat (limited to 'src')
-rw-r--r--src/benchmarks/eina/eina_bench_array.c4
-rw-r--r--src/benchmarks/eina/eina_bench_convert.c14
-rw-r--r--src/benchmarks/eina/eina_bench_sort.c6
-rw-r--r--src/benchmarks/eina/eina_bench_stringshare.c8
-rw-r--r--src/bin/edje/edje_multisense_convert.c1
-rw-r--r--src/bin/elementary/test_map.c2
-rw-r--r--src/examples/ecore/ecore_evas_cursor_example.c1
-rw-r--r--src/examples/eina/eina_value_02.c1
-rw-r--r--src/examples/elementary/gengrid_example.c2
-rw-r--r--src/examples/evas/evas-box.c2
-rw-r--r--src/examples/evas/evas-images2.c2
-rw-r--r--src/examples/evas/evas-smart-interface.c2
-rw-r--r--src/examples/evas/evas-smart-object.c2
-rw-r--r--src/lib/edje/edje_main.c2
-rw-r--r--src/lib/eina/eina_benchmark.h8
-rw-r--r--src/lib/eina/eina_main.c23
-rw-r--r--src/lib/elementary/elm_map.c2
-rw-r--r--src/lib/embryo/embryo_main.c2
-rw-r--r--src/tests/ecore/efl_app_test_promise.c1
-rw-r--r--src/tests/eina/eina_test_hash.c10
-rw-r--r--src/tests/eina/eina_test_stringshare.c2
21 files changed, 22 insertions, 75 deletions
diff --git a/src/benchmarks/eina/eina_bench_array.c b/src/benchmarks/eina/eina_bench_array.c
index dc04eaf0b2..28e2a37da8 100644
--- a/src/benchmarks/eina/eina_bench_array.c
+++ b/src/benchmarks/eina/eina_bench_array.c
@@ -67,8 +67,6 @@ eina_bench_array_4evas_render_inline(int request)
67 unsigned int i; 67 unsigned int i;
68 unsigned int j; 68 unsigned int j;
69 69
70 srand(time(NULL));
71
72 eina_init(); 70 eina_init();
73 71
74 array = eina_array_new(64); 72 array = eina_array_new(64);
@@ -133,8 +131,6 @@ eina_bench_array_4evas_render_iterator(int request)
133 unsigned int i; 131 unsigned int i;
134 unsigned int j; 132 unsigned int j;
135 133
136 srand(time(NULL));
137
138 eina_init(); 134 eina_init();
139 135
140 array = eina_array_new(64); 136 array = eina_array_new(64);
diff --git a/src/benchmarks/eina/eina_bench_convert.c b/src/benchmarks/eina/eina_bench_convert.c
index a34ca80f4b..820bbcc3fe 100644
--- a/src/benchmarks/eina/eina_bench_convert.c
+++ b/src/benchmarks/eina/eina_bench_convert.c
@@ -38,8 +38,6 @@ eina_bench_convert_itoa_10(int request)
38 char tmp[128]; 38 char tmp[128];
39 int i; 39 int i;
40 40
41 srand(time(NULL));
42
43 for (i = 0; i < request; ++i) 41 for (i = 0; i < request; ++i)
44 { 42 {
45 eina_convert_itoa(rand(), tmp); 43 eina_convert_itoa(rand(), tmp);
@@ -52,8 +50,6 @@ eina_bench_convert_itoa_16(int request)
52 char tmp[128]; 50 char tmp[128];
53 int i; 51 int i;
54 52
55 srand(time(NULL));
56
57 for (i = 0; i < request; ++i) 53 for (i = 0; i < request; ++i)
58 { 54 {
59 eina_convert_xtoa(rand(), tmp); 55 eina_convert_xtoa(rand(), tmp);
@@ -66,8 +62,6 @@ eina_bench_convert_snprintf_10(int request)
66 char tmp[128]; 62 char tmp[128];
67 int i; 63 int i;
68 64
69 srand(time(NULL));
70
71 for (i = 0; i < request; ++i) 65 for (i = 0; i < request; ++i)
72 { 66 {
73 snprintf(tmp, 128, "%i", rand()); 67 snprintf(tmp, 128, "%i", rand());
@@ -80,8 +74,6 @@ eina_bench_convert_snprintf_x(int request)
80 char tmp[128]; 74 char tmp[128];
81 int i; 75 int i;
82 76
83 srand(time(NULL));
84
85 for (i = 0; i < request; ++i) 77 for (i = 0; i < request; ++i)
86 { 78 {
87 snprintf(tmp, 128, "%x", rand()); 79 snprintf(tmp, 128, "%x", rand());
@@ -95,8 +87,6 @@ eina_bench_convert_snprintf_a(int request)
95 double r; 87 double r;
96 int i; 88 int i;
97 89
98 srand(time(NULL));
99
100 for (i = 0; i < request; ++i) 90 for (i = 0; i < request; ++i)
101 { 91 {
102 r = 10000 * (rand() / ((double)RAND_MAX + 1)); 92 r = 10000 * (rand() / ((double)RAND_MAX + 1));
@@ -114,8 +104,6 @@ eina_bench_convert_dtoa(int request)
114 double r; 104 double r;
115 int i; 105 int i;
116 106
117 srand(time(NULL));
118
119 for (i = 0; i < request; ++i) 107 for (i = 0; i < request; ++i)
120 { 108 {
121 r = 10000 * (rand() / ((double)RAND_MAX + 1)); 109 r = 10000 * (rand() / ((double)RAND_MAX + 1));
@@ -133,8 +121,6 @@ eina_bench_convert_gstrtod(int request)
133 double r; 121 double r;
134 int i; 122 int i;
135 123
136 srand(time(NULL));
137
138 for (i = 0; i < request; ++i) 124 for (i = 0; i < request; ++i)
139 { 125 {
140 r = 10000 * (rand() / ((double)RAND_MAX + 1)); 126 r = 10000 * (rand() / ((double)RAND_MAX + 1));
diff --git a/src/benchmarks/eina/eina_bench_sort.c b/src/benchmarks/eina/eina_bench_sort.c
index fc2b343466..9c0a1f9102 100644
--- a/src/benchmarks/eina/eina_bench_sort.c
+++ b/src/benchmarks/eina/eina_bench_sort.c
@@ -50,8 +50,6 @@ eina_bench_sort_eina(int request)
50 50
51 eina_init(); 51 eina_init();
52 52
53 srand(time(NULL));
54
55 for (i = 0; i < request; ++i) 53 for (i = 0; i < request; ++i)
56 { 54 {
57 char buffer[10]; 55 char buffer[10];
@@ -78,8 +76,6 @@ eina_bench_sort_evas(int request)
78 Evas_List *list = NULL; 76 Evas_List *list = NULL;
79 int i; 77 int i;
80 78
81 srand(time(NULL));
82
83 for (i = 0; i < request; ++i) 79 for (i = 0; i < request; ++i)
84 { 80 {
85 char buffer[10]; 81 char buffer[10];
@@ -105,8 +101,6 @@ eina_bench_sort_glist(int request)
105 GList *list = NULL; 101 GList *list = NULL;
106 int i; 102 int i;
107 103
108 srand(time(NULL));
109
110 for (i = 0; i < request; ++i) 104 for (i = 0; i < request; ++i)
111 { 105 {
112 char buffer[10]; 106 char buffer[10];
diff --git a/src/benchmarks/eina/eina_bench_stringshare.c b/src/benchmarks/eina/eina_bench_stringshare.c
index 1b19154493..d906f4d2a7 100644
--- a/src/benchmarks/eina/eina_bench_stringshare.c
+++ b/src/benchmarks/eina/eina_bench_stringshare.c
@@ -53,8 +53,6 @@ eina_bench_stringshare_job(int request)
53 tmp = eina_stringshare_add(build); 53 tmp = eina_stringshare_add(build);
54 } 54 }
55 55
56 srand(time(NULL));
57
58 for (j = 0; j < 200; ++j) 56 for (j = 0; j < 200; ++j)
59 for (i = 0; i < request; ++i) 57 for (i = 0; i < request; ++i)
60 { 58 {
@@ -87,8 +85,6 @@ eina_bench_stringchunk_job(int request)
87 g_string_chunk_insert_const(chunk, build); 85 g_string_chunk_insert_const(chunk, build);
88 } 86 }
89 87
90 srand(time(NULL));
91
92 for (j = 0; j < 200; ++j) 88 for (j = 0; j < 200; ++j)
93 for (i = 0; i < request; ++i) 89 for (i = 0; i < request; ++i)
94 { 90 {
@@ -117,8 +113,6 @@ eina_bench_evas_job(int request)
117 tmp = evas_stringshare_add(build); 113 tmp = evas_stringshare_add(build);
118 } 114 }
119 115
120 srand(time(NULL));
121
122 for (j = 0; j < 200; ++j) 116 for (j = 0; j < 200; ++j)
123 for (i = 0; i < request; ++i) 117 for (i = 0; i < request; ++i)
124 { 118 {
@@ -149,8 +143,6 @@ eina_bench_ecore_job(int request)
149 //tmp = ecore_string_instance(build); 143 //tmp = ecore_string_instance(build);
150 } 144 }
151 145
152 srand(time(NULL));
153
154 for (j = 0; j < 200; ++j) 146 for (j = 0; j < 200; ++j)
155 for (i = 0; i < request; ++i) 147 for (i = 0; i < request; ++i)
156 { 148 {
diff --git a/src/bin/edje/edje_multisense_convert.c b/src/bin/edje/edje_multisense_convert.c
index 50576efab2..3c8046037b 100644
--- a/src/bin/edje/edje_multisense_convert.c
+++ b/src/bin/edje/edje_multisense_convert.c
@@ -256,7 +256,6 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
256 vorbis_analysis_init(&vd, &vi); 256 vorbis_analysis_init(&vd, &vi);
257 vorbis_block_init(&vd, &vb); 257 vorbis_block_init(&vd, &vb);
258 258
259 srand(time(NULL));
260 ogg_stream_init(&os, rand()); 259 ogg_stream_init(&os, rand());
261 260
262 ogg_packet header; 261 ogg_packet header;
diff --git a/src/bin/elementary/test_map.c b/src/bin/elementary/test_map.c
index ecc19de172..b87f3d6521 100644
--- a/src/bin/elementary/test_map.c
+++ b/src/bin/elementary/test_map.c
@@ -1096,8 +1096,6 @@ test_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info
1096 1096
1097 evas_object_event_callback_add(map, EVAS_CALLBACK_DEL, _del_map, NULL); 1097 evas_object_event_callback_add(map, EVAS_CALLBACK_DEL, _del_map, NULL);
1098 1098
1099 srand(time(NULL));
1100
1101 tile_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_TILE); 1099 tile_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_TILE);
1102 route_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_ROUTE); 1100 route_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_ROUTE);
1103 name_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_NAME); 1101 name_srcs = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_NAME);
diff --git a/src/examples/ecore/ecore_evas_cursor_example.c b/src/examples/ecore/ecore_evas_cursor_example.c
index cbf7dfc32d..953a5cfd78 100644
--- a/src/examples/ecore/ecore_evas_cursor_example.c
+++ b/src/examples/ecore/ecore_evas_cursor_example.c
@@ -154,7 +154,6 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
154 Ecore_Timer *t; 154 Ecore_Timer *t;
155 const char *driver; 155 const char *driver;
156 156
157 srand(time(NULL));
158 if (!ecore_evas_init()) 157 if (!ecore_evas_init())
159 { 158 {
160 fprintf(stderr, "Could not init the Ecore Evas\n"); 159 fprintf(stderr, "Could not init the Ecore Evas\n");
diff --git a/src/examples/eina/eina_value_02.c b/src/examples/eina/eina_value_02.c
index a8119bdc87..cb28bf4914 100644
--- a/src/examples/eina/eina_value_02.c
+++ b/src/examples/eina/eina_value_02.c
@@ -85,7 +85,6 @@ int main(int argc, char **argv)
85 85
86 eina_init(); 86 eina_init();
87 value_init(); 87 value_init();
88 srand(time(NULL));
89 88
90 v1 = eina_value_struct_new(V1_DESC); 89 v1 = eina_value_struct_new(V1_DESC);
91 v2 = eina_value_struct_new(V2_DESC); 90 v2 = eina_value_struct_new(V2_DESC);
diff --git a/src/examples/elementary/gengrid_example.c b/src/examples/elementary/gengrid_example.c
index b342f6c60e..37f2805ee5 100644
--- a/src/examples/elementary/gengrid_example.c
+++ b/src/examples/elementary/gengrid_example.c
@@ -418,8 +418,6 @@ elm_main(int argc EINA_UNUSED,
418 Eina_Bool bounce; 418 Eina_Bool bounce;
419 double h, v; 419 double h, v;
420 420
421 srand(time(NULL));
422
423 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 421 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
424 elm_app_info_set(elm_main, "elementary", "images"); 422 elm_app_info_set(elm_main, "elementary", "images");
425 423
diff --git a/src/examples/evas/evas-box.c b/src/examples/evas/evas-box.c
index 255b11609f..d42456f984 100644
--- a/src/examples/evas/evas-box.c
+++ b/src/examples/evas/evas-box.c
@@ -317,8 +317,6 @@ main(void)
317 Evas_Object *last, *o; 317 Evas_Object *last, *o;
318 int i; 318 int i;
319 319
320 srand(time(NULL));
321
322 if (!ecore_evas_init()) 320 if (!ecore_evas_init())
323 return EXIT_FAILURE; 321 return EXIT_FAILURE;
324 322
diff --git a/src/examples/evas/evas-images2.c b/src/examples/evas/evas-images2.c
index 74ac3f0e8d..30477ba02d 100644
--- a/src/examples/evas/evas-images2.c
+++ b/src/examples/evas/evas-images2.c
@@ -226,8 +226,6 @@ main(void)
226 unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)]; 226 unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)];
227 Evas_Textblock_Style *st; 227 Evas_Textblock_Style *st;
228 228
229 srand(time(NULL));
230
231 if (!ecore_evas_init()) 229 if (!ecore_evas_init())
232 return EXIT_FAILURE; 230 return EXIT_FAILURE;
233 231
diff --git a/src/examples/evas/evas-smart-interface.c b/src/examples/evas/evas-smart-interface.c
index 2d42952598..f3019e4110 100644
--- a/src/examples/evas/evas-smart-interface.c
+++ b/src/examples/evas/evas-smart-interface.c
@@ -678,8 +678,6 @@ main(void)
678 unsigned int count; 678 unsigned int count;
679 Eina_Bool ret; 679 Eina_Bool ret;
680 680
681 srand(time(NULL));
682
683 if (!ecore_evas_init()) 681 if (!ecore_evas_init())
684 return EXIT_FAILURE; 682 return EXIT_FAILURE;
685 683
diff --git a/src/examples/evas/evas-smart-object.c b/src/examples/evas/evas-smart-object.c
index c0988e5029..7809f4f4b6 100644
--- a/src/examples/evas/evas-smart-object.c
+++ b/src/examples/evas/evas-smart-object.c
@@ -648,8 +648,6 @@ main(void)
648 unsigned int count; 648 unsigned int count;
649 Eina_Bool ret; 649 Eina_Bool ret;
650 650
651 srand(time(NULL));
652
653 if (!ecore_evas_init()) 651 if (!ecore_evas_init())
654 return EXIT_FAILURE; 652 return EXIT_FAILURE;
655 653
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index 02bab59444..f75ca688ee 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -39,8 +39,6 @@ edje_init(void)
39 if (++_edje_init_count != 1) 39 if (++_edje_init_count != 1)
40 return _edje_init_count; 40 return _edje_init_count;
41 41
42 srand(time(NULL));
43
44 EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_init(), --_edje_init_count); 42 EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_init(), --_edje_init_count);
45 43
46 _edje_default_log_dom = eina_log_domain_register 44 _edje_default_log_dom = eina_log_domain_register
diff --git a/src/lib/eina/eina_benchmark.h b/src/lib/eina/eina_benchmark.h
index 38959a1306..b772132782 100644
--- a/src/lib/eina/eina_benchmark.h
+++ b/src/lib/eina/eina_benchmark.h
@@ -170,8 +170,6 @@
170 * char tmp[128]; 170 * char tmp[128];
171 * int i; 171 * int i;
172 * 172 *
173 * srand(time(NULL));
174 *
175 * for (i = 0; i < request; ++i) 173 * for (i = 0; i < request; ++i)
176 * eina_convert_itoa(rand(), tmp); 174 * eina_convert_itoa(rand(), tmp);
177 * } 175 * }
@@ -182,8 +180,6 @@
182 * char tmp[128]; 180 * char tmp[128];
183 * int i; 181 * int i;
184 * 182 *
185 * srand(time(NULL));
186 *
187 * for (i = 0; i < request; ++i) 183 * for (i = 0; i < request; ++i)
188 * eina_convert_xtoa(rand(), tmp); 184 * eina_convert_xtoa(rand(), tmp);
189 * } 185 * }
@@ -203,8 +199,6 @@
203 * int *data; 199 * int *data;
204 * int i; 200 * int i;
205 * 201 *
206 * srand(time(NULL));
207 *
208 * array = eina_array_new(64); 202 * array = eina_array_new(64);
209 * 203 *
210 * for (i = 0; i < request; ++i) 204 * for (i = 0; i < request; ++i)
@@ -228,8 +222,6 @@
228 * int *data; 222 * int *data;
229 * int i; 223 * int i;
230 * 224 *
231 * srand(time(NULL));
232 *
233 * for (i = 0; i < request; ++i) 225 * for (i = 0; i < request; ++i)
234 * { 226 * {
235 * data = (int *)malloc(sizeof(int)); 227 * data = (int *)malloc(sizeof(int));
diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 47dd80a898..9549ab96c3 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -30,6 +30,14 @@
30# include <unistd.h> 30# include <unistd.h>
31#endif 31#endif
32 32
33#ifndef _WIN32
34# ifdef HAVE_SYS_TYPES_H
35# include <sys/types.h>
36# endif
37# include <sys/stat.h>
38# include <fcntl.h>
39#endif
40
33#ifdef HAVE_MCHECK_H 41#ifdef HAVE_MCHECK_H
34# ifdef HAVE_MTRACE 42# ifdef HAVE_MTRACE
35# define MT 1 43# define MT 1
@@ -283,7 +291,20 @@ eina_init(void)
283 if (EINA_LIKELY(_eina_main_count > 0)) 291 if (EINA_LIKELY(_eina_main_count > 0))
284 return ++_eina_main_count; 292 return ++_eina_main_count;
285 293
286 srand(time(NULL)); 294#ifdef _WIN32
295#else
296 int fd = open("/dev/urandom", O_RDONLY);
297 if (fd >= 0)
298 {
299 unsigned int val;
300
301 if (read(fd, &val, sizeof(val)) == sizeof(val)) srand(val);
302 else srand(time(NULL));
303 close(fd);
304 }
305 else
306#endif
307 srand(time(NULL));
287 while (eina_seed == 0) 308 while (eina_seed == 0)
288 eina_seed = rand(); 309 eina_seed = rand();
289 310
diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c
index 2924cb73dd..6d287fef5e 100644
--- a/src/lib/elementary/elm_map.c
+++ b/src/lib/elementary/elm_map.c
@@ -4170,8 +4170,6 @@ _elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv)
4170 // FIXME: Tile Provider is better to provide tile size! 4170 // FIXME: Tile Provider is better to provide tile size!
4171 priv->tsize = DEFAULT_TILE_SIZE; 4171 priv->tsize = DEFAULT_TILE_SIZE;
4172 4172
4173 srand(time(NULL));
4174
4175 priv->id = ((int)getpid() << 16) | id_num; 4173 priv->id = ((int)getpid() << 16) | id_num;
4176 id_num++; 4174 id_num++;
4177 _grid_all_create(priv); 4175 _grid_all_create(priv);
diff --git a/src/lib/embryo/embryo_main.c b/src/lib/embryo/embryo_main.c
index 452a272787..6bbac5891e 100644
--- a/src/lib/embryo/embryo_main.c
+++ b/src/lib/embryo/embryo_main.c
@@ -25,8 +25,6 @@ embryo_init(void)
25 if (++_embryo_init_count != 1) 25 if (++_embryo_init_count != 1)
26 return _embryo_init_count; 26 return _embryo_init_count;
27 27
28 srand(time(NULL));
29
30 if (!eina_init()) 28 if (!eina_init())
31 return --_embryo_init_count; 29 return --_embryo_init_count;
32 30
diff --git a/src/tests/ecore/efl_app_test_promise.c b/src/tests/ecore/efl_app_test_promise.c
index d1ec7b7097..2390e29e1f 100644
--- a/src/tests/ecore/efl_app_test_promise.c
+++ b/src/tests/ecore/efl_app_test_promise.c
@@ -812,7 +812,6 @@ EFL_START_TEST(efl_test_promise_future_race)
812 2.0, 1.0, 0.5, 0.1, 4.5, 2.3, 5.6, 1.0, 0.5, 0.3 812 2.0, 1.0, 0.5, 0.1, 4.5, 2.3, 5.6, 1.0, 0.5, 0.3
813 }; 813 };
814 814
815 srand(time(NULL));
816 fail_if(!ecore_init()); 815 fail_if(!ecore_init());
817 for (i = 0; i < len - 1; i++) 816 for (i = 0; i < len - 1; i++)
818 { 817 {
diff --git a/src/tests/eina/eina_test_hash.c b/src/tests/eina/eina_test_hash.c
index 87206d80ce..39d7fcc2a1 100644
--- a/src/tests/eina/eina_test_hash.c
+++ b/src/tests/eina/eina_test_hash.c
@@ -270,12 +270,8 @@ EFL_START_TEST(eina_test_hash_int32_fuzze)
270 Eina_Hash *hash; 270 Eina_Hash *hash;
271 unsigned int *r, *array; 271 unsigned int *r, *array;
272 unsigned int i; 272 unsigned int i;
273 unsigned int seed;
274 unsigned int num_loops = 10000; 273 unsigned int num_loops = 10000;
275 274
276 seed = time(NULL);
277 srand(seed);
278
279 hash = eina_hash_int32_new(NULL); 275 hash = eina_hash_int32_new(NULL);
280 276
281 array = malloc(sizeof(int) * num_loops); 277 array = malloc(sizeof(int) * num_loops);
@@ -312,8 +308,6 @@ EFL_START_TEST(eina_test_hash_int64_fuzze)
312 uint64_t i; 308 uint64_t i;
313 uint64_t num_loops = 10000; 309 uint64_t num_loops = 10000;
314 310
315 srand(time(NULL));
316
317 hash = eina_hash_int64_new(NULL); 311 hash = eina_hash_int64_new(NULL);
318 312
319 array = malloc(sizeof(int64_t) * num_loops); 313 array = malloc(sizeof(int64_t) * num_loops);
@@ -347,13 +341,9 @@ EFL_START_TEST(eina_test_hash_string_fuzze)
347{ 341{
348 Eina_Hash *hash; 342 Eina_Hash *hash;
349 unsigned int i; 343 unsigned int i;
350 unsigned int seed;
351 char *array; 344 char *array;
352 unsigned int num_loops = 100; 345 unsigned int num_loops = 100;
353 346
354 seed = time(NULL);
355 srand(seed);
356
357 hash = eina_hash_string_superfast_new(NULL); 347 hash = eina_hash_string_superfast_new(NULL);
358 348
359 array = malloc(num_loops * 10); 349 array = malloc(num_loops * 10);
diff --git a/src/tests/eina/eina_test_stringshare.c b/src/tests/eina/eina_test_stringshare.c
index 2f46ab75a4..d8ea004938 100644
--- a/src/tests/eina/eina_test_stringshare.c
+++ b/src/tests/eina/eina_test_stringshare.c
@@ -173,8 +173,6 @@ EINA_TEST_START(eina_stringshare_collision)
173 char buffer[50]; 173 char buffer[50];
174 int i; 174 int i;
175 175
176 srand(time(NULL));
177
178 ea = eina_array_new(256); 176 ea = eina_array_new(256);
179 fail_if(!ea); 177 fail_if(!ea);
180 178