[libgdata] [calendar] Added GDataCalendarFeed to parse Calendar-specific feed properties



commit 36472b67980073b816a9e3717ccde57b76a43e23
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun May 17 18:53:53 2009 +0100

    [calendar] Added GDataCalendarFeed to parse Calendar-specific feed properties
    
    GDataCalendarFeed is a subclass of GDataFeed, and implements parsing of two
    Calendar-specific feed properties. Documentation is included, but there are
    no test cases.
---
 docs/reference/gdata-docs.xml                    |    1 +
 docs/reference/gdata-sections.txt                |   19 +++
 gdata/gdata-access-handler.c                     |    2 +-
 gdata/gdata-feed.c                               |    5 +-
 gdata/gdata-private.h                            |    2 +-
 gdata/gdata-service.c                            |    3 +-
 gdata/gdata-service.h                            |    2 +
 gdata/gdata.h                                    |    1 +
 gdata/gdata.symbols                              |    3 +
 gdata/services/calendar/Makefile.am              |    7 +-
 gdata/services/calendar/gdata-calendar-feed.c    |  189 ++++++++++++++++++++++
 gdata/services/calendar/gdata-calendar-feed.h    |   71 ++++++++
 gdata/services/calendar/gdata-calendar-service.c |    2 +
 gdata/tests/calendar.c                           |   12 +-
 14 files changed, 306 insertions(+), 13 deletions(-)

diff --git a/docs/reference/gdata-docs.xml b/docs/reference/gdata-docs.xml
index 9959050..41368e4 100644
--- a/docs/reference/gdata-docs.xml
+++ b/docs/reference/gdata-docs.xml
@@ -50,6 +50,7 @@
 	<chapter>
 		<title>Google Calendar API</title>
 		<xi:include href="xml/gdata-calendar-service.xml"/>
+		<xi:include href="xml/gdata-calendar-feed.xml"/>
 		<xi:include href="xml/gdata-calendar-query.xml"/>
 		<xi:include href="xml/gdata-calendar-calendar.xml"/>
 		<xi:include href="xml/gdata-calendar-event.xml"/>
diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt
index 6e9df3c..e29460b 100644
--- a/docs/reference/gdata-sections.txt
+++ b/docs/reference/gdata-sections.txt
@@ -686,3 +686,22 @@ GDATA_TYPE_PARSABLE
 <SUBSECTION Private>
 GDataParsablePrivate
 </SECTION>
+
+<SECTION>
+<FILE>gdata-calendar-feed</FILE>
+<TITLE>GDataCalendarFeed</TITLE>
+GDataCalendarFeed
+GDataCalendarFeedClass
+gdata_calendar_feed_get_timezone
+gdata_calendar_feed_get_times_cleaned
+<SUBSECTION Standard>
+gdata_calendar_feed_get_type
+GDATA_CALENDAR_FEED
+GDATA_CALENDAR_FEED_CLASS
+GDATA_CALENDAR_FEED_GET_CLASS
+GDATA_IS_CALENDAR_FEED
+GDATA_IS_CALENDAR_FEED_CLASS
+GDATA_TYPE_CALENDAR_FEED
+<SUBSECTION Private>
+GDataCalendarFeedPrivate
+</SECTION>
diff --git a/gdata/gdata-access-handler.c b/gdata/gdata-access-handler.c
index 6587220..f8f910d 100644
--- a/gdata/gdata-access-handler.c
+++ b/gdata/gdata-access-handler.c
@@ -125,7 +125,7 @@ gdata_access_handler_get_rules (GDataAccessHandler *self, GDataService *service,
 
 	g_assert (message->response_body->data != NULL);
 
-	feed = _gdata_feed_new_from_xml (message->response_body->data, message->response_body->length, GDATA_TYPE_ACCESS_RULE,
+	feed = _gdata_feed_new_from_xml (GDATA_TYPE_FEED, message->response_body->data, message->response_body->length, GDATA_TYPE_ACCESS_RULE,
 					 progress_callback, progress_user_data, error);
 	g_object_unref (message);
 
diff --git a/gdata/gdata-feed.c b/gdata/gdata-feed.c
index 0745cba..214aa13 100644
--- a/gdata/gdata-feed.c
+++ b/gdata/gdata-feed.c
@@ -612,12 +612,13 @@ post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error)
 }
 
 GDataFeed *
-_gdata_feed_new_from_xml (const gchar *xml, gint length, GType entry_type,
+_gdata_feed_new_from_xml (GType feed_type, const gchar *xml, gint length, GType entry_type,
 			  GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error)
 {
 	ParseData *data;
 	GDataFeed *feed;
 
+	g_return_val_if_fail (g_type_is_a (feed_type, GDATA_TYPE_FEED) == TRUE, FALSE);
 	g_return_val_if_fail (xml != NULL, NULL);
 	g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY) == TRUE, FALSE);
 
@@ -627,7 +628,7 @@ _gdata_feed_new_from_xml (const gchar *xml, gint length, GType entry_type,
 	data->progress_user_data = progress_user_data;
 	data->entry_i = 0;
 
-	feed = GDATA_FEED (_gdata_parsable_new_from_xml (GDATA_TYPE_FEED, "feed", xml, length, data, error));
+	feed = GDATA_FEED (_gdata_parsable_new_from_xml (feed_type, "feed", xml, length, data, error));
 
 	g_slice_free (ParseData, data);
 
diff --git a/gdata/gdata-private.h b/gdata/gdata-private.h
index cc2b78a..edc9c84 100644
--- a/gdata/gdata-private.h
+++ b/gdata/gdata-private.h
@@ -45,7 +45,7 @@ const gchar *_gdata_parsable_get_extra_xml (GDataParsable *self);
 GHashTable *_gdata_parsable_get_extra_namespaces (GDataParsable *self);
 
 #include "gdata-feed.h"
-GDataFeed *_gdata_feed_new_from_xml (const gchar *xml, gint length, GType entry_type,
+GDataFeed *_gdata_feed_new_from_xml (GType feed_type, const gchar *xml, gint length, GType entry_type,
 				     GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 #include "gdata-entry.h"
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index e31c4f2..64bb5c0 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -110,6 +110,7 @@ gdata_service_class_init (GDataServiceClass *klass)
 
 	klass->service_name = "xapi";
 	klass->authentication_uri = "https://www.google.com/accounts/ClientLogin";;
+	klass->feed_type = GDATA_TYPE_FEED;
 	klass->parse_authentication_response = real_parse_authentication_response;
 	klass->append_query_headers = real_append_query_headers;
 	klass->parse_error_response = real_parse_error_response;
@@ -1011,7 +1012,7 @@ gdata_service_query (GDataService *self, const gchar *feed_uri, GDataQuery *quer
 
 	g_assert (message->response_body->data != NULL);
 
-	feed = _gdata_feed_new_from_xml (message->response_body->data, message->response_body->length, entry_type,
+	feed = _gdata_feed_new_from_xml (klass->feed_type, message->response_body->data, message->response_body->length, entry_type,
 					 progress_callback, progress_user_data, error);
 	g_object_unref (message);
 
diff --git a/gdata/gdata-service.h b/gdata/gdata-service.h
index 7f75df5..c61f88b 100644
--- a/gdata/gdata-service.h
+++ b/gdata/gdata-service.h
@@ -128,6 +128,7 @@ typedef struct {
  * @parent: the parent class
  * @service_name: the name of the service (for subclasses) as given in the service's GData API documentation
  * @authentication_uri: the authentication URI (for subclasses) if different from the Google ClientLogin default
+ * @feed_type: the #GType of the feed class (subclass of #GDataFeed) to use for query results from this service
  * @parse_authentication_response: a function to parse the response from the online service to an authentication request as
  * issued by gdata_service_authenticate(). It should return %TRUE if authentication was successful, and %FALSE if there was
  * an error.
@@ -143,6 +144,7 @@ typedef struct {
 
 	const gchar *service_name;
 	const gchar *authentication_uri;
+	GType feed_type;
 
 	gboolean (*parse_authentication_response) (GDataService *self, guint status, const gchar *response_body, gint length, GError **error);
 	void (*append_query_headers) (GDataService *self, SoupMessage *message);
diff --git a/gdata/gdata.h b/gdata/gdata.h
index a0054a4..05e9f9d 100644
--- a/gdata/gdata.h
+++ b/gdata/gdata.h
@@ -48,6 +48,7 @@
 
 /* Google Calendar */
 #include <gdata/services/calendar/gdata-calendar-service.h>
+#include <gdata/services/calendar/gdata-calendar-feed.h>
 #include <gdata/services/calendar/gdata-calendar-calendar.h>
 #include <gdata/services/calendar/gdata-calendar-event.h>
 #include <gdata/services/calendar/gdata-calendar-query.h>
diff --git a/gdata/gdata.symbols b/gdata/gdata.symbols
index 6d2a9a5..ab150f9 100644
--- a/gdata/gdata.symbols
+++ b/gdata/gdata.symbols
@@ -348,3 +348,6 @@ gdata_access_rule_set_role
 gdata_access_rule_get_scope
 gdata_access_rule_set_scope
 gdata_parsable_get_type
+gdata_calendar_feed_get_type
+gdata_calendar_feed_get_timezone
+gdata_calendar_feed_get_times_cleaned
diff --git a/gdata/services/calendar/Makefile.am b/gdata/services/calendar/Makefile.am
index 9b1466d..09c8df1 100644
--- a/gdata/services/calendar/Makefile.am
+++ b/gdata/services/calendar/Makefile.am
@@ -3,7 +3,8 @@ gdatacalendarinclude_HEADERS = \
 	gdata-calendar-service.h	\
 	gdata-calendar-calendar.h	\
 	gdata-calendar-event.h		\
-	gdata-calendar-query.h
+	gdata-calendar-query.h		\
+	gdata-calendar-feed.h
 
 noinst_LTLIBRARIES = libgdatacalendar.la
 
@@ -17,7 +18,9 @@ libgdatacalendar_la_SOURCES = \
 	gdata-calendar-event.c		\
 	gdata-calendar-event.h		\
 	gdata-calendar-query.c		\
-	gdata-calendar-query.h
+	gdata-calendar-query.h		\
+	gdata-calendar-feed.c		\
+	gdata-calendar-feed.h
 
 libgdatacalendar_la_CPPFLAGS = \
 	-I$(top_srcdir)				\
diff --git a/gdata/services/calendar/gdata-calendar-feed.c b/gdata/services/calendar/gdata-calendar-feed.c
new file mode 100644
index 0000000..a11a122
--- /dev/null
+++ b/gdata/services/calendar/gdata-calendar-feed.c
@@ -0,0 +1,189 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * GData Client
+ * Copyright (C) Philip Withnall 2009 <philip tecnocode co uk>
+ * 
+ * GData Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GData Client 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.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GData Client.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION:gdata-calendar-feed
+ * @short_description: GData Calendar feed object
+ * @stability: Unstable
+ * @include: gdata/services/calendar/gdata-calendar-feed.h
+ *
+ * #GDataCalendarFeed is a subclass of #GDataFeed to represent a results feed from Google Calendar. It adds a couple of
+ * properties which are specific to the Google Calendar API.
+ **/
+
+#include <glib.h>
+#include <libxml/parser.h>
+
+#include "gdata-calendar-feed.h"
+#include "gdata-feed.h"
+#include "gdata-private.h"
+
+static void gdata_calendar_feed_finalize (GObject *object);
+static void gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error);
+
+struct _GDataCalendarFeedPrivate {
+	gchar *timezone;
+	guint times_cleaned;
+};
+
+enum {
+	PROP_TIMEZONE = 1,
+	PROP_TIMES_CLEANED
+};
+
+G_DEFINE_TYPE (GDataCalendarFeed, gdata_calendar_feed, GDATA_TYPE_FEED)
+#define GDATA_CALENDAR_FEED_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedPrivate))
+
+static void
+gdata_calendar_feed_class_init (GDataCalendarFeedClass *klass)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+	GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass);
+
+	g_type_class_add_private (klass, sizeof (GDataCalendarFeedPrivate));
+
+	gobject_class->get_property = gdata_calendar_feed_get_property;
+	gobject_class->finalize = gdata_calendar_feed_finalize;
+
+	parsable_class->parse_xml = parse_xml;
+
+	/**
+	 * GDataCalendarFeed:timezone:
+	 *
+	 * The timezone in which the feed's times are given.
+	 *
+	 * Since: 0.3.0
+	 **/
+	g_object_class_install_property (gobject_class, PROP_TIMEZONE,
+				g_param_spec_string ("timezone",
+					"Timezone", "The timezone in which the feed's times are given.",
+					NULL,
+					G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+	/**
+	 * GDataCalendarFeed:times-cleaned:
+	 *
+	 * The number of times the feed has been completely cleared of entries.
+	 *
+	 * Since: 0.3.0
+	 **/
+	g_object_class_install_property (gobject_class, PROP_TIMES_CLEANED,
+				g_param_spec_uint ("times-cleaned",
+					"Times cleaned", "The number of times the feed has been completely cleared of entries.",
+					0, G_MAXUINT, 0,
+					G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+}
+
+static void
+gdata_calendar_feed_init (GDataCalendarFeed *self)
+{
+	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedPrivate);
+}
+
+static void
+gdata_calendar_feed_finalize (GObject *object)
+{
+	GDataCalendarFeedPrivate *priv = GDATA_CALENDAR_FEED_GET_PRIVATE (object);
+
+	xmlFree (priv->timezone);
+
+	/* Chain up to the parent class */
+	G_OBJECT_CLASS (gdata_calendar_feed_parent_class)->finalize (object);
+}
+
+static void
+gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+{
+	GDataCalendarFeedPrivate *priv = GDATA_CALENDAR_FEED_GET_PRIVATE (object);
+
+	switch (property_id) {
+		case PROP_TIMEZONE:
+			g_value_set_string (value, priv->timezone);
+			break;
+		case PROP_TIMES_CLEANED:
+			g_value_set_uint (value, priv->times_cleaned);
+			break;
+		default:
+			/* We don't have any other property... */
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+			break;
+	}
+}
+
+static gboolean
+parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error)
+{
+	GDataCalendarFeed *self = GDATA_CALENDAR_FEED (parsable);
+
+	if (xmlStrcmp (node->name, (xmlChar*) "timezone") == 0) {
+		/* gCal:timezone */
+		xmlChar *_timezone = xmlGetProp (node, (xmlChar*) "value");
+		if (_timezone == NULL)
+			return gdata_parser_error_required_property_missing ("gCal:timezone", "value", error);
+		xmlFree (self->priv->timezone);
+		self->priv->timezone = (gchar*) _timezone;
+	} else if (xmlStrcmp (node->name, (xmlChar*) "timesCleaned") == 0) {
+		/* gCal:timesCleaned */
+		xmlChar *times_cleaned = xmlGetProp (node, (xmlChar*) "value");
+		if (times_cleaned == NULL)
+			return gdata_parser_error_required_property_missing ("gCal:timesCleaned", "value", error);
+		self->priv->times_cleaned = strtoul ((gchar*) times_cleaned, NULL, 10);
+		xmlFree (times_cleaned);
+	} else if (GDATA_PARSABLE_CLASS (gdata_calendar_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error) == FALSE) {
+		/* Error! */
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+/**
+ * gdata_calendar_feed_get_timezone:
+ * @self: a #GDataCalendarFeed
+ *
+ * Gets the #GDataCalendarFeed:timezone property.
+ *
+ * Return value: the feed's timezone, or %NULL
+ *
+ * Since: 0.3.0
+ **/
+const gchar *
+gdata_calendar_feed_get_timezone (GDataCalendarFeed *self)
+{
+	g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), NULL);
+	return self->priv->timezone;
+}
+
+/**
+ * gdata_calendar_feed_get_times_cleaned:
+ * @self: a #GDataCalendarFeed
+ *
+ * Gets the #GDataCalendarFeed:times-cleaned property.
+ *
+ * Return value: the number of times the feed has been totally emptied
+ *
+ * Since: 0.3.0
+ **/
+guint
+gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self)
+{
+	g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), 0);
+	return self->priv->times_cleaned;
+}
diff --git a/gdata/services/calendar/gdata-calendar-feed.h b/gdata/services/calendar/gdata-calendar-feed.h
new file mode 100644
index 0000000..6feb0d8
--- /dev/null
+++ b/gdata/services/calendar/gdata-calendar-feed.h
@@ -0,0 +1,71 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * GData Client
+ * Copyright (C) Philip Withnall 2009 <philip tecnocode co uk>
+ * 
+ * GData Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GData Client 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.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GData Client.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GDATA_CALENDAR_FEED_H
+#define GDATA_CALENDAR_FEED_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <gdata/gdata-parsable.h>
+#include <gdata/gdata-feed.h>
+
+G_BEGIN_DECLS
+
+#define GDATA_TYPE_CALENDAR_FEED		(gdata_calendar_feed_get_type ())
+#define GDATA_CALENDAR_FEED(o)			(G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeed))
+#define GDATA_CALENDAR_FEED_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedClass))
+#define GDATA_IS_CALENDAR_FEED(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_FEED))
+#define GDATA_IS_CALENDAR_FEED_CLASS(k)		(G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_FEED))
+#define GDATA_CALENDAR_FEED_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedClass))
+
+typedef struct _GDataCalendarFeedPrivate	GDataCalendarFeedPrivate;
+
+/**
+ * GDataCalendarFeed:
+ *
+ * All the fields in the #GDataCalendarFeed structure are private and should never be accessed directly.
+ *
+ * Since: 0.3.0
+ **/
+typedef struct {
+	GDataFeed parent;
+	GDataCalendarFeedPrivate *priv;
+} GDataCalendarFeed;
+
+/**
+ * GDataCalendarFeedClass:
+ *
+ * All the fields in the #GDataCalendarFeedClass structure are private and should never be accessed directly.
+ *
+ * Since: 0.3.0
+ **/
+typedef struct {
+	/*< private >*/
+	GDataFeedClass parent;
+} GDataCalendarFeedClass;
+
+GType gdata_calendar_feed_get_type (void);
+
+const gchar *gdata_calendar_feed_get_timezone (GDataCalendarFeed *self);
+guint gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self);
+
+G_END_DECLS
+
+#endif /* !GDATA_CALENDAR_FEED_H */
diff --git a/gdata/services/calendar/gdata-calendar-service.c b/gdata/services/calendar/gdata-calendar-service.c
index 2b51c39..66093bf 100644
--- a/gdata/services/calendar/gdata-calendar-service.c
+++ b/gdata/services/calendar/gdata-calendar-service.c
@@ -40,6 +40,7 @@
 #include "gdata-service.h"
 #include "gdata-private.h"
 #include "gdata-query.h"
+#include "gdata-calendar-feed.h"
 
 /* Standards reference here: http://code.google.com/apis/calendar/docs/2.0/reference.html */
 
@@ -51,6 +52,7 @@ gdata_calendar_service_class_init (GDataCalendarServiceClass *klass)
 {
 	GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass);
 	service_class->service_name = "cl";
+	service_class->feed_type = GDATA_TYPE_CALENDAR_FEED;
 }
 
 static void
diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c
index 113487c..ba7e8b5 100644
--- a/gdata/tests/calendar.c
+++ b/gdata/tests/calendar.c
@@ -38,7 +38,7 @@ get_calendar (GError **error)
 	/* Get a calendar */
 	calendar_feed = gdata_calendar_service_query_own_calendars (GDATA_CALENDAR_SERVICE (service), NULL, NULL, NULL, NULL, error);
 	g_assert_no_error (*error);
-	g_assert (GDATA_IS_FEED (calendar_feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (calendar_feed));
 	g_clear_error (error);
 
 	calendars = gdata_feed_get_entries (calendar_feed);
@@ -122,7 +122,7 @@ test_query_all_calendars (void)
 
 	feed = gdata_calendar_service_query_all_calendars (GDATA_CALENDAR_SERVICE (service), NULL, NULL, NULL, NULL, &error);
 	g_assert_no_error (error);
-	g_assert (GDATA_IS_FEED (feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (feed));
 	g_clear_error (&error);
 
 	/* TODO: check entries and feed properties */
@@ -138,7 +138,7 @@ test_query_all_calendars_async_cb (GDataService *service, GAsyncResult *async_re
 
 	feed = gdata_service_query_finish (service, async_result, &error);
 	g_assert_no_error (error);
-	g_assert (GDATA_IS_FEED (feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (feed));
 	g_clear_error (&error);
 
 	/* TODO: Tests? */
@@ -170,7 +170,7 @@ test_query_own_calendars (void)
 
 	feed = gdata_calendar_service_query_own_calendars (GDATA_CALENDAR_SERVICE (service), NULL, NULL, NULL, NULL, &error);
 	g_assert_no_error (error);
-	g_assert (GDATA_IS_FEED (feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (feed));
 	g_clear_error (&error);
 
 	/* TODO: check entries and feed properties */
@@ -186,7 +186,7 @@ test_query_own_calendars_async_cb (GDataService *service, GAsyncResult *async_re
 
 	feed = gdata_service_query_finish (service, async_result, &error);
 	g_assert_no_error (error);
-	g_assert (GDATA_IS_FEED (feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (feed));
 	g_clear_error (&error);
 
 	/* TODO: Tests? */
@@ -222,7 +222,7 @@ test_query_events (void)
 	/* Get the entry feed */
 	feed = gdata_calendar_service_query_events (GDATA_CALENDAR_SERVICE (service), calendar, NULL, NULL, NULL, NULL, &error);
 	g_assert_no_error (error);
-	g_assert (GDATA_IS_FEED (feed));
+	g_assert (GDATA_IS_CALENDAR_FEED (feed));
 	g_clear_error (&error);
 
 	/* TODO: check entries and feed properties */



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