diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-15 13:31:16 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-15 14:02:48 +0300 |
commit | a6a67a71a26d6906c1c1fd12ea7eef9a9c9b4e2d (patch) | |
tree | 0eed37e117b882e587b32867f86bc352e4f71e22 /tests | |
parent | e3d3aa2593b32b11d967c3219c2b4881d881557e (diff) |
ubi-tests: use rand instead of random in io_paral
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ubi-tests/io_paral.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/ubi-tests/io_paral.c b/tests/ubi-tests/io_paral.c index 55fd0bf..3ceda95 100644 --- a/tests/ubi-tests/io_paral.c +++ b/tests/ubi-tests/io_paral.c @@ -64,7 +64,7 @@ static int update_volume(int vol_id, int bytes) } for (i = 0; i < bytes; i++) - wbuf[i] = random() % 255; + wbuf[i] = rand() % 255; memset(rbuf, '\0', bytes); ret = ubi_update_start(libubi, fd, bytes); @@ -75,7 +75,7 @@ static int update_volume(int vol_id, int bytes) } while (written < bytes) { - int to_write = random() % (bytes - written); + int to_write = rand() % (bytes - written); if (to_write == 0) to_write = 1; @@ -104,7 +104,7 @@ static int update_volume(int vol_id, int bytes) /* read data back and check */ while (rd < bytes) { - int to_read = random() % (bytes - rd); + int to_read = rand() % (bytes - rd); if (to_read == 0) to_read = 1; @@ -138,8 +138,8 @@ static void *update_thread(void *ptr) int vol_id = (long)ptr, i; for (i = 0; i < ITERATIONS; i++) { - int ret, bytes = (random() % (vol_size - 1)) + 1; - int remove = !(random() % 16); + int ret, bytes = (rand() % (vol_size - 1)) + 1; + int remove = !(rand() % 16); /* From time to time remove the volume */ if (remove) { @@ -186,7 +186,7 @@ static void *write_thread(void *ptr) } for (i = 0; i < ITERATIONS * VOL_LEBS; i++) { - int j, leb = random() % VOL_LEBS; + int j, leb = rand() % VOL_LEBS; off_t offs = dev_info.leb_size * leb; ret = ubi_leb_unmap(fd, leb); @@ -197,7 +197,7 @@ static void *write_thread(void *ptr) } for (j = 0; j < dev_info.leb_size; j++) - wbuf[j] = random() % 255; + wbuf[j] = rand() % 255; memset(rbuf, '\0', dev_info.leb_size); ret = pwrite(fd, wbuf, dev_info.leb_size, offs); |