diff --git a/tests/old/testsuite/refcounting/Makefile.am b/tests/old/testsuite/refcounting/Makefile.am index 21f3fa79f0..af793deae1 100644 --- a/tests/old/testsuite/refcounting/Makefile.am +++ b/tests/old/testsuite/refcounting/Makefile.am @@ -1,11 +1,12 @@ SUBDIRS = -testprogs = object element pad element_pad +testprogs = object element pad element_pad bin object_SOURCES = object.c mem.c element_SOURCES = element.c mem.c pad_SOURCES = pad.c mem.c element_pad_SOURCES = element_pad.c mem.c +bin_SOURCES = bin.c mem.c TESTS = $(testprogs) diff --git a/tests/old/testsuite/refcounting/bin.c b/tests/old/testsuite/refcounting/bin.c new file mode 100644 index 0000000000..066b66cc03 --- /dev/null +++ b/tests/old/testsuite/refcounting/bin.c @@ -0,0 +1,139 @@ +#include + +#define ITERS 100000 +#include +#include "mem.h" + +static GstElement* +create_bin (void) +{ + GstElement *bin; + GstElement *element; + + bin = gst_bin_new ("testbin"); + element = gst_element_new (); + gst_element_set_name (element, "test1"); + gst_bin_add (GST_BIN (bin), element); + element = gst_element_new (); + gst_element_set_name (element, "test2"); + gst_bin_add (GST_BIN (bin), element); + + return bin; +} + +int +main (int argc, gchar *argv[]) +{ + GstElement *bin; + long usage1; + gint i, iters; + + gst_init (&argc, &argv); + + if (argc == 2) + iters = atoi (argv[1]); + else + iters = ITERS; + + g_print ("starting test\n"); + usage1 = vmsize(); + + bin = gst_bin_new ("somebin"); + gst_object_unref (GST_OBJECT (bin)); + g_print ("create/unref new bin %ld\n", vmsize()-usage1); + + for (i=0; i + +#define ITERS 100000 +#include +#include "mem.h" + +static GstElement* +create_bin (void) +{ + GstElement *bin; + GstElement *element; + + bin = gst_bin_new ("testbin"); + element = gst_element_new (); + gst_element_set_name (element, "test1"); + gst_bin_add (GST_BIN (bin), element); + element = gst_element_new (); + gst_element_set_name (element, "test2"); + gst_bin_add (GST_BIN (bin), element); + + return bin; +} + +int +main (int argc, gchar *argv[]) +{ + GstElement *bin; + long usage1; + gint i, iters; + + gst_init (&argc, &argv); + + if (argc == 2) + iters = atoi (argv[1]); + else + iters = ITERS; + + g_print ("starting test\n"); + usage1 = vmsize(); + + bin = gst_bin_new ("somebin"); + gst_object_unref (GST_OBJECT (bin)); + g_print ("create/unref new bin %ld\n", vmsize()-usage1); + + for (i=0; i