tests: Address unused but set variables

GCC 4.6.x spits warnings about such usage of variables.
This commit is contained in:
Robert Swain 2011-04-15 15:11:35 +02:00 committed by Tim-Philipp Müller
parent e757793b21
commit 4893678fd1
6 changed files with 7 additions and 14 deletions

View file

@ -28,7 +28,7 @@
static gboolean static gboolean
gst_caps_is_interlaced (GstCaps * caps) gst_caps_is_interlaced (GstCaps * caps)
{ {
GstStructure *structure; GstStructure G_GNUC_UNUSED *structure;
gboolean interlaced = FALSE; gboolean interlaced = FALSE;
fail_unless (gst_caps_is_fixed (caps)); fail_unless (gst_caps_is_fixed (caps));

View file

@ -291,13 +291,12 @@ rtp_pipeline_run (rtp_pipeline * p)
for (i = 0; i < LOOP_COUNT; i++) { for (i = 0; i < LOOP_COUNT; i++) {
const char *frame_data_pointer = p->frame_data; const char *frame_data_pointer = p->frame_data;
int res; int res;
int frame_count = p->frame_count; int frame_count = p->frame_count;
/* Write in to the pipe. */ /* Write in to the pipe. */
while (frame_count > 0) { while (frame_count > 0) {
res = write (p->fd[1], frame_data_pointer, p->frame_data_size); 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_data_pointer += p->frame_data_size;
frame_count--; frame_count--;
} }

View file

@ -110,7 +110,6 @@ GST_START_TEST (test_decode_seek_full)
GstEvent *event; GstEvent *event;
GstBuffer *buffer = NULL; GstBuffer *buffer = NULL;
guint16 first_sample = 0; guint16 first_sample = 0;
gboolean result;
guint size = 0; guint size = 0;
gchar *path = gchar *path =
g_build_filename (GST_TEST_FILES_PATH, "audiotestsrc.flac", NULL); 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 */ /* do a seek that should give us the complete output */
event = gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, GST_SEEK_FLAG_FLUSH, event = gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, 20480); 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); gst_element_set_state (pipeline, GST_STATE_PLAYING);
@ -169,7 +168,6 @@ GST_START_TEST (test_decode_seek_partial)
GstElement *appsink; GstElement *appsink;
GstEvent *event; GstEvent *event;
GstBuffer *buffer = NULL; GstBuffer *buffer = NULL;
gboolean result;
guint size = 0; guint size = 0;
guint16 first_sample = 0; guint16 first_sample = 0;
gchar *path = 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, 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_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, 1024);
GST_DEBUG ("seeking"); GST_DEBUG ("seeking");
result = gst_element_send_event (appsink, event); fail_unless (gst_element_send_event (appsink, event));
GST_DEBUG ("seeked"); GST_DEBUG ("seeked");
gst_element_set_state (pipeline, GST_STATE_PLAYING); gst_element_set_state (pipeline, GST_STATE_PLAYING);

View file

@ -82,7 +82,7 @@ main (int argc, char *argv[])
GstElement *pipeline; GstElement *pipeline;
GstCaps *caps; GstCaps *caps;
GstBus *bus; GstBus *bus;
gint watch_id; guint watch_id;
GMainLoop *loop; GMainLoop *loop;
gst_init (&argc, &argv); gst_init (&argc, &argv);
@ -120,5 +120,7 @@ main (int argc, char *argv[])
loop = g_main_loop_new (NULL, FALSE); loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop); g_main_loop_run (loop);
g_source_remove (watch_id);
g_main_loop_unref (loop);
return 0; return 0;
} }

View file

@ -190,7 +190,6 @@ main (int argc, char **argv)
GError *opt_err = NULL; GError *opt_err = NULL;
GstElement *pipeline, *src, *filter1, *crop, *scale, *filter2, *csp, *sink; GstElement *pipeline, *src, *filter1, *crop, *scale, *filter2, *csp, *sink;
GMainLoop *loop;
GstCaps *filter_caps = NULL; GstCaps *filter_caps = NULL;
GList *caps_list, *l; GList *caps_list, *l;
@ -209,8 +208,6 @@ main (int argc, char **argv)
GST_DEBUG_CATEGORY_INIT (videocrop_test_debug, "videocroptest", 0, "vctest"); GST_DEBUG_CATEGORY_INIT (videocrop_test_debug, "videocroptest", 0, "vctest");
loop = g_main_loop_new (NULL, FALSE);
pipeline = gst_pipeline_new ("pipeline"); pipeline = gst_pipeline_new ("pipeline");
src = gst_element_factory_make ("videotestsrc", "videotestsrc"); src = gst_element_factory_make ("videotestsrc", "videotestsrc");
g_assert (src != NULL); g_assert (src != NULL);

View file

@ -37,7 +37,6 @@ int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GstElement *pipeline; GstElement *pipeline;
GstBus *bus;
#ifndef G_DISABLE_ASSERT #ifndef G_DISABLE_ASSERT
GstState state, pending; GstState state, pending;
#endif #endif
@ -53,8 +52,6 @@ main (int argc, char **argv)
loop = g_main_loop_new (NULL, FALSE); loop = g_main_loop_new (NULL, FALSE);
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_element_set_state (pipeline, GST_STATE_PLAYING); gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* lets check it gets to PLAYING */ /* lets check it gets to PLAYING */