Commit bcdb865c authored by Matthias Clasen's avatar Matthias Clasen

Disable deprecations where appropriate in tests

parent 7455dd37
......@@ -16,6 +16,9 @@
* Boston, MA 02111-1307, USA.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
static gint value_create_count = 0;
......
......@@ -20,6 +20,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
static GCond cond;
......
#undef G_DISABLE_ASSERT
#undef G_LOG_DOMAIN
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include "glib.h"
#include <stdio.h>
......
......@@ -21,6 +21,10 @@
#include <string.h>
#include <errno.h>
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
#include <glib/gstdio.h>
......
/* Unit tests for GMainLoop
* Copyright (C) 2011 Red Hat, Inc
* Author: Matthias Clasen
*
* This work is provided "as is"; redistribution and modification
* in whole or in part, in any medium, physical or electronic is
* permitted without restriction.
*
* This work is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* In no event shall the authors or contributors be liable for any
* direct, indirect, incidental, special, exemplary, or consequential
* damages (including, but not limited to, procurement of substitute
* goods or services; loss of use, data, or profits; or business
* interruption) however caused and on any theory of liability, whether
* in contract, strict liability, or tort (including negligence or
* otherwise) arising in any way out of the use of this software, even
* if advised of the possibility of such damage.
*/
#include <glib.h>
static void
test_unref (void)
{
}
int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/mainloop/unref", test_unref);
return g_test_run ();
}
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <config.h>
#include <glib.h>
#include <string.h>
......
......@@ -20,6 +20,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
#include <stdio.h>
......
......@@ -104,7 +104,7 @@ test_once3 (void)
shared = 0;
for (i = 0; i < THREADS; i++)
threads[i] = g_thread_create (thread_func, NULL, TRUE, NULL);
threads[i] = g_thread_new ("once3", thread_func, NULL, TRUE, NULL);
for (i = 0; i < THREADS; i++)
g_thread_join (threads[i]);
......
......@@ -20,6 +20,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
/* test basics:
......@@ -374,8 +377,6 @@ main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_assert (g_thread_get_initialized ());
g_test_add_func ("/thread/private1", test_private1);
g_test_add_func ("/thread/private2", test_private2);
g_test_add_func ("/thread/private3", test_private3);
......
......@@ -20,6 +20,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
#include <stdio.h>
......
......@@ -20,6 +20,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
static void
......
......@@ -1077,8 +1077,8 @@ test_bounds (void)
file = g_mapped_file_new ("4096-random-bytes", TRUE, NULL);
after = g_mapped_file_new ("4096-random-bytes", TRUE, NULL);
g_mapped_file_free (before);
g_mapped_file_free (after);
g_mapped_file_unref (before);
g_mapped_file_unref (after);
g_assert (file != NULL);
g_assert_cmpint (g_mapped_file_get_length (file), ==, 4096);
......@@ -1212,7 +1212,7 @@ test_bounds (void)
g_free (tmp2);
g_free (tmp);
g_mapped_file_free (file);
g_mapped_file_unref (file);
}
static void
......
......@@ -19,6 +19,9 @@
* if advised of the possibility of such damage.
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <stdio.h>
#include <string.h>
#include "glib.h"
......
......@@ -146,8 +146,6 @@ main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_assert (g_thread_get_initialized ());
g_test_add_func ("/thread/thread1", test_thread1);
g_test_add_func ("/thread/thread2", test_thread2);
g_test_add_func ("/thread/thread3", test_thread3);
......
......@@ -27,6 +27,9 @@
#undef G_DISABLE_ASSERT
#undef G_LOG_DOMAIN
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <stdio.h>
#include <string.h>
#include "glib.h"
......
......@@ -22,6 +22,9 @@
* Author: Matthias Clasen, Behdad Esfahbod
*/
/* We are testing some deprecated APIs here */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include "glib.h"
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment