Add info to documentation about random numbers, initialize srand (#2056)

Issue #2053 has highlighted the fact that random numbers are always generated with the same seed.
An example of generating different random numbers, other than the original seed, has been added to the documentation.
Furthermore srand initialization has been added to jerry-main, and targets.
Update test-common.h with srand call.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2017-11-03 15:31:57 +01:00
committed by László Langó
parent 678fcb20ed
commit 4690d128b3
9 changed files with 52 additions and 19 deletions
+1
View File
@@ -71,6 +71,7 @@ int
main (int argc,
char **argv)
{
srand ((unsigned) jerry_port_get_current_time ());
if (argc <= 1 || (argc == 2 && (!strcmp ("-h", argv[1]) || !strcmp ("--help", argv[1]))))
{
print_help (argv[0]);
+1
View File
@@ -424,6 +424,7 @@ int
main (int argc,
char **argv)
{
srand ((unsigned) jerry_port_get_current_time ());
const char *file_names[argc];
int files_counter = 0;