gtestutils: Do not generate the random seed if provided

There's no point to generate a seed if we're going to overwrite it when
--seed is used.
This commit is contained in:
Marco Trevisan (Treviño) 2023-01-13 20:04:08 +01:00
parent 871c4b4698
commit 5d91834d9b

View File

@ -1696,13 +1696,17 @@ void
}
va_end (args);
/* setup random seed string */
g_snprintf (seedstr, sizeof (seedstr), "R02S%08x%08x%08x%08x", g_random_int(), g_random_int(), g_random_int(), g_random_int());
test_run_seedstr = seedstr;
/* parse args, sets up mode, changes seed, etc. */
parse_args (argc, argv);
if (test_run_seedstr == NULL)
{
/* setup random seed string */
g_snprintf (seedstr, sizeof (seedstr), "R02S%08x%08x%08x%08x",
g_random_int(), g_random_int(), g_random_int(), g_random_int());
test_run_seedstr = seedstr;
}
if (!g_get_prgname() && !no_g_set_prgname)
g_set_prgname ((*argv)[0]);