[libgdata] [core] Fix sign issues in GDataQuery



commit f76e3ce0fdd14beb58fd1dae48eb865e21a54ee3
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Apr 10 16:23:43 2010 +0100

    [core] Fix sign issues in GDataQuery
    
    Make GDataQuery:start-index and GDataQuery:max-results unsigned integers,
    rather than signed integers, with default values of 0.
    
    Note that this is an API break, though it doesn't affect any known current
    users of libgdata.

 gdata/gdata-query.c                              |   76 +++++++++++-----------
 gdata/gdata-query.h                              |   10 ++--
 gdata/services/calendar/gdata-calendar-query.c   |    6 +-
 gdata/services/contacts/gdata-contacts-query.c   |   10 ++--
 gdata/services/contacts/gdata-contacts-query.h   |    2 +-
 gdata/services/documents/gdata-documents-query.c |   10 ++--
 gdata/services/documents/gdata-documents-query.h |    3 +-
 gdata/services/picasaweb/gdata-picasaweb-query.c |   21 ++----
 gdata/services/picasaweb/gdata-picasaweb-query.h |    3 +-
 gdata/services/youtube/gdata-youtube-query.c     |    2 +-
 gdata/tests/general.c                            |    6 +-
 11 files changed, 73 insertions(+), 76 deletions(-)
---
diff --git a/gdata/gdata-query.c b/gdata/gdata-query.c
index 0e8ea0b..580d64c 100644
--- a/gdata/gdata-query.c
+++ b/gdata/gdata-query.c
@@ -234,11 +234,13 @@ gdata_query_class_init (GDataQueryClass *klass)
 	 *
 	 * The one-based index of the first result to be retrieved. Use gdata_query_next_page() and gdata_query_previous_page() to
 	 * implement pagination, rather than manually changing #GDataQuery:start-index.
+	 *
+	 * Use <code class="literal">0</code> to not specify a start index.
 	 **/
 	g_object_class_install_property (gobject_class, PROP_START_INDEX,
-				g_param_spec_int ("start-index",
-					"Start index", "Zero-based result start index.",
-					-1, G_MAXINT, -1,
+				g_param_spec_uint ("start-index",
+					"Start index", "One-based result start index.",
+					0, G_MAXUINT, 0,
 					G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	/**
@@ -259,12 +261,14 @@ gdata_query_class_init (GDataQueryClass *klass)
 	 * GDataQuery:max-results:
 	 *
 	 * Maximum number of results to be retrieved. Most services have a default #GDataQuery:max-results size imposed by the server; if you wish
-	 * to receive the entire feed, specify a large number such as %G_MAXINT for this property.
+	 * to receive the entire feed, specify a large number such as %G_MAXUINT for this property.
+	 *
+	 * Use <code class="literal">0</code> to not specify a maximum number of results.
 	 **/
 	g_object_class_install_property (gobject_class, PROP_MAX_RESULTS,
-				g_param_spec_int ("max-results",
+				g_param_spec_uint ("max-results",
 					"Maximum number of results", "The maximum number of entries to return.",
-					-1, G_MAXINT, -1,
+					0, G_MAXUINT, 0,
 					G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	/**
@@ -289,8 +293,6 @@ static void
 gdata_query_init (GDataQuery *self)
 {
 	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_QUERY, GDataQueryPrivate);
-	self->priv->start_index = -1;
-	self->priv->max_results = -1;
 }
 
 static void
@@ -339,13 +341,13 @@ gdata_query_get_property (GObject *object, guint property_id, GValue *value, GPa
 			g_value_set_boxed (value, &(priv->published_max));
 			break;
 		case PROP_START_INDEX:
-			g_value_set_int (value, priv->start_index);
+			g_value_set_uint (value, priv->start_index);
 			break;
 		case PROP_IS_STRICT:
 			g_value_set_boolean (value, priv->is_strict);
 			break;
 		case PROP_MAX_RESULTS:
-			g_value_set_int (value, priv->max_results);
+			g_value_set_uint (value, priv->max_results);
 			break;
 		case PROP_ETAG:
 			g_value_set_string (value, priv->etag);
@@ -385,13 +387,13 @@ gdata_query_set_property (GObject *object, guint property_id, const GValue *valu
 			gdata_query_set_published_max (self, g_value_get_boxed (value));
 			break;
 		case PROP_START_INDEX:
-			gdata_query_set_start_index (self, g_value_get_int (value));
+			gdata_query_set_start_index (self, g_value_get_uint (value));
 			break;
 		case PROP_IS_STRICT:
 			gdata_query_set_is_strict (self, g_value_get_boolean (value));
 			break;
 		case PROP_MAX_RESULTS:
-			gdata_query_set_max_results (self, g_value_get_int (value));
+			gdata_query_set_max_results (self, g_value_get_uint (value));
 			break;
 		case PROP_ETAG:
 			gdata_query_set_etag (self, g_value_get_string (value));
@@ -478,7 +480,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 
 	if (priv->start_index > 0) {
 		APPEND_SEP
-		g_string_append_printf (query_uri, "start-index=%d", priv->start_index);
+		g_string_append_printf (query_uri, "start-index=%u", priv->start_index);
 	}
 
 	if (priv->is_strict == TRUE) {
@@ -488,7 +490,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 
 	if (priv->max_results > 0) {
 		APPEND_SEP
-		g_string_append_printf (query_uri, "max-results=%d", priv->max_results);
+		g_string_append_printf (query_uri, "max-results=%u", priv->max_results);
 	}
 }
 
@@ -509,8 +511,8 @@ gdata_query_new (const gchar *q)
 /**
  * gdata_query_new_with_limits:
  * @q: a query string
- * @start_index: a one-based start index for the results
- * @max_results: the maximum number of results to return
+ * @start_index: a one-based start index for the results, or <code class="literal">0</code>
+ * @max_results: the maximum number of results to return, or <code class="literal">0</code>
  *
  * Creates a new #GDataQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results
  * applied.
@@ -518,7 +520,7 @@ gdata_query_new (const gchar *q)
  * Return value: a new #GDataQuery
  **/
 GDataQuery *
-gdata_query_new_with_limits (const gchar *q, gint start_index, gint max_results)
+gdata_query_new_with_limits (const gchar *q, guint start_index, guint max_results)
 {
 	return g_object_new (GDATA_TYPE_QUERY,
 			     "q", q,
@@ -880,37 +882,32 @@ gdata_query_set_published_max (GDataQuery *self, const GTimeVal *published_max)
  *
  * Gets the #GDataQuery:start-index property.
  *
- * Return value: the start index property, or <code class="literal">-1</code> if it is unset
+ * Return value: the start index property, or <code class="literal">0</code> if it is unset
  **/
-gint
+guint
 gdata_query_get_start_index (GDataQuery *self)
 {
-	g_return_val_if_fail (GDATA_IS_QUERY (self), -1);
+	g_return_val_if_fail (GDATA_IS_QUERY (self), 0);
 	return self->priv->start_index;
 }
 
 /**
  * gdata_query_set_start_index:
  * @self: a #GDataQuery
- * @start_index: the new start index
+ * @start_index: the new start index, or <code class="literal">0</code>
  *
  * Sets the #GDataQuery:start-index property of the #GDataQuery to the new one-based start index, @start_index.
  *
- * Set @start_index to <code class="literal">-1</code> or <code class="literal">0</code> to unset the property in the query URI.
+ * Set @start_index to <code class="literal">0</code> to unset the property in the query URI.
  **/
 void
-gdata_query_set_start_index (GDataQuery *self, gint start_index)
+gdata_query_set_start_index (GDataQuery *self, guint start_index)
 {
 	g_return_if_fail (GDATA_IS_QUERY (self));
-	g_return_if_fail (start_index >= -1);
-
-	/* Normalise it first */
-	if (start_index <= 0)
-		start_index = -1;
 
 	self->priv->start_index = start_index;
 
-	if (start_index == -1)
+	if (start_index == 0)
 		self->priv->parameter_mask &= ~GDATA_QUERY_PARAM_START_INDEX;
 	else
 		self->priv->parameter_mask |= GDATA_QUERY_PARAM_START_INDEX;
@@ -971,33 +968,32 @@ gdata_query_set_is_strict (GDataQuery *self, gboolean is_strict)
  *
  * Gets the #GDataQuery:max-results property.
  *
- * Return value: the maximum results property, or <code class="literal">-1</code> if it is unset
+ * Return value: the maximum results property, or <code class="literal">0</code> if it is unset
  **/
-gint
+guint
 gdata_query_get_max_results (GDataQuery *self)
 {
-	g_return_val_if_fail (GDATA_IS_QUERY (self), -1);
+	g_return_val_if_fail (GDATA_IS_QUERY (self), 0);
 	return self->priv->max_results;
 }
 
 /**
  * gdata_query_set_max_results:
  * @self: a #GDataQuery
- * @max_results: the new maximum results value
+ * @max_results: the new maximum results value, or <code class="literal">0</code>
  *
  * Sets the #GDataQuery:max-results property of the #GDataQuery to the new maximum results value, @max_results.
  *
- * Set @max_results to <code class="literal">-1</code> to unset the property in the query URI.
+ * Set @max_results to <code class="literal">0</code> to unset the property in the query URI.
  **/
 void
-gdata_query_set_max_results (GDataQuery *self, gint max_results)
+gdata_query_set_max_results (GDataQuery *self, guint max_results)
 {
 	g_return_if_fail (GDATA_IS_QUERY (self));
-	g_return_if_fail (max_results >= -1);
 
 	self->priv->max_results = max_results;
 
-	if (max_results == -1)
+	if (max_results == 0)
 		self->priv->parameter_mask &= ~GDATA_QUERY_PARAM_MAX_RESULTS;
 	else
 		self->priv->parameter_mask |= GDATA_QUERY_PARAM_MAX_RESULTS;
@@ -1087,6 +1083,8 @@ gdata_query_next_page (GDataQuery *self)
 		priv->use_next_uri = TRUE;
 		priv->use_previous_uri = FALSE;
 	} else {
+		if (priv->start_index == 0)
+			priv->start_index++;
 		priv->start_index += priv->max_results;
 	}
 
@@ -1113,10 +1111,12 @@ gdata_query_previous_page (GDataQuery *self)
 	if (priv->next_uri != NULL) {
 		priv->use_previous_uri = TRUE;
 		priv->use_next_uri = FALSE;
-	} else if (priv->start_index < priv->max_results) {
+	} else if (priv->start_index <= priv->max_results) {
 		return FALSE;
 	} else {
 		priv->start_index -= priv->max_results;
+		if (priv->start_index == 1)
+			priv->start_index--;
 	}
 
 	/* Our current ETag will no longer be relevant */
diff --git a/gdata/gdata-query.h b/gdata/gdata-query.h
index 4da9696..18be955 100644
--- a/gdata/gdata-query.h
+++ b/gdata/gdata-query.h
@@ -59,7 +59,7 @@ typedef struct {
 GType gdata_query_get_type (void) G_GNUC_CONST;
 
 GDataQuery *gdata_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-GDataQuery *gdata_query_new_with_limits (const gchar *q, gint start_index, gint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
+GDataQuery *gdata_query_new_with_limits (const gchar *q, guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 gchar *gdata_query_get_query_uri (GDataQuery *self, const gchar *feed_uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 void gdata_query_next_page (GDataQuery *self);
@@ -79,12 +79,12 @@ void gdata_query_get_published_min (GDataQuery *self, GTimeVal *published_min);
 void gdata_query_set_published_min (GDataQuery *self, const GTimeVal *published_min);
 void gdata_query_get_published_max (GDataQuery *self, GTimeVal *published_max);
 void gdata_query_set_published_max (GDataQuery *self, const GTimeVal *published_max);
-gint gdata_query_get_start_index (GDataQuery *self);
-void gdata_query_set_start_index (GDataQuery *self, gint start_index);
+guint gdata_query_get_start_index (GDataQuery *self);
+void gdata_query_set_start_index (GDataQuery *self, guint start_index);
 gboolean gdata_query_is_strict (GDataQuery *self);
 void gdata_query_set_is_strict (GDataQuery *self, gboolean is_strict);
-gint gdata_query_get_max_results (GDataQuery *self);
-void gdata_query_set_max_results (GDataQuery *self, gint max_results);
+guint gdata_query_get_max_results (GDataQuery *self);
+void gdata_query_set_max_results (GDataQuery *self, guint max_results);
 const gchar *gdata_query_get_etag (GDataQuery *self);
 void gdata_query_set_etag (GDataQuery *self, const gchar *etag);
 
diff --git a/gdata/services/calendar/gdata-calendar-query.c b/gdata/services/calendar/gdata-calendar-query.c
index c9bf1f7..adf0f81 100644
--- a/gdata/services/calendar/gdata-calendar-query.c
+++ b/gdata/services/calendar/gdata-calendar-query.c
@@ -395,9 +395,9 @@ gdata_calendar_query_new (const gchar *q)
 
 /**
  * gdata_calendar_query_new_with_limits:
- * @q: a query string
- * @start_min: a starting time for the event period
- * @start_max: an ending time for the event period
+ * @q: a query string, or %NULL
+ * @start_min: a starting time for the event period, or %NULL
+ * @start_max: an ending time for the event period, or %NULL
  *
  * Creates a new #GDataCalendarQuery with its #GDataQuery:q property set to @q, and the time limits @start_min and @start_max
  * applied.
diff --git a/gdata/services/contacts/gdata-contacts-query.c b/gdata/services/contacts/gdata-contacts-query.c
index 71558bc..1e269cc 100644
--- a/gdata/services/contacts/gdata-contacts-query.c
+++ b/gdata/services/contacts/gdata-contacts-query.c
@@ -237,7 +237,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 
 /**
  * gdata_contacts_query_new:
- * @q: a query string
+ * @q: a query string, or %NULL
  *
  * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q.
  *
@@ -253,9 +253,9 @@ gdata_contacts_query_new (const gchar *q)
 
 /**
  * gdata_contacts_query_new_with_limits:
- * @q: a query string
- * @start_index: a one-based start index for the results
- * @max_results: the maximum number of results to return
+ * @q: a query string, or %NULL
+ * @start_index: a one-based start index for the results, or <code class="literal">0</code>
+ * @max_results: the maximum number of results to return, or <code class="literal">0</code>
  *
  * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results
  * applied.
@@ -265,7 +265,7 @@ gdata_contacts_query_new (const gchar *q)
  * Since: 0.2.0
  **/
 GDataContactsQuery *
-gdata_contacts_query_new_with_limits (const gchar *q, gint start_index, gint max_results)
+gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, guint max_results)
 {
 	return g_object_new (GDATA_TYPE_CONTACTS_QUERY,
 			     "q", q,
diff --git a/gdata/services/contacts/gdata-contacts-query.h b/gdata/services/contacts/gdata-contacts-query.h
index a954611..2805901 100644
--- a/gdata/services/contacts/gdata-contacts-query.h
+++ b/gdata/services/contacts/gdata-contacts-query.h
@@ -63,7 +63,7 @@ typedef struct {
 GType gdata_contacts_query_get_type (void) G_GNUC_CONST;
 
 GDataContactsQuery *gdata_contacts_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-GDataContactsQuery *gdata_contacts_query_new_with_limits (const gchar *q, gint start_index, gint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
+GDataContactsQuery *gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 const gchar *gdata_contacts_query_get_order_by (GDataContactsQuery *self);
 void gdata_contacts_query_set_order_by (GDataContactsQuery *self, const gchar *order_by);
diff --git a/gdata/services/documents/gdata-documents-query.c b/gdata/services/documents/gdata-documents-query.c
index 9a02af8..8d9e64a 100644
--- a/gdata/services/documents/gdata-documents-query.c
+++ b/gdata/services/documents/gdata-documents-query.c
@@ -289,7 +289,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 
 /**
  * gdata_documents_query_new:
- * @q: a query string
+ * @q: a query string, or %NULL
  *
  * Creates a new #GDataDocumentsQuery with its #GDataQuery:q property set to @q.
  *
@@ -305,9 +305,9 @@ gdata_documents_query_new (const gchar *q)
 
 /**
  * gdata_documents_query_new_with_limits:
- * @q: a query string
- * @start_index: a one-based start index for the results
- * @max_results: the maximum number of results to return
+ * @q: a query string, or %NULL
+ * @start_index: a one-based start index for the results, or <code class="literal">0</code>
+ * @max_results: the maximum number of results to return, or <code class="literal">0</code>
  *
  * Creates a new #GDataDocumentsQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results
  * applied.
@@ -317,7 +317,7 @@ gdata_documents_query_new (const gchar *q)
  * Since: 0.4.0
  **/
 GDataDocumentsQuery *
-gdata_documents_query_new_with_limits (const gchar *q, gint start_index, gint max_results)
+gdata_documents_query_new_with_limits (const gchar *q, guint start_index, guint max_results)
 {
 	return g_object_new (GDATA_TYPE_DOCUMENTS_QUERY,
 			     "q", q,
diff --git a/gdata/services/documents/gdata-documents-query.h b/gdata/services/documents/gdata-documents-query.h
index 339a071..d021b3d 100644
--- a/gdata/services/documents/gdata-documents-query.h
+++ b/gdata/services/documents/gdata-documents-query.h
@@ -65,7 +65,8 @@ typedef struct {
 GType gdata_documents_query_get_type (void) G_GNUC_CONST;
 
 GDataDocumentsQuery *gdata_documents_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-GDataDocumentsQuery *gdata_documents_query_new_with_limits (const gchar *q, gint start_index, gint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
+GDataDocumentsQuery *gdata_documents_query_new_with_limits (const gchar *q,
+                                                            guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 gboolean gdata_documents_query_show_deleted (GDataDocumentsQuery *self);
 void gdata_documents_query_set_show_deleted (GDataDocumentsQuery *self, gboolean show_deleted);
diff --git a/gdata/services/picasaweb/gdata-picasaweb-query.c b/gdata/services/picasaweb/gdata-picasaweb-query.c
index 2508cf5..49371a9 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-query.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-query.c
@@ -314,29 +314,24 @@ gdata_picasaweb_query_new (const gchar *q)
 
 /**
  * gdata_picasaweb_query_new_with_limits:
- * @q: a query string
- * @start_index: the index of the first result to include
- * @max_results: the maximum number of results to include
+ * @q: a query string, or %NULL
+ * @start_index: the index of the first result to include, or <code class="literal">0</code>
+ * @max_results: the maximum number of results to include, or <code class="literal">0</code>
  *
- * Creates a #GDataPicasaWebQuery with its #GDataQuery:q property set
- * to @q, returning @max_results starting from the @start_index
- * result.
+ * Creates a #GDataPicasaWebQuery with its #GDataQuery:q property set to @q, returning @max_results starting from the @start_index<!-- -->th result.
  *
  * Note that when querying for albums with gdata_picasaweb_service_query_all_albums(), the @q parameter cannot be used.
  *
- * This is useful for paging through results, but the result
- * set between separate queries may change.  So, if you use this to
- * request the next ten results after a previous query, it may include
- * some of the previously returned results if their order changed, or
- * omit ones that would have otherwise been found in a earlier but
- * larger query.
+ * This is useful for paging through results, but the result set between separate queries may change. So, if you use this to
+ * request the next ten results after a previous query, it may include some of the previously returned results if their order changed, or
+ * omit ones that would have otherwise been found in a earlier but larger query.
  *
  * Return value: a new #GDataPicasaWebQuery
  *
  * Since: 0.6.0
  **/
 GDataPicasaWebQuery *
-gdata_picasaweb_query_new_with_limits (const gchar *q, gint start_index, gint max_results)
+gdata_picasaweb_query_new_with_limits (const gchar *q, guint start_index, guint max_results)
 {
 	return g_object_new (GDATA_TYPE_PICASAWEB_QUERY,
 			     "q", q,
diff --git a/gdata/services/picasaweb/gdata-picasaweb-query.h b/gdata/services/picasaweb/gdata-picasaweb-query.h
index 7190aad..a1eb3dc 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-query.h
+++ b/gdata/services/picasaweb/gdata-picasaweb-query.h
@@ -65,7 +65,8 @@ typedef struct {
 GType gdata_picasaweb_query_get_type (void) G_GNUC_CONST;
 
 GDataPicasaWebQuery *gdata_picasaweb_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-GDataPicasaWebQuery *gdata_picasaweb_query_new_with_limits (const gchar *q, gint start_index, gint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
+GDataPicasaWebQuery *gdata_picasaweb_query_new_with_limits (const gchar *q,
+                                                            guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 GDataPicasaWebVisibility gdata_picasaweb_query_get_visibility (GDataPicasaWebQuery *self);
 void gdata_picasaweb_query_set_visibility (GDataPicasaWebQuery *self, GDataPicasaWebVisibility visibility);
diff --git a/gdata/services/youtube/gdata-youtube-query.c b/gdata/services/youtube/gdata-youtube-query.c
index 0da64c7..5b5bcda 100644
--- a/gdata/services/youtube/gdata-youtube-query.c
+++ b/gdata/services/youtube/gdata-youtube-query.c
@@ -510,7 +510,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 
 /**
  * gdata_youtube_query_new:
- * @q: a query string
+ * @q: a query string, or %NULL
  *
  * Creates a new #GDataYouTubeQuery with its #GDataQuery:q property set to @q.
  *
diff --git a/gdata/tests/general.c b/gdata/tests/general.c
index c4a1bc8..901b6f8 100644
--- a/gdata/tests/general.c
+++ b/gdata/tests/general.c
@@ -335,7 +335,7 @@ test_feed_parse_xml (void)
 			"</author>"
 			"<generator version='0.6' uri='http://example.com/'>Example Generator</generator>"
 			"<openSearch:totalResults>2</openSearch:totalResults>"
-			"<openSearch:startIndex>0</openSearch:startIndex>"
+			"<openSearch:startIndex>1</openSearch:startIndex>"
 			"<openSearch:itemsPerPage>50</openSearch:itemsPerPage>"
 			"<entry>"
 				"<id>entry1</id>"
@@ -391,7 +391,7 @@ test_feed_parse_xml (void)
 	g_assert_cmpstr (gdata_generator_get_version (generator), ==, "0.6");
 
 	g_assert_cmpuint (items_per_page, ==, 50);
-	g_assert_cmpuint (start_index, ==, 0);
+	g_assert_cmpuint (start_index, ==, 1);
 	g_assert_cmpuint (total_results, ==, 2);
 
 	g_free (title);
@@ -471,7 +471,7 @@ test_feed_parse_xml (void)
 	g_assert_cmpstr (gdata_generator_get_version (generator), ==, "0.6");
 
 	g_assert_cmpuint (gdata_feed_get_items_per_page (feed), ==, 50);
-	g_assert_cmpuint (gdata_feed_get_start_index (feed), ==, 0);
+	g_assert_cmpuint (gdata_feed_get_start_index (feed), ==, 1);
 	g_assert_cmpuint (gdata_feed_get_total_results (feed), ==, 2);
 
 	g_object_unref (feed);



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