mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	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:
		@@ -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]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user