[libgdata] tests: Remove use of assigned-but-not-used variables in the tests



commit 605a4c64109c933e29eecb3e54062db781d7c5a0
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Mar 22 13:25:19 2011 +0000

    tests: Remove use of assigned-but-not-used variables in the tests

 gdata/tests/calendar.c  |   14 ++++++--------
 gdata/tests/contacts.c  |   10 ++++------
 gdata/tests/documents.c |   10 ++++------
 gdata/tests/streams.c   |    2 +-
 gdata/tests/youtube.c   |    8 ++------
 5 files changed, 17 insertions(+), 27 deletions(-)
---
diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c
index cf3ed5d..8b2c346 100644
--- a/gdata/tests/calendar.c
+++ b/gdata/tests/calendar.c
@@ -384,7 +384,7 @@ static void
 test_xml_dates (void)
 {
 	GDataCalendarEvent *event;
-	GList *times, *i;
+	GList *i;
 	GDataGDWhen *when;
 	gint64 _time;
 	GError *error = NULL;
@@ -406,7 +406,7 @@ test_xml_dates (void)
 	g_clear_error (&error);
 
 	/* Check the times */
-	times = i = gdata_calendar_event_get_times (event);
+	i = gdata_calendar_event_get_times (event);
 
 	/* First time */
 	when = GDATA_GD_WHEN (i->data);
@@ -1021,13 +1021,12 @@ static void
 test_batch_async (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 
 	/* Run an async query operation on the event */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "https://www.google.com/calendar/feeds/default/private/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_event)), GDATA_TYPE_CALENDAR_EVENT,
-	                                          GDATA_ENTRY (data->new_event), NULL, NULL);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_event)), GDATA_TYPE_CALENDAR_EVENT,
+	                                  GDATA_ENTRY (data->new_event), NULL, NULL);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 
@@ -1057,15 +1056,14 @@ static void
 test_batch_async_cancellation (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 	GCancellable *cancellable;
 	GError *error = NULL;
 
 	/* Run an async query operation on the event */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "https://www.google.com/calendar/feeds/default/private/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_event)), GDATA_TYPE_CALENDAR_EVENT,
-	                                          GDATA_ENTRY (data->new_event), NULL, &error);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_event)), GDATA_TYPE_CALENDAR_EVENT,
+	                                  GDATA_ENTRY (data->new_event), NULL, &error);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 	cancellable = g_cancellable_new ();
diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c
index d1d2a9d..e22184f 100644
--- a/gdata/tests/contacts.c
+++ b/gdata/tests/contacts.c
@@ -1888,13 +1888,12 @@ static void
 test_batch_async (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 
 	/* Run an async query operation on the contact */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "http://www.google.com/m8/feeds/contacts/default/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT,
-	                                          GDATA_ENTRY (data->new_contact), NULL, NULL);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT,
+	                                  GDATA_ENTRY (data->new_contact), NULL, NULL);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 
@@ -1924,15 +1923,14 @@ static void
 test_batch_async_cancellation (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 	GCancellable *cancellable;
 	GError *error = NULL;
 
 	/* Run an async query operation on the contact */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "http://www.google.com/m8/feeds/contacts/default/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT,
-	                                          GDATA_ENTRY (data->new_contact), NULL, &error);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT,
+	                                  GDATA_ENTRY (data->new_contact), NULL, &error);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 	cancellable = g_cancellable_new ();
diff --git a/gdata/tests/documents.c b/gdata/tests/documents.c
index 12dcb72..ae878eb 100644
--- a/gdata/tests/documents.c
+++ b/gdata/tests/documents.c
@@ -1269,13 +1269,12 @@ static void
 test_batch_async (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 
 	/* Run an async query operation on the document */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "https://docs.google.com/feeds/documents/private/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_doc)), GDATA_TYPE_DOCUMENTS_TEXT,
-	                                          GDATA_ENTRY (data->new_doc), NULL, NULL);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_doc)), GDATA_TYPE_DOCUMENTS_TEXT,
+	                                  GDATA_ENTRY (data->new_doc), NULL, NULL);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 
@@ -1305,15 +1304,14 @@ static void
 test_batch_async_cancellation (BatchAsyncData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 	GCancellable *cancellable;
 	GError *error = NULL;
 
 	/* Run an async query operation on the document */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "https://docs.google.com/feeds/documents/private/full/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_doc)), GDATA_TYPE_DOCUMENTS_TEXT,
-	                                          GDATA_ENTRY (data->new_doc), NULL, &error);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_doc)), GDATA_TYPE_DOCUMENTS_TEXT,
+	                                  GDATA_ENTRY (data->new_doc), NULL, &error);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 	cancellable = g_cancellable_new ();
diff --git a/gdata/tests/streams.c b/gdata/tests/streams.c
index 7bba269..1eaeff9 100644
--- a/gdata/tests/streams.c
+++ b/gdata/tests/streams.c
@@ -166,7 +166,7 @@ test_upload_stream_upload_no_entry_content_length_server_handler_cb (SoupServer
 	test_string = get_test_string (1, 1000);
 	test_string_length = strlen (test_string) + 1;
 
-	g_assert_cmpint (message->request_body->length, ==, strlen (test_string) + 1);
+	g_assert_cmpint (message->request_body->length, ==, test_string_length);
 	g_assert_cmpstr (message->request_body->data, ==, test_string);
 
 	g_free (test_string);
diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
index 1505594..7dffb7b 100644
--- a/gdata/tests/youtube.c
+++ b/gdata/tests/youtube.c
@@ -1292,13 +1292,11 @@ static void
 test_batch_async (BatchData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 
 	/* Run an async query operation on the video */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "http://gdata.youtube.com/feeds/api/videos/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (data->new_video), GDATA_TYPE_YOUTUBE_VIDEO, data->new_video, NULL,
-	                                          NULL);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (data->new_video), GDATA_TYPE_YOUTUBE_VIDEO, data->new_video, NULL, NULL);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 
@@ -1324,15 +1322,13 @@ static void
 test_batch_async_cancellation (BatchData *data, gconstpointer service)
 {
 	GDataBatchOperation *operation;
-	guint op_id;
 	GMainLoop *main_loop;
 	GCancellable *cancellable;
 	GError *error = NULL;
 
 	/* Run an async query operation on the video */
 	operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), "http://gdata.youtube.com/feeds/api/videos/batch";);
-	op_id = gdata_test_batch_operation_query (operation, gdata_entry_get_id (data->new_video), GDATA_TYPE_YOUTUBE_VIDEO, data->new_video, NULL,
-	                                          &error);
+	gdata_test_batch_operation_query (operation, gdata_entry_get_id (data->new_video), GDATA_TYPE_YOUTUBE_VIDEO, data->new_video, NULL, &error);
 
 	main_loop = g_main_loop_new (NULL, TRUE);
 	cancellable = g_cancellable_new ();



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