mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 04:02:09 +01:00
tests: Remove unnecessary static attributes from variables
These functions are not run more than once, so the variables don’t need to be static to save state between runs. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
3aec6a3976
commit
31664e62f9
@ -176,11 +176,12 @@ static gpointer
|
||||
thread1_main (gpointer data)
|
||||
{
|
||||
GClosure *closure = data;
|
||||
while (!stopping)
|
||||
guint i = 0;
|
||||
|
||||
for (i = 0; !stopping; i++)
|
||||
{
|
||||
static guint count = 0;
|
||||
test_closure (closure);
|
||||
if (++count % 10000 == 0)
|
||||
if (i % 10000 == 0)
|
||||
{
|
||||
g_test_message ("Yielding from thread1");
|
||||
g_thread_yield(); /* force context switch */
|
||||
@ -194,11 +195,12 @@ static gpointer
|
||||
thread2_main (gpointer data)
|
||||
{
|
||||
GClosure *closure = data;
|
||||
while (!stopping)
|
||||
guint i = 0;
|
||||
|
||||
for (i = 0; !stopping; i++)
|
||||
{
|
||||
static guint count = 0;
|
||||
test_closure (closure);
|
||||
if (++count % 10000 == 0)
|
||||
if (i % 10000 == 0)
|
||||
{
|
||||
g_test_message ("Yielding from thread2");
|
||||
g_thread_yield(); /* force context switch */
|
||||
@ -272,9 +274,8 @@ test_closure_refcount (void)
|
||||
for (i = 0; i < 1000000; i++)
|
||||
#endif
|
||||
{
|
||||
static guint count = 0;
|
||||
test_emissions (object);
|
||||
if (++count % 10000 == 0)
|
||||
if (i % 10000 == 0)
|
||||
{
|
||||
g_test_message ("Yielding from main thread");
|
||||
g_thread_yield(); /* force context switch */
|
||||
|
Loading…
x
Reference in New Issue
Block a user