From 775656d35fc9abff716ab234ebc50bfdb993c9eb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Dec 2001 20:06:45 +0000 Subject: [PATCH] Added another test app. Original commit message from CVS: Added another test app. --- tests/old/testsuite/cleanup/Makefile.am | 4 +- tests/old/testsuite/cleanup/cleanup4.c | 57 +++++++++++++++++++++++++ testsuite/cleanup/Makefile.am | 4 +- testsuite/cleanup/cleanup4.c | 57 +++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 tests/old/testsuite/cleanup/cleanup4.c create mode 100644 testsuite/cleanup/cleanup4.c diff --git a/tests/old/testsuite/cleanup/Makefile.am b/tests/old/testsuite/cleanup/Makefile.am index 4772b0f05b..88d32dd892 100644 --- a/tests/old/testsuite/cleanup/Makefile.am +++ b/tests/old/testsuite/cleanup/Makefile.am @@ -1,4 +1,4 @@ -testprogs = cleanup1 cleanup2 cleanup3 +testprogs = cleanup1 cleanup2 cleanup3 cleanup4 TESTS = $(testprogs) @@ -11,3 +11,5 @@ cleanup2_LDADD = $(GST_LIBS) cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) cleanup3_LDADD = $(GST_LIBS) cleanup3_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) +cleanup4_LDADD = $(GST_LIBS) +cleanup4_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) diff --git a/tests/old/testsuite/cleanup/cleanup4.c b/tests/old/testsuite/cleanup/cleanup4.c new file mode 100644 index 0000000000..fa14d8d385 --- /dev/null +++ b/tests/old/testsuite/cleanup/cleanup4.c @@ -0,0 +1,57 @@ +#include + +static GstElement * +create_pipeline (void) +{ +} + +gint +main (gint argc, gchar *argv[]) +{ + GstElement *pipeline; + GstElement *fakesrc; + gint i; + + free (malloc(8)); /* -lefence */ + + gst_init (&argc, &argv); + + i = 10000; + + pipeline = gst_pipeline_new ("main_pipeline"); + + fakesrc = gst_elementfactory_make ("fakesrc", "fakesrc"); + g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL); + gst_bin_add (GST_BIN (pipeline), fakesrc); + + g_mem_chunk_info (); + while (i--) { + GstElement *bin; + GstElement *fakesink; + + fprintf (stderr, "+"); + + bin = gst_bin_new ("bin"); + + fakesink = gst_elementfactory_make ("fakesink", "fakesink"); + + gst_element_connect (fakesrc, "src", fakesink, "sink"); + + gst_bin_add (GST_BIN (bin), fakesink); + gst_bin_add (GST_BIN (pipeline), bin); + + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + while (gst_bin_iterate (GST_BIN (pipeline))); + + gst_element_set_state (pipeline, GST_STATE_NULL); + + fprintf (stderr, "-"); + gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin)); + + } + fprintf (stderr, "\n"); + g_mem_chunk_info (); + + return 0; +} diff --git a/testsuite/cleanup/Makefile.am b/testsuite/cleanup/Makefile.am index 4772b0f05b..88d32dd892 100644 --- a/testsuite/cleanup/Makefile.am +++ b/testsuite/cleanup/Makefile.am @@ -1,4 +1,4 @@ -testprogs = cleanup1 cleanup2 cleanup3 +testprogs = cleanup1 cleanup2 cleanup3 cleanup4 TESTS = $(testprogs) @@ -11,3 +11,5 @@ cleanup2_LDADD = $(GST_LIBS) cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) cleanup3_LDADD = $(GST_LIBS) cleanup3_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) +cleanup4_LDADD = $(GST_LIBS) +cleanup4_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) diff --git a/testsuite/cleanup/cleanup4.c b/testsuite/cleanup/cleanup4.c new file mode 100644 index 0000000000..fa14d8d385 --- /dev/null +++ b/testsuite/cleanup/cleanup4.c @@ -0,0 +1,57 @@ +#include + +static GstElement * +create_pipeline (void) +{ +} + +gint +main (gint argc, gchar *argv[]) +{ + GstElement *pipeline; + GstElement *fakesrc; + gint i; + + free (malloc(8)); /* -lefence */ + + gst_init (&argc, &argv); + + i = 10000; + + pipeline = gst_pipeline_new ("main_pipeline"); + + fakesrc = gst_elementfactory_make ("fakesrc", "fakesrc"); + g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL); + gst_bin_add (GST_BIN (pipeline), fakesrc); + + g_mem_chunk_info (); + while (i--) { + GstElement *bin; + GstElement *fakesink; + + fprintf (stderr, "+"); + + bin = gst_bin_new ("bin"); + + fakesink = gst_elementfactory_make ("fakesink", "fakesink"); + + gst_element_connect (fakesrc, "src", fakesink, "sink"); + + gst_bin_add (GST_BIN (bin), fakesink); + gst_bin_add (GST_BIN (pipeline), bin); + + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + while (gst_bin_iterate (GST_BIN (pipeline))); + + gst_element_set_state (pipeline, GST_STATE_NULL); + + fprintf (stderr, "-"); + gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin)); + + } + fprintf (stderr, "\n"); + g_mem_chunk_info (); + + return 0; +}