[json-glib] tests: Do not use deprecated API



commit 923311ee52b77f53c5c529e497ea2a24efaf23ea
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Thu Nov 12 12:01:04 2009 +0000

    tests: Do not use deprecated API
    
    Tests should not be using API marked as deprecated.

 tests/Makefile.am              |    2 +-
 tests/test-serialize-boxed.c   |    4 ++--
 tests/test-serialize-complex.c |    2 +-
 tests/test-serialize-full.c    |    2 +-
 tests/test-serialize-simple.c  |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8209aa9..e9a0467 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,7 +6,7 @@ NULL =
 noinst_PROGRAMS = $(TEST_PROGS)
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/json-glib
-AM_CPPFLAGS = $(JSON_DEBUG_CFLAGS) $(JSON_CFLAGS) $(MAINTAINER_CFLAGS)
+AM_CPPFLAGS = -DJSON_DISABLE_DEPRECATED $(JSON_DEBUG_CFLAGS) $(JSON_CFLAGS) $(MAINTAINER_CFLAGS)
 progs_ldadd = $(top_builddir)/json-glib/libjson-glib-1.0.la $(JSON_LIBS)
 
 TESTS_ENVIRONMENT = srcdir=$(srcdir)
diff --git a/tests/test-serialize-boxed.c b/tests/test-serialize-boxed.c
index d96acfd..053fc68 100644
--- a/tests/test-serialize-boxed.c
+++ b/tests/test-serialize-boxed.c
@@ -223,7 +223,7 @@ test_serialize_boxed (void)
 
   obj = g_object_new (TEST_TYPE_OBJECT, "blah", &boxed, NULL);
 
-  data = json_serialize_gobject (obj, &len);
+  data = json_gobject_to_data (obj, &len);
 
   g_assert_cmpint (len, ==, strlen (serialize_data));
   g_assert_cmpstr (data, ==, serialize_data);
@@ -241,7 +241,7 @@ test_deserialize_boxed (void)
 
   GObject *obj;
 
-  obj = json_construct_gobject (TEST_TYPE_OBJECT, serialize_data, -1, NULL);
+  obj = json_gobject_from_data (TEST_TYPE_OBJECT, serialize_data, -1, NULL);
   g_assert (TEST_IS_OBJECT (obj));
   g_assert_cmpint (TEST_OBJECT (obj)->blah.foo, ==, 42);
   g_assert (TEST_OBJECT (obj)->blah.bar);
diff --git a/tests/test-serialize-complex.c b/tests/test-serialize-complex.c
index 39b5d7d..f577761 100644
--- a/tests/test-serialize-complex.c
+++ b/tests/test-serialize-complex.c
@@ -250,7 +250,7 @@ test_serialize (void)
   gchar *data;
   gsize len;
 
-  data = json_serialize_gobject (G_OBJECT (obj), &len);
+  data = json_gobject_to_data (G_OBJECT (obj), &len);
 
   g_assert_cmpint (len, >, 0);
   if (g_test_verbose ())
diff --git a/tests/test-serialize-full.c b/tests/test-serialize-full.c
index b23a46a..2ef22d6 100644
--- a/tests/test-serialize-full.c
+++ b/tests/test-serialize-full.c
@@ -366,7 +366,7 @@ test_deserialize (void)
   gchar *str;
 
   error = NULL;
-  object = json_construct_gobject (TEST_TYPE_OBJECT, var_test, -1, &error);
+  object = json_gobject_from_data (TEST_TYPE_OBJECT, var_test, -1, &error);
   if (error)
     g_error ("*** Unable to parse buffer: %s\n", error->message);
 
diff --git a/tests/test-serialize-simple.c b/tests/test-serialize-simple.c
index fd52331..42af6fb 100644
--- a/tests/test-serialize-simple.c
+++ b/tests/test-serialize-simple.c
@@ -140,7 +140,7 @@ test_serialize (void)
   gchar *data;
   gsize len;
 
-  data = json_serialize_gobject (G_OBJECT (obj), &len);
+  data = json_gobject_to_data (G_OBJECT (obj), &len);
 
   g_assert (data != NULL);
   g_assert_cmpint (len, >, 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]