mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
Disable deprecations where appropriate in tests
This commit is contained in:
@@ -147,10 +147,6 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
#ifdef TEST_THREADED
|
|
||||||
g_thread_init (NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_test_add_func ("/glib-unix/pipe", test_pipe);
|
g_test_add_func ("/glib-unix/pipe", test_pipe);
|
||||||
g_test_add_func ("/glib-unix/error", test_error);
|
g_test_add_func ("/glib-unix/error", test_error);
|
||||||
g_test_add_func ("/glib-unix/sighup", test_sighup);
|
g_test_add_func ("/glib-unix/sighup", test_sighup);
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
typedef struct _MyBoxed MyBoxed;
|
typedef struct _MyBoxed MyBoxed;
|
||||||
|
@@ -210,7 +210,7 @@ test_multithreaded_dynamic_type_init (void)
|
|||||||
|
|
||||||
/* create threads */
|
/* create threads */
|
||||||
for (i = 0; i < N_THREADS; i++) {
|
for (i = 0; i < N_THREADS; i++) {
|
||||||
threads[i] = g_thread_create (ref_unref_thread, (gpointer) DYNAMIC_OBJECT_TYPE, TRUE, NULL);
|
threads[i] = g_thread_new ("test", ref_unref_thread, (gpointer) DYNAMIC_OBJECT_TYPE, TRUE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* execute threads */
|
/* execute threads */
|
||||||
@@ -352,7 +352,6 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_thread_init (NULL);
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
g_type_init ();
|
g_type_init ();
|
||||||
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* otherwise) arising in any way out of the use of this software, even
|
* otherwise) arising in any way out of the use of this software, even
|
||||||
* if advised of the possibility of such damage.
|
* if advised of the possibility of such damage.
|
||||||
*/
|
*/
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
@@ -200,7 +201,6 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_thread_init (NULL);
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
g_type_init ();
|
g_type_init ();
|
||||||
|
|
||||||
|
@@ -117,8 +117,6 @@ testcase (gconstpointer data)
|
|||||||
GThread *threads[THREADS];
|
GThread *threads[THREADS];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
#ifdef TEST_EMULATED_FUTEX
|
#ifdef TEST_EMULATED_FUTEX
|
||||||
#define SUFFIX "-emufutex"
|
#define SUFFIX "-emufutex"
|
||||||
|
|
||||||
@@ -134,7 +132,7 @@ testcase (gconstpointer data)
|
|||||||
bits[i] = g_random_int () % 32;
|
bits[i] = g_random_int () % 32;
|
||||||
|
|
||||||
for (i = 0; i < THREADS; i++)
|
for (i = 0; i < THREADS; i++)
|
||||||
threads[i] = g_thread_create (thread_func,
|
threads[i] = g_thread_new ("foo", thread_func,
|
||||||
GINT_TO_POINTER (use_pointers),
|
GINT_TO_POINTER (use_pointers),
|
||||||
TRUE, NULL);
|
TRUE, NULL);
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
* See the included COPYING file for more information.
|
* See the included COPYING file for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
/* On smcv's laptop, 1e4 iterations didn't always exhibit the bug, but 1e5
|
/* On smcv's laptop, 1e4 iterations didn't always exhibit the bug, but 1e5
|
||||||
@@ -49,8 +51,6 @@ testcase (void)
|
|||||||
{
|
{
|
||||||
g_test_bug ("642026");
|
g_test_bug ("642026");
|
||||||
|
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
mutex = g_mutex_new ();
|
mutex = g_mutex_new ();
|
||||||
cond = g_cond_new ();
|
cond = g_cond_new ();
|
||||||
|
|
||||||
@@ -85,11 +85,7 @@ main (int argc,
|
|||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=");
|
g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=");
|
||||||
|
|
||||||
#ifdef G_ERRORCHECK_MUTEXES
|
|
||||||
g_test_add_func ("/glib/642026-ec", testcase);
|
|
||||||
#else
|
|
||||||
g_test_add_func ("/glib/642026", testcase);
|
g_test_add_func ("/glib/642026", testcase);
|
||||||
#endif
|
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ test_atomic (void)
|
|||||||
bucket[i] = 0;
|
bucket[i] = 0;
|
||||||
|
|
||||||
for (i = 0; i < THREADS; i++)
|
for (i = 0; i < THREADS; i++)
|
||||||
threads[i] = g_thread_create (thread_func, GINT_TO_POINTER (i), TRUE, NULL);
|
threads[i] = g_thread_new ("atomic", thread_func, GINT_TO_POINTER (i), TRUE, NULL);
|
||||||
|
|
||||||
for (i = 0; i < THREADS; i++)
|
for (i = 0; i < THREADS; i++)
|
||||||
g_thread_join (threads[i]);
|
g_thread_join (threads[i]);
|
||||||
@@ -62,8 +62,6 @@ test_atomic (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/glib/atomic/add", test_atomic);
|
g_test_add_func ("/glib/atomic/add", test_atomic);
|
||||||
|
@@ -229,7 +229,7 @@ test_threaded (void)
|
|||||||
for (i = 0; i < NUM_THREADS; i++)
|
for (i = 0; i < NUM_THREADS; i++)
|
||||||
{
|
{
|
||||||
context_init (&contexts[i]);
|
context_init (&contexts[i]);
|
||||||
threads[i] = g_thread_create (thread_func, &contexts[i], TRUE, NULL);
|
threads[i] = g_thread_new ("test", thread_func, &contexts[i], TRUE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dispatch tokens */
|
/* dispatch tokens */
|
||||||
@@ -256,8 +256,6 @@ test_threaded (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
#ifdef TEST_EVENTFD_FALLBACK
|
#ifdef TEST_EVENTFD_FALLBACK
|
||||||
|
@@ -41,7 +41,7 @@ multithreaded_test_run (GThreadFunc function)
|
|||||||
{
|
{
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
thread = g_thread_create (function,
|
thread = g_thread_new ("test", function,
|
||||||
GINT_TO_POINTER (i), TRUE, &error);
|
GINT_TO_POINTER (i), TRUE, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_ptr_array_add (threads, thread);
|
g_ptr_array_add (threads, thread);
|
||||||
@@ -221,8 +221,6 @@ main (int argc,
|
|||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
dirname = g_path_get_dirname (argv[0]);
|
dirname = g_path_get_dirname (argv[0]);
|
||||||
echo_prog_path = g_build_filename (dirname, "test-spawn-echo", NULL);
|
echo_prog_path = g_build_filename (dirname, "test-spawn-echo", NULL);
|
||||||
if (!g_file_test (echo_prog_path, G_FILE_TEST_EXISTS))
|
if (!g_file_test (echo_prog_path, G_FILE_TEST_EXISTS))
|
||||||
|
@@ -172,8 +172,6 @@ main (int argc,
|
|||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
||||||
dirname = g_path_get_dirname (argv[0]);
|
dirname = g_path_get_dirname (argv[0]);
|
||||||
echo_prog_path = g_build_filename (dirname, "test-spawn-echo", NULL);
|
echo_prog_path = g_build_filename (dirname, "test-spawn-echo", NULL);
|
||||||
if (!g_file_test (echo_prog_path, G_FILE_TEST_EXISTS))
|
if (!g_file_test (echo_prog_path, G_FILE_TEST_EXISTS))
|
||||||
|
Reference in New Issue
Block a user