From: Robert Swain Date: Fri, 15 Apr 2011 13:11:35 +0000 (+0200) Subject: tests: Address unused but set variables X-Git-Tag: RELEASE-0.10.29~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4893678fd157fcbb778547808b7bdb9ee0b1b661;p=platform%2Fupstream%2Fgst-plugins-good.git tests: Address unused but set variables GCC 4.6.x spits warnings about such usage of variables. --- diff --git a/tests/check/elements/deinterlace.c b/tests/check/elements/deinterlace.c index b111c86f7..6aeb3def8 100644 --- a/tests/check/elements/deinterlace.c +++ b/tests/check/elements/deinterlace.c @@ -28,7 +28,7 @@ static gboolean gst_caps_is_interlaced (GstCaps * caps) { - GstStructure *structure; + GstStructure G_GNUC_UNUSED *structure; gboolean interlaced = FALSE; fail_unless (gst_caps_is_fixed (caps)); diff --git a/tests/check/elements/rtp-payloading.c b/tests/check/elements/rtp-payloading.c index 245f33219..b2160f4a5 100644 --- a/tests/check/elements/rtp-payloading.c +++ b/tests/check/elements/rtp-payloading.c @@ -291,13 +291,12 @@ rtp_pipeline_run (rtp_pipeline * p) for (i = 0; i < LOOP_COUNT; i++) { const char *frame_data_pointer = p->frame_data; int res; - int frame_count = p->frame_count; /* Write in to the pipe. */ while (frame_count > 0) { res = write (p->fd[1], frame_data_pointer, p->frame_data_size); - + fail_unless_equals_int (res, p->frame_data_size); frame_data_pointer += p->frame_data_size; frame_count--; } diff --git a/tests/check/pipelines/flacdec.c b/tests/check/pipelines/flacdec.c index abf9a058c..ce8546e99 100644 --- a/tests/check/pipelines/flacdec.c +++ b/tests/check/pipelines/flacdec.c @@ -110,7 +110,6 @@ GST_START_TEST (test_decode_seek_full) GstEvent *event; GstBuffer *buffer = NULL; guint16 first_sample = 0; - gboolean result; guint size = 0; gchar *path = g_build_filename (GST_TEST_FILES_PATH, "audiotestsrc.flac", NULL); @@ -133,7 +132,7 @@ GST_START_TEST (test_decode_seek_full) /* do a seek that should give us the complete output */ event = gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, 20480); - result = gst_element_send_event (appsink, event); + fail_unless (gst_element_send_event (appsink, event)); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -169,7 +168,6 @@ GST_START_TEST (test_decode_seek_partial) GstElement *appsink; GstEvent *event; GstBuffer *buffer = NULL; - gboolean result; guint size = 0; guint16 first_sample = 0; gchar *path = @@ -194,7 +192,7 @@ GST_START_TEST (test_decode_seek_partial) event = gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, 1024); GST_DEBUG ("seeking"); - result = gst_element_send_event (appsink, event); + fail_unless (gst_element_send_event (appsink, event)); GST_DEBUG ("seeked"); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/tests/examples/level/level-example.c b/tests/examples/level/level-example.c index ece364714..aa8b416f4 100644 --- a/tests/examples/level/level-example.c +++ b/tests/examples/level/level-example.c @@ -82,7 +82,7 @@ main (int argc, char *argv[]) GstElement *pipeline; GstCaps *caps; GstBus *bus; - gint watch_id; + guint watch_id; GMainLoop *loop; gst_init (&argc, &argv); @@ -120,5 +120,7 @@ main (int argc, char *argv[]) loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); + g_source_remove (watch_id); + g_main_loop_unref (loop); return 0; } diff --git a/tests/icles/videocrop-test.c b/tests/icles/videocrop-test.c index 94656342d..a4874e160 100644 --- a/tests/icles/videocrop-test.c +++ b/tests/icles/videocrop-test.c @@ -190,7 +190,6 @@ main (int argc, char **argv) GError *opt_err = NULL; GstElement *pipeline, *src, *filter1, *crop, *scale, *filter2, *csp, *sink; - GMainLoop *loop; GstCaps *filter_caps = NULL; GList *caps_list, *l; @@ -209,8 +208,6 @@ main (int argc, char **argv) GST_DEBUG_CATEGORY_INIT (videocrop_test_debug, "videocroptest", 0, "vctest"); - loop = g_main_loop_new (NULL, FALSE); - pipeline = gst_pipeline_new ("pipeline"); src = gst_element_factory_make ("videotestsrc", "videotestsrc"); g_assert (src != NULL); diff --git a/tests/icles/ximagesrc-test.c b/tests/icles/ximagesrc-test.c index f51913a99..a01bf656b 100644 --- a/tests/icles/ximagesrc-test.c +++ b/tests/icles/ximagesrc-test.c @@ -37,7 +37,6 @@ int main (int argc, char **argv) { GstElement *pipeline; - GstBus *bus; #ifndef G_DISABLE_ASSERT GstState state, pending; #endif @@ -53,8 +52,6 @@ main (int argc, char **argv) loop = g_main_loop_new (NULL, FALSE); - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_element_set_state (pipeline, GST_STATE_PLAYING); /* lets check it gets to PLAYING */