[libgdata] picasaweb: Fix memory leaks in the picasaweb test suite
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] picasaweb: Fix memory leaks in the picasaweb test suite
- Date: Fri, 10 Dec 2010 17:53:44 +0000 (UTC)
commit ef81ce227917b36a29b57d88a66c2ed7d5adb4b2
Author: Philip Withnall <philip tecnocode co uk>
Date: Fri Dec 10 12:12:40 2010 +0000
picasaweb: Fix memory leaks in the picasaweb test suite
gdata/tests/picasaweb.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/gdata/tests/picasaweb.c b/gdata/tests/picasaweb.c
index f3f8abd..327d627 100644
--- a/gdata/tests/picasaweb.c
+++ b/gdata/tests/picasaweb.c
@@ -62,6 +62,7 @@ delete_directory (GFile *directory, GError **error)
}
g_file_enumerator_close (enumerator, NULL, error);
+ g_object_unref (enumerator);
/* Delete the directory itself */
g_file_delete (directory, NULL, error);
@@ -830,6 +831,9 @@ test_photo (gconstpointer service)
g_assert_cmpuint (gdata_media_thumbnail_get_width (thumbnail), ==, 288);
g_assert_cmpuint (gdata_media_thumbnail_get_height (thumbnail), ==, 216);
g_assert_cmpint (gdata_media_thumbnail_get_time (thumbnail), ==, -1); /* PicasaWeb doesn't set anything better */
+
+ g_object_unref (album_feed);
+ g_object_unref (photo_feed);
}
static void
@@ -842,6 +846,7 @@ test_photo_feed_entry (gconstpointer service)
GDataPicasaWebAlbum *album;
GList *albums;
GList *files;
+ gchar *xml;
GDataEntry *photo_entry;
album_feed = gdata_picasaweb_service_query_all_albums (GDATA_PICASAWEB_SERVICE (service), NULL, NULL, NULL, NULL, NULL, &error);
@@ -875,8 +880,14 @@ test_photo_feed_entry (gconstpointer service)
g_assert (gdata_entry_get_content (photo_entry) == NULL);
g_assert_cmpstr (gdata_entry_get_content_uri (photo_entry), ==,
"http://lh3.ggpht.com/_1kdcGyvOb8c/SfQFWPnuovI/AAAAAAAAAB0/MI0L4Sd11Eg/100_0269.jpg");
- g_assert_cmpstr (gdata_parsable_get_xml (GDATA_PARSABLE (photo_entry)), !=, NULL);
- g_assert_cmpuint (strlen (gdata_parsable_get_xml (GDATA_PARSABLE (photo_entry))), >, 0);
+
+ xml = gdata_parsable_get_xml (GDATA_PARSABLE (photo_entry));
+ g_assert_cmpstr (xml, !=, NULL);
+ g_assert_cmpuint (strlen (xml), >, 0);
+ g_free (xml);
+
+ g_object_unref (album_feed);
+ g_object_unref (photo_feed);
}
static void
@@ -913,6 +924,9 @@ test_photo_feed (gconstpointer service)
g_assert_cmpuint (gdata_feed_get_items_per_page (photo_feed), ==, 1000);
g_assert_cmpuint (gdata_feed_get_start_index (photo_feed), ==, 1);
g_assert_cmpuint (gdata_feed_get_total_results (photo_feed), ==, 1);
+
+ g_object_unref (album_feed);
+ g_object_unref (photo_feed);
}
static void
@@ -1164,6 +1178,8 @@ test_album_feed (gconstpointer service)
g_assert_cmpuint (gdata_feed_get_items_per_page (album_feed), ==, 1000);
g_assert_cmpuint (gdata_feed_get_start_index (album_feed), ==, 1);
g_assert_cmpuint (gdata_feed_get_total_results (album_feed), ==, NUM_ALBUMS);
+
+ g_object_unref (album_feed);
}
static void
@@ -1284,6 +1300,7 @@ test_query_all_albums (gconstpointer service)
g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER);
g_assert (album_feed == NULL);
g_clear_error (&error);
+ g_object_unref (query);
/* Now try a proper query */
album_feed = gdata_picasaweb_service_query_all_albums (GDATA_PICASAWEB_SERVICE (service), NULL, NULL, NULL, NULL, NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]