summaryrefslogtreecommitdiff
path: root/json-glib/tests
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2012-10-27 12:18:53 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-10-27 12:18:53 +0100
commit64fe683c440d7ec7140fd27f53fbaf54da37b249 (patch)
treec9217804cc10287d4de2c7601214b89b207f0678 /json-glib/tests
parentf50f32dcfdecd552ca353731faa0fde099569c28 (diff)
downloadjson-glib-64fe683c440d7ec7140fd27f53fbaf54da37b249.tar.gz
tests: Put g_type_init() under conditional compilation
Starting from GLib 2.36, g_type_init() is going to be deprecated (the type system will be initialized as soon as libgobject is paged in, using constructors). As I don't want to bump dependencies just for that, the call to g_type_init() should be placed under a compile-time version check, to keep the noise from compiler warnings down.
Diffstat (limited to 'json-glib/tests')
-rw-r--r--json-glib/tests/array.c3
-rw-r--r--json-glib/tests/boxed.c2
-rw-r--r--json-glib/tests/builder.c2
-rw-r--r--json-glib/tests/generator.c2
-rw-r--r--json-glib/tests/gvariant.c2
-rw-r--r--json-glib/tests/invalid.c2
-rw-r--r--json-glib/tests/node.c2
-rw-r--r--json-glib/tests/object.c2
-rw-r--r--json-glib/tests/parser.c2
-rw-r--r--json-glib/tests/path.c2
-rw-r--r--json-glib/tests/reader.c2
-rw-r--r--json-glib/tests/serialize-complex.c2
-rw-r--r--json-glib/tests/serialize-full.c2
-rw-r--r--json-glib/tests/serialize-simple.c2
14 files changed, 29 insertions, 0 deletions
diff --git a/json-glib/tests/array.c b/json-glib/tests/array.c
index f0aa195..115e84a 100644
--- a/json-glib/tests/array.c
+++ b/json-glib/tests/array.c
@@ -144,7 +144,10 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
+
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/array/empty-array", test_empty_array);
diff --git a/json-glib/tests/boxed.c b/json-glib/tests/boxed.c
index deeef13..5e0fb01 100644
--- a/json-glib/tests/boxed.c
+++ b/json-glib/tests/boxed.c
@@ -254,7 +254,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/boxed/serialize-property", test_serialize_boxed);
diff --git a/json-glib/tests/builder.c b/json-glib/tests/builder.c
index b93ab7f..06a4c42 100644
--- a/json-glib/tests/builder.c
+++ b/json-glib/tests/builder.c
@@ -157,7 +157,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/builder/complex", test_builder_complex);
diff --git a/json-glib/tests/generator.c b/json-glib/tests/generator.c
index eb4cb78..40ceb55 100644
--- a/json-glib/tests/generator.c
+++ b/json-glib/tests/generator.c
@@ -381,7 +381,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/generator/empty-array", test_empty_array);
diff --git a/json-glib/tests/gvariant.c b/json-glib/tests/gvariant.c
index 074dd69..c8eb143 100644
--- a/json-glib/tests/gvariant.c
+++ b/json-glib/tests/gvariant.c
@@ -204,7 +204,9 @@ main (gint argc, gchar *argv[])
TestCase test_case;
gchar *test_name;
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
/* GVariant to JSON */
diff --git a/json-glib/tests/invalid.c b/json-glib/tests/invalid.c
index 6d9a6a8..ad8e613 100644
--- a/json-glib/tests/invalid.c
+++ b/json-glib/tests/invalid.c
@@ -221,7 +221,9 @@ main (int argc,
{
int i;
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
for (i = 0; i < n_test_invalid; i++)
diff --git a/json-glib/tests/node.c b/json-glib/tests/node.c
index 51dc3ff..1782c8e 100644
--- a/json-glib/tests/node.c
+++ b/json-glib/tests/node.c
@@ -246,7 +246,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/nodes/init/int", test_init_int);
diff --git a/json-glib/tests/object.c b/json-glib/tests/object.c
index 80ed739..750ab88 100644
--- a/json-glib/tests/object.c
+++ b/json-glib/tests/object.c
@@ -166,7 +166,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/object/empty-object", test_empty_object);
diff --git a/json-glib/tests/parser.c b/json-glib/tests/parser.c
index 3b1b049..dc64f75 100644
--- a/json-glib/tests/parser.c
+++ b/json-glib/tests/parser.c
@@ -727,7 +727,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/parser/empty-string", test_empty);
diff --git a/json-glib/tests/path.c b/json-glib/tests/path.c
index 67d2a87..7b1f654 100644
--- a/json-glib/tests/path.c
+++ b/json-glib/tests/path.c
@@ -152,7 +152,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id=");
diff --git a/json-glib/tests/reader.c b/json-glib/tests/reader.c
index 48881f1..2ed90d6 100644
--- a/json-glib/tests/reader.c
+++ b/json-glib/tests/reader.c
@@ -137,7 +137,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id=");
diff --git a/json-glib/tests/serialize-complex.c b/json-glib/tests/serialize-complex.c
index 4594fdb..7b26da5 100644
--- a/json-glib/tests/serialize-complex.c
+++ b/json-glib/tests/serialize-complex.c
@@ -301,7 +301,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/serialize/gobject-boxed", test_serialize);
diff --git a/json-glib/tests/serialize-full.c b/json-glib/tests/serialize-full.c
index 14867f2..88388ef 100644
--- a/json-glib/tests/serialize-full.c
+++ b/json-glib/tests/serialize-full.c
@@ -446,7 +446,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/deserialize/json-to-gobject", test_deserialize);
diff --git a/json-glib/tests/serialize-simple.c b/json-glib/tests/serialize-simple.c
index 42af6fb..89611f7 100644
--- a/json-glib/tests/serialize-simple.c
+++ b/json-glib/tests/serialize-simple.c
@@ -157,7 +157,9 @@ int
main (int argc,
char *argv[])
{
+#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/serialize/gobject", test_serialize);