mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
Merge branch 'fix-once-memcheck-test' into 'main'
tests: Reduce number of threads in once test under valgrind See merge request GNOME/glib!2729
This commit is contained in:
commit
12ed2aa982
@ -22,8 +22,9 @@
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include "../gvalgrind.h"
|
||||
|
||||
#if GLIB_SIZEOF_VOID_P > 4
|
||||
#if GLIB_SIZEOF_VOID_P > 4 && !defined(ENABLE_VALGRIND)
|
||||
#define THREADS 1000
|
||||
#else
|
||||
#define THREADS 100
|
||||
@ -47,12 +48,12 @@ test_once_single_threaded (void)
|
||||
|
||||
g_test_summary ("Test g_once() usage from a single thread");
|
||||
|
||||
g_assert (once.status == G_ONCE_STATUS_NOTCALLED);
|
||||
g_assert_cmpint (once.status, ==, G_ONCE_STATUS_NOTCALLED);
|
||||
|
||||
res = g_once (&once, do_once, NULL);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (res), ==, 1);
|
||||
|
||||
g_assert (once.status == G_ONCE_STATUS_READY);
|
||||
g_assert_cmpint (once.status, ==, G_ONCE_STATUS_READY);
|
||||
|
||||
res = g_once (&once, do_once, NULL);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (res), ==, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user