+2006-07-27 Jan Schmidt,,, <set EMAIL_ADDRESS environment variable>
+
+ * gst/parse/grammar.y:
+ * gst/parse/parse.l:
+ * tests/check/pipelines/parse-launch.c: (expected_fail_pipe),
+ (GST_START_TEST), (parse_suite):
+ Fix some of the leaks exposed by extending the parse-launch testsuite,
+ and move the 3 I can't figure out into a separate test that won't run
+ the pipelines unless the appropriate line is uncommented.
+
2006-07-27 Tim-Philipp Müller <tim at centricular dot net>
* plugins/elements/gstfilesrc.c: (gst_file_src_create_read):
%%
element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL);
- if (!$$)
+ if ($$ == NULL) {
SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), $1);
- gst_parse_strfree ($1);
- if (!$$)
+ gst_parse_strfree ($1);
YYERROR;
+ }
+ gst_parse_strfree ($1);
}
| element ASSIGNMENT { gst_parse_element_set ($2, $1, graph);
$$ = $1;
link: linkpart LINK linkpart { $$ = $1;
if ($2) {
$$->caps = gst_caps_from_string ($2);
- if (!$$->caps)
+ if ($$->caps == NULL)
SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), $2);
gst_parse_strfree ($2);
}
if (!element) {
SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
_("no sink element for URI \"%s\""), $2);
+ gst_parse_link_free ($1);
+ g_free ($2);
YYERROR;
} else if ($1->sink_name || $1->sink_pads) {
+ gst_object_unref (element);
SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
_("could not link sink element for URI \"%s\""), $2);
+ gst_parse_link_free ($1);
+ g_free ($2);
YYERROR;
} else {
$$ = gst_parse_chain_new ();
bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
g_assert (bin);
- for (walk = g.chain->elements; walk; walk = walk->next)
- gst_bin_add (bin, GST_ELEMENT (walk->data));
+ for (walk = g.chain->elements; walk; walk = walk->next) {
+ if (walk->data != NULL)
+ gst_bin_add (bin, GST_ELEMENT (walk->data));
+ }
g_slist_free (g.chain->elements);
ret = GST_ELEMENT (bin);
# include "config.h"
#endif
+#include <valgrind/valgrind.h>
+#include <valgrind/memcheck.h>
+
#include <gst/check/gstcheck.h>
static GstElement *
GError *error = NULL;
#ifndef GST_DISABLE_GST_DEBUG
- gst_debug_set_default_threshold (GST_LEVEL_NONE);
+ // gst_debug_set_default_threshold (GST_LEVEL_NONE);
#endif
pipeline = gst_parse_launch (pipe_descr, &error);
"fakesrc num-buffers=4 name=\"a=b\" a=b. ! fakesink",
/* checks: Error branch for a non-deserialisable property value */
"filesrc blocksize=absdff",
- /* checks: That requesting an element which doesn't exist doesn't work */
- "error-does-not-exist-src",
/* checks: That broken caps which don't parse can't create a pipeline */
"fakesrc ! video/raw,format=(antwerp)monkeys ! fakesink",
/* checks: Empty pipeline is invalid */
"fakesrc name=src fakesink name=sink noexiste. ! sink.",
/* checks: Referencing non-existent sink element by name can't link */
"fakesrc name=src fakesink name=sink src. ! noexiste.",
- /* checks: Invalid pipeline syntax fails */
- "fakesrc ! identity ! sgsdfagfd @ gfdgfdsgfsgSF",
/* checks: Can't link 2 elements that only have sink pads */
"fakesink ! fakesink",
- /* checks: Attempting to link to a non-existent pad on an element
- * created via URI handler should fail */
- "fakesrc ! .foo file:///dev/null",
/* checks multi-chain link without src element fails. */
"! identity ! identity ! fakesink",
/* END: */
GST_END_TEST;
+static const gchar *leaking_failures[] = {
+ /* checks: Invalid pipeline syntax fails */
+ "fakesrc ! identity ! sgsdfagfd @ gfdgfdsgfsgSF",
+ /* checks: Attempting to link to a non-existent pad on an element
+ * created via URI handler should fail */
+ "fakesrc ! .foo file:///dev/null",
+ /* checks: That requesting an element which doesn't exist doesn't work */
+ "error-does-not-exist-src",
+ NULL
+};
+
+GST_START_TEST (leaking_fail_pipes)
+{
+ const gchar **s;
+
+ for (s = leaking_failures; *s != NULL; s++) {
+ g_print ("Trying pipe: %s\n", *s);
+ /* Uncomment if you want to try fixing the leaks */
+ /* expected_fail_pipe (*s); */
+ VALGRIND_DO_LEAK_CHECK;
+ }
+}
+
+GST_END_TEST;
+
/* Helper function to test delayed linking support in parse_launch by creating
* a test element based on bin, which contains a fakesrc and a sometimes
* pad-template, and trying to link to a fakesink. When the bin transitions
tcase_add_test (tc_chain, test_launch_lines);
tcase_add_test (tc_chain, test_launch_lines2);
tcase_add_test (tc_chain, expected_to_fail_pipes);
+ tcase_add_test (tc_chain, leaking_fail_pipes);
tcase_add_test (tc_chain, delayed_link);
return s;
}