+include Rules
+
+
if GST_DISABLE_PARSE
GST_PARSE_DIRS =
else
GST_DEBUG_DIRS = debug
endif
-# FIXME : threads bytestream
-SUBDIRS = caps plugin elements clock refcounting threads indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) ## cleanup dynparams
-
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
-
-if BUILD_FAILING_TESTS
-testprogs = test_gst_init
-inspectcheck = gst-inspect-check
-else
-testprogs =
-inspectcheck =
-endif
-
-# since these TESTS are only run after recursing into subdirs,
-# gst-register should be run before that, in the first subdir that uses it
-# TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck)
-TESTS = $(testprogs) $(inspectcheck)
+SUBDIRS = bytestream cleanup dynparams \
+ caps plugin elements clock refcounting threads \
+ indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
-check_PROGRAMS = $(testprogs)
+DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
+ plugin refcounting threads parse debug
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+tests_pass = test_gst_init
+tests_fail =
# we makes them, we gots to clean them
-CLEANFILES = test-registry.xml
-
-DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
- plugin refcounting threads parse debug
+CLEANFILES += test-registry.xml
EXTRA_DIST = gst-inspect-check
+
--- /dev/null
+
+TESTS_ENVIRONMENT=\
+ G_DEBUG=fatal_warnings \
+ GST_PLUGIN_PATH=$(top_builddir) \
+ GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
+
+
+plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
+
+check_PROGRAMS = $(tests_pass) $(tests_fail)
+
+TESTS = $(top_builddir)/tools/gst-register $(tests_pass) $(tests_fail)
+XFAIL_TESTS = $(tests_fail)
+
+AM_CFLAGS = $(GST_CFLAGS)
+LIBS = $(GST_LIBS)
+
+# override to _not_ install the test plugins
+install-pluginLTLIBRARIES:
+
+# This rule is here so make distcheck works on machines where core
+# dumps have PIDs appended
+CLEANFILES = core.*
+
-## filterdir = $(libdir)/gst
+include ../Rules
-testprogs = test1
+tests_pass =
+tests_fail = test1
-check_PROGRAMS = $(testprogs)
+test1_SOURCES = test1.c gstbstest.c
-test1_SOURCES = test1.c gstbstest.c mem.c
-test1_CFLAGS = $(GST_CFLAGS)
-test1_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/bytestream/ -lgstbytestream
-noinst_HEADERS = mem.h
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#define GST_TYPE_BSTEST (gst_bstest_get_type())
#define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest))
GstElementDetails gst_bstest_details = {
"ByteStreamTest",
"Filter",
+ "LGPL",
"Test for the GstByteStream code",
VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>," "Wim Taymans <wim.taymans@chello.be>",
+ "Erik Walthinsen <omega@temple-baptist.com>,"
+ "Wim Taymans <wim.taymans@chello.be>",
"(C) 2001",
};
}
-static GstPadLinkReturn
-gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
+static GstCaps *
+gst_bstest_getcaps (GstPad *pad, GstCaps *caps)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
+ GstPad *otherpad;
- /* thomas: I was trying to fix this old test, one of these two pads
- * needs to be dropped according to the new api, which one ? */
- return gst_pad_proxy_link (pad, bstest->sinkpad, caps);
-}
-
-static GstPadLinkReturn
-gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
-{
- GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
+ otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad;
- return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps);
+ return gst_pad_get_allowed_caps (otherpad);
}
static void
{
bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad);
- gst_pad_set_negotiate_function (bstest->sinkpad, gst_bstest_negotiate_sink);
+ gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps);
bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad);
- gst_pad_set_negotiate_function (bstest->srcpad, gst_bstest_negotiate_src);
+ gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps);
gst_element_set_loop_function (GST_ELEMENT (bstest), gst_bstest_loop);
do {
guint size = 0;
guint i = 0;
+ guint8 *ptr;
while (i < bstest->num_patterns) {
buf = NULL;
if (bstest->patterns[i][0] == 'r') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
if (!bstest->silent) g_print ("bstest: ***** read %d bytes\n", size);
- buf = gst_bytestream_read (bstest->bs, size);
+ gst_bytestream_read (bstest->bs, &buf, size);
}
else if (bstest->patterns[i][0] == 'f') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
else if (!strncmp (bstest->patterns[i], "pb", 2)) {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][2], size);
if (!bstest->silent) g_print ("bstest: ***** peek bytes %d bytes\n", size);
- gst_bytestream_peek_bytes (bstest->bs, size);
+ gst_bytestream_peek_bytes (bstest->bs, &ptr, size);
}
else if (bstest->patterns[i][0] == 'p') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
if (!bstest->silent) g_print ("bstest: ***** peek %d bytes\n", size);
- buf = gst_bytestream_peek (bstest->bs, size);
+ gst_bytestream_peek (bstest->bs, &buf, size);
gst_buffer_unref (buf);
buf = NULL;
}
if (buf)
- gst_pad_push (bstest->srcpad, buf);
+ gst_pad_push (bstest->srcpad, GST_DATA (buf));
i++;
}
{
GstElementFactory *factory;
- /* we need gstbytestream */
- if (!gst_library_load ("gstbytestream")) {
- g_print ("can't load bytestream\n");
- return FALSE;
- }
-
/* We need to create an ElementFactory for each element we provide.
* This consists of the name of the element, the GType identifier,
* and a pointer to the details structure at the top of the file.
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-int vmsize() {
- int pid,fd,size,i,mem;
- char filename[17], buf[256], *ptr, *end;
-
- pid = getpid();
- snprintf(filename,17,"/proc/%d/stat",pid);
- fd = open(filename,O_RDONLY);
- size = read(fd,buf,240);
- ptr = buf;
- for (i=0;i<22;i++)
- ptr = (char *)strchr(ptr,' ') + 1;
- end = (char *)strchr(ptr,' ');
- *end = 0;
- sscanf(ptr,"%d",&mem);
- close(fd);
- return mem;
-}
+++ /dev/null
-int vmsize();
#include <stdlib.h>
#include <gst/gst.h>
-#include "mem.h"
#define VM_THRES 1000
#define MAX_CONFIG_LINE 255
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
while (iters) {
- gint newvm = vmsize();
+ gint newvm = gst_alloc_trace_live_all ();
gint percent;
percent = (gint)((maxiters-iters+1)*100.0/maxiters);
GSList *walk;
gint arg_walk;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
gst_init (&argc, &argv);
arg_walk = 1;
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = intersection compatibility normalisation union string-conversions fixed intersect2
-# we run gst-register here, which is a HACK to generate the test registry
-# before we actually run the real tests
-# a better fix is welcome :)
-TESTS = $(top_builddir)/tools/gst-register $(testprogs)
+tests_pass = \
+ intersection \
+ compatibility \
+ normalisation \
+ union \
+ string-conversions \
+ fixed \
+ intersect2
+
+tests_fail =
-check_PROGRAMS = $(testprogs)
intersection_LDADD = $(GST_LIBS)
-intersection_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+intersection_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
compatibility_LDADD = $(GST_LIBS)
-compatibility_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+compatibility_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
normalisation_LDADD = $(GST_LIBS)
-normalisation_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+normalisation_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
union_LDADD = $(GST_LIBS)
-union_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+union_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
string_conversions_LDADD = $(GST_LIBS)
-string_conversions_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+string_conversions_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
fixed_LDADD = $(GST_LIBS)
-fixed_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+fixed_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
intersect2_LDADD = $(GST_LIBS)
-intersect2_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+intersect2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-FAILING = cleanup3 cleanup4
-else
-FAILING =
-endif
-
-testprogs = cleanup1 cleanup2 $(FAILING) cleanup5
-
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
+tests_pass = cleanup1 cleanup2 cleanup4 cleanup5
+tests_fail = cleanup3
# we have nothing but apps here, we can do this safely
-cleanup1_LDADD = $(GST_LIBS) #-ldmallocth
+cleanup1_LDADD = $(GST_LIBS)
cleanup1_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS)
cleanup2_LDADD = $(GST_LIBS)
cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = clock1 clock2
+tests_pass = clock1 clock2
+tests_fail =
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
-#testprogs = global output commandline category
-testprogs = commandline category
+include ../Rules
-TESTS = $(testprogs)
+tests_pass = commandline category global output
+tests_fail =
-check_PROGRAMS = $(testprogs)
-
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
-testprogs = dparamstest
+include ../Rules
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
+tests_pass =
+tests_fail = dparamstest
dparamstest_CFLAGS = $(GST_CFLAGS)
-dparamstest_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/control/ -lgstcontrol
+dparamstest_LDFLAGS = $(GST_LIBS)
+dparamstest_LDADD = $(top_builddir)/libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la
dparamstest_SOURCES = dparamstest.c
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/gst.h>
#include <gst/control/control.h>
GstElementDetails gst_dptest_details = {
"DParamsTest",
"Filter",
+ "LGPL",
"Test for the GstDParam code",
VERSION,
"Steve Baker <stevebaker_org@yahoo.co.uk>",
GParamSpec * pspec);
static GstElementStateReturn gst_dptest_change_state (GstElement *element);
-static void gst_dptest_chain (GstPad *pad, GstBuffer *buf);
+static void gst_dptest_chain (GstPad *pad, GstData *buf);
static GstElementClass *parent_class = NULL;
}
static void
-gst_dptest_chain (GstPad *pad, GstBuffer *buf)
+gst_dptest_chain (GstPad *pad, GstData *data)
{
GstDpTest *dptest;
- gint i=0, frame_countdown;
+ gint frame_countdown;
dptest = GST_DPTEST(gst_pad_get_parent (pad));
g_assert(dptest);
/* we're using a made up buffer size of 64 and a timestamp of zero */
frame_countdown = GST_DPMAN_PREPROCESS(dptest->dpman, 64, 0LL);
- while(GST_DPMAN_PROCESS_COUNTDOWN(dptest->dpman, frame_countdown, i));
+ while(GST_DPMAN_PROCESS(dptest->dpman, frame_countdown));
g_print("dp chain\n");
}
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-tests_failing = fake
-else
-tests_failing =
-endif
-tests_working = name tee property
+tests_pass = name tee property fake
+tests_fail =
-TESTS = $(tests_working)
-
-check_PROGRAMS = $(tests_failing) $(tests_working)
-
-EXTRA_DIST = property.h
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+noinst_HEADERS = property.h
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = cache1 indexdump
+tests_pass = cache1 indexdump
+tests_fail =
-TESTS = $(testprogs)
-check_PROGRAMS = $(testprogs)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+include ../Rules
-check_PROGRAMS = parse1 parse2
-
-# parse1 is broken
-TESTS = parse2
+tests_pass = parse2
+tests_fail = parse1
parse1_SOURCES = parse1.c
parse2_SOURCES = parse2.c
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
#include <gst/gst.h>
#include <string.h>
+#include <unistd.h>
/* variables used by the TEST_* macros */
static gint test = 0;
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
}G_STMT_END
#define TEST_RUN G_STMT_START{ \
+ alarm(10); \
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \
g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \
return -test; \
} \
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \
+ alarm(0); \
}G_STMT_END
#define PIPELINE1 "fakesrc"
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = yesyo data= Subbuffer\\ data"
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(top_builddir) GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
+include ../Rules
-plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la
-# FIXME : tests need fixing
-testprogs = static dynamic linked loading registry static2
+tests_pass = static dynamic static2 linked loading registry
+tests_fail =
-AM_CFLAGS = $(GST_CFLAGS)
-LIBS = $(GST_LIBS)
libtestplugin_la_SOURCES = testplugin.c
libtestplugin_la_CFLAGS = $(GST_CFLAGS)
static_SOURCES = static.c testplugin_s.c testplugin2_s.c
-check_PROGRAMS = $(testprogs)
-
-TESTS = $(top_builddir)/tools/gst-register $(testprogs)
-
-# override to _not_ install the test plugins
-install-pluginLTLIBRARIES:
-
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-tests_failing = element bin element_pad pad
-else
-tests_failing =
-endif
-tests_working = mainloop sched
+tests_pass = bin element mainloop pad
+tests_fail = element_pad sched
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 = $(tests_working)
-
-check_PROGRAMS = $(TESTS)
-noinst_PROGRAMS = $(tests_failing)
-
EXTRA_DIST = thread.c object.c
noinst_HEADERS = mem.h
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CFLAGS) $(GST_CFLAGS)
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
-#include "mem.h"
static GstElement*
create_bin (void)
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
+#if 0
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
+#endif
gst_object_unref (GST_OBJECT (bin));
}
+#if 0
+/* This code is bogus */
static void
add_remove_test3 (void)
{
gst_object_unref (GST_OBJECT (bin));
}
+#endif
+#if 0
+/* This code is bogus */
static void
add_remove_test4 (void)
{
gst_object_unref (GST_OBJECT (bin));
}
+#endif
int
main (int argc, gchar *argv[])
{
GstElement *bin;
- long usage1;
+ int usage1;
gint i, iters;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
+
gst_init (&argc, &argv);
if (argc == 2)
else
iters = ITERS;
+
g_print ("starting test\n");
- usage1 = vmsize();
+
+ usage1 = gst_alloc_trace_live_all ();
+ //gst_alloc_trace_print_all ();
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
g_assert (GST_OBJECT_FLOATING (bin));
gst_object_sink (GST_OBJECT (bin));
g_assert (!GST_OBJECT_FLOATING (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/ref/sink/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/ref/sink/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
gst_object_sink (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/ref/sink/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/sink/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
g_assert (!GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
g_assert (GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1);
+#endif
+ g_print ("create/destroy/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1);
+ g_print ("create/destroy/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/ref/unref/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/ref/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/ref/unref/unref %d bin %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/unref/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
- g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1);
+#endif
+ g_print ("craete/ref/destroy/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("craete/ref/destroy/unref/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("craete/ref/destroy/unref/unref %d bins with name %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d bins with name %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
for (i=0; i<iters;i++) {
gst_element_set_name (bin, "testing");
}
gst_object_unref (GST_OBJECT (bin));
- g_print ("set name %d times %ld\n", iters, vmsize()-usage1);
+ g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = create_bin();
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bin with children %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d bin with children %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters/2;i++) {
bin = create_bin_ghostpads();
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bin with children and ghostpads %ld\n", iters/2, vmsize()-usage1);
+ g_print ("create/unref %d bin with children and ghostpads %d\n", iters/2, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
add_remove_test1();
}
- g_print ("add/remove test1 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/remove test1 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
add_remove_test2();
}
- g_print ("add/remove test2 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/remove test2 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
for (i=0; i<iters;i++) {
add_remove_test3();
}
- g_print ("add/destroy/remove test3 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/destroy/remove test3 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
add_remove_test4();
}
- g_print ("add/destroy/remove test4 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/destroy/remove test4 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+
+ g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
- g_print ("leaked: %ld\n", vmsize()-usage1);
+ //gst_alloc_trace_print_all ();
- return (vmsize()-usage1 ? -1 : 0);
+ return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}
#include <gst/gst.h>
-#define ITERS 10000
+#define ITERS 100
#include <stdlib.h>
-#include "mem.h"
int
main (int argc, gchar *argv[])
{
GstElement *element;
- long usage1;
+ int usage1;
gint i, iters;
gst_init (&argc, &argv);
iters = ITERS;
g_print ("starting test\n");
- usage1 = vmsize();
+
+ usage1 = gst_alloc_trace_live_all ();
+ //gst_alloc_trace_print_all ();
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
- g_print ("create/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (GST_OBJECT_FLOATING (element));
gst_object_sink (GST_OBJECT (element));
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/ref/sink/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/ref/sink/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
gst_object_sink (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/ref/sink/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/sink/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/destroy/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1);
+ g_print ("create/destroy/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/ref/unref/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/ref/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/ref/unref/unref %d element %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/unref/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("craete/ref/destroy/unref/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("craete/ref/destroy/unref/unref %d elements with name %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d elements with name %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
element = gst_element_factory_make ("fakesrc", NULL);
for (i=0; i<iters;i++) {
gst_element_set_name (element, "testing");
}
gst_object_unref (GST_OBJECT (element));
- g_print ("set name %d times %ld\n", iters, vmsize()-usage1);
+ g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1);
- g_print ("leaked: %ld\n", vmsize()-usage1);
+ g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
- return (vmsize()-usage1 ? -1 : 0);
+ return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
#include "mem.h"
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
#include "mem.h"
long usage1;
gint i, iters;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
+
gst_init (&argc, &argv);
+ g_mem_profile ();
+
if (argc == 2)
iters = atoi (argv[1]);
else
iters = ITERS;
+ //gst_alloc_trace_print_all ();
+
g_print ("starting pad test\n");
usage1 = vmsize();
}
g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize()-usage1);
+#if 0
pad = gst_pad_new ("padname", GST_PAD_SINK);
g_assert (!GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1);
+#endif
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
+#if 0
gst_object_unref (GST_OBJECT (pad));
+#endif
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1);
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
- gst_object_unref (GST_OBJECT (pad));
+ //gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters, vmsize()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters, vmsize()-usage1);
+#endif
pad = gst_pad_new ("padname", GST_PAD_SINK);
for (i=0; i<iters;i++) {
g_print ("leaked: %ld\n", vmsize()-usage1);
+ //gst_alloc_trace_print_all ();
+
return vmsize()-usage1;
}
if (element == NULL) {
g_warning ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...", type);
- exit (0);
+ exit (1);
}
return element;
-GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
+include ../Rules
-testprogs = locked
+tests_pass = locked
+tests_fail =
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
locked_LDADD = $(GST_LIBS)
locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = thread1 thread2 thread5
-testsfailing = threadb threadc threadd threade threadf thread4 queue thread3
+tests_pass = thread1 thread2 thread3 thread4 threadf
+tests_fail = thread5 threadb threadc threadd threade queue
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
-
-noinst_PROGRAMS = $(testsfailing)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
queue_SOURCES = queue.c
queue_CFLAGS = $(AM_CFLAGS)
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
g_object_set (G_OBJECT (src), "num_buffers", 5, NULL);
- g_object_set (sink, "signal-handoff", TRUE, NULL);
+ g_object_set (sink, "signal-handoffs", TRUE, NULL);
}
void
gst_element_set_state (pipeline, GST_STATE_NULL);
}
if (TESTNUM == 5) {
- /* I don't this test is supposed to work */
+ /* I don't think this test is supposed to work */
GstElement *sink;
sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
#include <gst/gst.h>
+#include <unistd.h>
/* threadc.c
* this tests if we can make a GstThread, with enough cothreads to stress it
gulong id;
GstElement *thread;
+ alarm(10);
+
gst_init (&argc, &argv);
for (i = 0; i < runs; ++i)
#include <gst/gst.h>
+#include <unistd.h>
/* threadc.c
* this tests if we can make a GstBin and iterate it inside a GThread
int i;
GstElement *pipeline;
+ alarm(10);
+
g_thread_init (NULL);
gst_init (&argc, &argv);
+include Rules
+
+
if GST_DISABLE_PARSE
GST_PARSE_DIRS =
else
GST_DEBUG_DIRS = debug
endif
-# FIXME : threads bytestream
-SUBDIRS = caps plugin elements clock refcounting threads indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) ## cleanup dynparams
-
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
-
-if BUILD_FAILING_TESTS
-testprogs = test_gst_init
-inspectcheck = gst-inspect-check
-else
-testprogs =
-inspectcheck =
-endif
-
-# since these TESTS are only run after recursing into subdirs,
-# gst-register should be run before that, in the first subdir that uses it
-# TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck)
-TESTS = $(testprogs) $(inspectcheck)
+SUBDIRS = bytestream cleanup dynparams \
+ caps plugin elements clock refcounting threads \
+ indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
-check_PROGRAMS = $(testprogs)
+DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
+ plugin refcounting threads parse debug
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+tests_pass = test_gst_init
+tests_fail =
# we makes them, we gots to clean them
-CLEANFILES = test-registry.xml
-
-DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
- plugin refcounting threads parse debug
+CLEANFILES += test-registry.xml
EXTRA_DIST = gst-inspect-check
+
--- /dev/null
+
+TESTS_ENVIRONMENT=\
+ G_DEBUG=fatal_warnings \
+ GST_PLUGIN_PATH=$(top_builddir) \
+ GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
+
+
+plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
+
+check_PROGRAMS = $(tests_pass) $(tests_fail)
+
+TESTS = $(top_builddir)/tools/gst-register $(tests_pass) $(tests_fail)
+XFAIL_TESTS = $(tests_fail)
+
+AM_CFLAGS = $(GST_CFLAGS)
+LIBS = $(GST_LIBS)
+
+# override to _not_ install the test plugins
+install-pluginLTLIBRARIES:
+
+# This rule is here so make distcheck works on machines where core
+# dumps have PIDs appended
+CLEANFILES = core.*
+
-## filterdir = $(libdir)/gst
+include ../Rules
-testprogs = test1
+tests_pass =
+tests_fail = test1
-check_PROGRAMS = $(testprogs)
+test1_SOURCES = test1.c gstbstest.c
-test1_SOURCES = test1.c gstbstest.c mem.c
-test1_CFLAGS = $(GST_CFLAGS)
-test1_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/bytestream/ -lgstbytestream
-noinst_HEADERS = mem.h
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#define GST_TYPE_BSTEST (gst_bstest_get_type())
#define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest))
GstElementDetails gst_bstest_details = {
"ByteStreamTest",
"Filter",
+ "LGPL",
"Test for the GstByteStream code",
VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>," "Wim Taymans <wim.taymans@chello.be>",
+ "Erik Walthinsen <omega@temple-baptist.com>,"
+ "Wim Taymans <wim.taymans@chello.be>",
"(C) 2001",
};
}
-static GstPadLinkReturn
-gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
+static GstCaps *
+gst_bstest_getcaps (GstPad *pad, GstCaps *caps)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
+ GstPad *otherpad;
- /* thomas: I was trying to fix this old test, one of these two pads
- * needs to be dropped according to the new api, which one ? */
- return gst_pad_proxy_link (pad, bstest->sinkpad, caps);
-}
-
-static GstPadLinkReturn
-gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
-{
- GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
+ otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad;
- return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps);
+ return gst_pad_get_allowed_caps (otherpad);
}
static void
{
bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad);
- gst_pad_set_negotiate_function (bstest->sinkpad, gst_bstest_negotiate_sink);
+ gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps);
bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad);
- gst_pad_set_negotiate_function (bstest->srcpad, gst_bstest_negotiate_src);
+ gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps);
gst_element_set_loop_function (GST_ELEMENT (bstest), gst_bstest_loop);
do {
guint size = 0;
guint i = 0;
+ guint8 *ptr;
while (i < bstest->num_patterns) {
buf = NULL;
if (bstest->patterns[i][0] == 'r') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
if (!bstest->silent) g_print ("bstest: ***** read %d bytes\n", size);
- buf = gst_bytestream_read (bstest->bs, size);
+ gst_bytestream_read (bstest->bs, &buf, size);
}
else if (bstest->patterns[i][0] == 'f') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
else if (!strncmp (bstest->patterns[i], "pb", 2)) {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][2], size);
if (!bstest->silent) g_print ("bstest: ***** peek bytes %d bytes\n", size);
- gst_bytestream_peek_bytes (bstest->bs, size);
+ gst_bytestream_peek_bytes (bstest->bs, &ptr, size);
}
else if (bstest->patterns[i][0] == 'p') {
size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size);
if (!bstest->silent) g_print ("bstest: ***** peek %d bytes\n", size);
- buf = gst_bytestream_peek (bstest->bs, size);
+ gst_bytestream_peek (bstest->bs, &buf, size);
gst_buffer_unref (buf);
buf = NULL;
}
if (buf)
- gst_pad_push (bstest->srcpad, buf);
+ gst_pad_push (bstest->srcpad, GST_DATA (buf));
i++;
}
{
GstElementFactory *factory;
- /* we need gstbytestream */
- if (!gst_library_load ("gstbytestream")) {
- g_print ("can't load bytestream\n");
- return FALSE;
- }
-
/* We need to create an ElementFactory for each element we provide.
* This consists of the name of the element, the GType identifier,
* and a pointer to the details structure at the top of the file.
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-int vmsize() {
- int pid,fd,size,i,mem;
- char filename[17], buf[256], *ptr, *end;
-
- pid = getpid();
- snprintf(filename,17,"/proc/%d/stat",pid);
- fd = open(filename,O_RDONLY);
- size = read(fd,buf,240);
- ptr = buf;
- for (i=0;i<22;i++)
- ptr = (char *)strchr(ptr,' ') + 1;
- end = (char *)strchr(ptr,' ');
- *end = 0;
- sscanf(ptr,"%d",&mem);
- close(fd);
- return mem;
-}
+++ /dev/null
-int vmsize();
#include <stdlib.h>
#include <gst/gst.h>
-#include "mem.h"
#define VM_THRES 1000
#define MAX_CONFIG_LINE 255
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
while (iters) {
- gint newvm = vmsize();
+ gint newvm = gst_alloc_trace_live_all ();
gint percent;
percent = (gint)((maxiters-iters+1)*100.0/maxiters);
GSList *walk;
gint arg_walk;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
gst_init (&argc, &argv);
arg_walk = 1;
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = intersection compatibility normalisation union string-conversions fixed intersect2
-# we run gst-register here, which is a HACK to generate the test registry
-# before we actually run the real tests
-# a better fix is welcome :)
-TESTS = $(top_builddir)/tools/gst-register $(testprogs)
+tests_pass = \
+ intersection \
+ compatibility \
+ normalisation \
+ union \
+ string-conversions \
+ fixed \
+ intersect2
+
+tests_fail =
-check_PROGRAMS = $(testprogs)
intersection_LDADD = $(GST_LIBS)
-intersection_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+intersection_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
compatibility_LDADD = $(GST_LIBS)
-compatibility_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+compatibility_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
normalisation_LDADD = $(GST_LIBS)
-normalisation_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+normalisation_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
union_LDADD = $(GST_LIBS)
-union_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+union_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
string_conversions_LDADD = $(GST_LIBS)
-string_conversions_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+string_conversions_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
fixed_LDADD = $(GST_LIBS)
-fixed_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+fixed_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
intersect2_LDADD = $(GST_LIBS)
-intersect2_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+intersect2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-FAILING = cleanup3 cleanup4
-else
-FAILING =
-endif
-
-testprogs = cleanup1 cleanup2 $(FAILING) cleanup5
-
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
+tests_pass = cleanup1 cleanup2 cleanup4 cleanup5
+tests_fail = cleanup3
# we have nothing but apps here, we can do this safely
-cleanup1_LDADD = $(GST_LIBS) #-ldmallocth
+cleanup1_LDADD = $(GST_LIBS)
cleanup1_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS)
cleanup2_LDADD = $(GST_LIBS)
cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = clock1 clock2
+tests_pass = clock1 clock2
+tests_fail =
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
-#testprogs = global output commandline category
-testprogs = commandline category
+include ../Rules
-TESTS = $(testprogs)
+tests_pass = commandline category global output
+tests_fail =
-check_PROGRAMS = $(testprogs)
-
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
-testprogs = dparamstest
+include ../Rules
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
+tests_pass =
+tests_fail = dparamstest
dparamstest_CFLAGS = $(GST_CFLAGS)
-dparamstest_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/control/ -lgstcontrol
+dparamstest_LDFLAGS = $(GST_LIBS)
+dparamstest_LDADD = $(top_builddir)/libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la
dparamstest_SOURCES = dparamstest.c
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/gst.h>
#include <gst/control/control.h>
GstElementDetails gst_dptest_details = {
"DParamsTest",
"Filter",
+ "LGPL",
"Test for the GstDParam code",
VERSION,
"Steve Baker <stevebaker_org@yahoo.co.uk>",
GParamSpec * pspec);
static GstElementStateReturn gst_dptest_change_state (GstElement *element);
-static void gst_dptest_chain (GstPad *pad, GstBuffer *buf);
+static void gst_dptest_chain (GstPad *pad, GstData *buf);
static GstElementClass *parent_class = NULL;
}
static void
-gst_dptest_chain (GstPad *pad, GstBuffer *buf)
+gst_dptest_chain (GstPad *pad, GstData *data)
{
GstDpTest *dptest;
- gint i=0, frame_countdown;
+ gint frame_countdown;
dptest = GST_DPTEST(gst_pad_get_parent (pad));
g_assert(dptest);
/* we're using a made up buffer size of 64 and a timestamp of zero */
frame_countdown = GST_DPMAN_PREPROCESS(dptest->dpman, 64, 0LL);
- while(GST_DPMAN_PROCESS_COUNTDOWN(dptest->dpman, frame_countdown, i));
+ while(GST_DPMAN_PROCESS(dptest->dpman, frame_countdown));
g_print("dp chain\n");
}
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-tests_failing = fake
-else
-tests_failing =
-endif
-tests_working = name tee property
+tests_pass = name tee property fake
+tests_fail =
-TESTS = $(tests_working)
-
-check_PROGRAMS = $(tests_failing) $(tests_working)
-
-EXTRA_DIST = property.h
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+noinst_HEADERS = property.h
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = cache1 indexdump
+tests_pass = cache1 indexdump
+tests_fail =
-TESTS = $(testprogs)
-check_PROGRAMS = $(testprogs)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
+include ../Rules
-check_PROGRAMS = parse1 parse2
-
-# parse1 is broken
-TESTS = parse2
+tests_pass = parse2
+tests_fail = parse1
parse1_SOURCES = parse1.c
parse2_SOURCES = parse2.c
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
#include <gst/gst.h>
#include <string.h>
+#include <unistd.h>
/* variables used by the TEST_* macros */
static gint test = 0;
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
}G_STMT_END
#define TEST_RUN G_STMT_START{ \
+ alarm(10); \
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \
g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \
return -test; \
} \
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \
+ alarm(0); \
}G_STMT_END
#define PIPELINE1 "fakesrc"
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = yesyo data= Subbuffer\\ data"
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(top_builddir) GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
+include ../Rules
-plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la
-# FIXME : tests need fixing
-testprogs = static dynamic linked loading registry static2
+tests_pass = static dynamic static2 linked loading registry
+tests_fail =
-AM_CFLAGS = $(GST_CFLAGS)
-LIBS = $(GST_LIBS)
libtestplugin_la_SOURCES = testplugin.c
libtestplugin_la_CFLAGS = $(GST_CFLAGS)
static_SOURCES = static.c testplugin_s.c testplugin2_s.c
-check_PROGRAMS = $(testprogs)
-
-TESTS = $(top_builddir)/tools/gst-register $(testprogs)
-
-# override to _not_ install the test plugins
-install-pluginLTLIBRARIES:
-
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-if BUILD_FAILING_TESTS
-tests_failing = element bin element_pad pad
-else
-tests_failing =
-endif
-tests_working = mainloop sched
+tests_pass = bin element mainloop pad
+tests_fail = element_pad sched
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 = $(tests_working)
-
-check_PROGRAMS = $(TESTS)
-noinst_PROGRAMS = $(tests_failing)
-
EXTRA_DIST = thread.c object.c
noinst_HEADERS = mem.h
-# we have nothing but apps here, we can do this safely
-LIBS = $(GST_LIBS)
-AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CFLAGS) $(GST_CFLAGS)
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
-#include "mem.h"
static GstElement*
create_bin (void)
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
+#if 0
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
+#endif
gst_object_unref (GST_OBJECT (bin));
}
+#if 0
+/* This code is bogus */
static void
add_remove_test3 (void)
{
gst_object_unref (GST_OBJECT (bin));
}
+#endif
+#if 0
+/* This code is bogus */
static void
add_remove_test4 (void)
{
gst_object_unref (GST_OBJECT (bin));
}
+#endif
int
main (int argc, gchar *argv[])
{
GstElement *bin;
- long usage1;
+ int usage1;
gint i, iters;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
+
gst_init (&argc, &argv);
if (argc == 2)
else
iters = ITERS;
+
g_print ("starting test\n");
- usage1 = vmsize();
+
+ usage1 = gst_alloc_trace_live_all ();
+ //gst_alloc_trace_print_all ();
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
g_assert (GST_OBJECT_FLOATING (bin));
gst_object_sink (GST_OBJECT (bin));
g_assert (!GST_OBJECT_FLOATING (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/ref/sink/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/ref/sink/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
gst_object_sink (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/ref/sink/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/sink/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
g_assert (!GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
g_assert (GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1);
+#endif
+ g_print ("create/destroy/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1);
+ g_print ("create/destroy/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
- g_print ("create/ref/unref/unref new bin %ld\n", vmsize()-usage1);
+ g_print ("create/ref/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/ref/unref/unref %d bin %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/unref/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
- g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1);
+#endif
+ g_print ("craete/ref/destroy/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("craete/ref/destroy/unref/unref %d bins %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_unref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_unref (GST_OBJECT (bin));
+#if 0
gst_object_unref (GST_OBJECT (bin));
+#endif
}
- g_print ("craete/ref/destroy/unref/unref %d bins with name %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d bins with name %d\n", iters, gst_alloc_trace_live_all ()-usage1);
bin = gst_bin_new ("somebin");
for (i=0; i<iters;i++) {
gst_element_set_name (bin, "testing");
}
gst_object_unref (GST_OBJECT (bin));
- g_print ("set name %d times %ld\n", iters, vmsize()-usage1);
+ g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
bin = create_bin();
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bin with children %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d bin with children %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters/2;i++) {
bin = create_bin_ghostpads();
gst_object_unref (GST_OBJECT (bin));
}
- g_print ("create/unref %d bin with children and ghostpads %ld\n", iters/2, vmsize()-usage1);
+ g_print ("create/unref %d bin with children and ghostpads %d\n", iters/2, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
add_remove_test1();
}
- g_print ("add/remove test1 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/remove test1 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
add_remove_test2();
}
- g_print ("add/remove test2 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/remove test2 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
for (i=0; i<iters;i++) {
add_remove_test3();
}
- g_print ("add/destroy/remove test3 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/destroy/remove test3 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
add_remove_test4();
}
- g_print ("add/destroy/remove test4 %d in bin %ld\n", iters, vmsize()-usage1);
+ g_print ("add/destroy/remove test4 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+
+ g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
- g_print ("leaked: %ld\n", vmsize()-usage1);
+ //gst_alloc_trace_print_all ();
- return (vmsize()-usage1 ? -1 : 0);
+ return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}
#include <gst/gst.h>
-#define ITERS 10000
+#define ITERS 100
#include <stdlib.h>
-#include "mem.h"
int
main (int argc, gchar *argv[])
{
GstElement *element;
- long usage1;
+ int usage1;
gint i, iters;
gst_init (&argc, &argv);
iters = ITERS;
g_print ("starting test\n");
- usage1 = vmsize();
+
+ usage1 = gst_alloc_trace_live_all ();
+ //gst_alloc_trace_print_all ();
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
- g_print ("create/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("create/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (GST_OBJECT_FLOATING (element));
gst_object_sink (GST_OBJECT (element));
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/ref/sink/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/ref/sink/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
gst_object_sink (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/ref/sink/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/sink/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/destroy/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1);
+ g_print ("create/destroy/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("create/ref/unref/unref new element %ld\n", vmsize()-usage1);
+ g_print ("create/ref/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("create/ref/unref/unref %d element %ld\n", iters, vmsize()-usage1);
+ g_print ("create/ref/unref/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#if 0
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
- g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("craete/ref/destroy/unref/unref %d elements %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
- g_print ("craete/ref/destroy/unref/unref %d elements with name %ld\n", iters, vmsize()-usage1);
+ g_print ("craete/ref/destroy/unref/unref %d elements with name %d\n", iters, gst_alloc_trace_live_all ()-usage1);
+#endif
element = gst_element_factory_make ("fakesrc", NULL);
for (i=0; i<iters;i++) {
gst_element_set_name (element, "testing");
}
gst_object_unref (GST_OBJECT (element));
- g_print ("set name %d times %ld\n", iters, vmsize()-usage1);
+ g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1);
- g_print ("leaked: %ld\n", vmsize()-usage1);
+ g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
- return (vmsize()-usage1 ? -1 : 0);
+ return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
#include "mem.h"
#include <gst/gst.h>
-#define ITERS 100000
+#define ITERS 100
#include <stdlib.h>
#include "mem.h"
long usage1;
gint i, iters;
+ gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
+
gst_init (&argc, &argv);
+ g_mem_profile ();
+
if (argc == 2)
iters = atoi (argv[1]);
else
iters = ITERS;
+ //gst_alloc_trace_print_all ();
+
g_print ("starting pad test\n");
usage1 = vmsize();
}
g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize()-usage1);
+#if 0
pad = gst_pad_new ("padname", GST_PAD_SINK);
g_assert (!GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1);
+#endif
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
+#if 0
gst_object_unref (GST_OBJECT (pad));
+#endif
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1);
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
- gst_object_unref (GST_OBJECT (pad));
+ //gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters, vmsize()-usage1);
+#endif
+#if 0
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters, vmsize()-usage1);
+#endif
pad = gst_pad_new ("padname", GST_PAD_SINK);
for (i=0; i<iters;i++) {
g_print ("leaked: %ld\n", vmsize()-usage1);
+ //gst_alloc_trace_print_all ();
+
return vmsize()-usage1;
}
if (element == NULL) {
g_warning ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...", type);
- exit (0);
+ exit (1);
}
return element;
-GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
+include ../Rules
-testprogs = locked
+tests_pass = locked
+tests_fail =
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
locked_LDADD = $(GST_LIBS)
locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
-TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd)
-TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml
+include ../Rules
-testprogs = thread1 thread2 thread5
-testsfailing = threadb threadc threadd threade threadf thread4 queue thread3
+tests_pass = thread1 thread2 thread3 thread4 threadf
+tests_fail = thread5 threadb threadc threadd threade queue
-TESTS = $(testprogs)
-
-check_PROGRAMS = $(testprogs)
-
-noinst_PROGRAMS = $(testsfailing)
-
-LDADD = $(GST_LIBS)
-AM_CFLAGS = $(GST_CFLAGS)
queue_SOURCES = queue.c
queue_CFLAGS = $(AM_CFLAGS)
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
g_object_set (G_OBJECT (src), "num_buffers", 5, NULL);
- g_object_set (sink, "signal-handoff", TRUE, NULL);
+ g_object_set (sink, "signal-handoffs", TRUE, NULL);
}
void
gst_element_set_state (pipeline, GST_STATE_NULL);
}
if (TESTNUM == 5) {
- /* I don't this test is supposed to work */
+ /* I don't think this test is supposed to work */
GstElement *sink;
sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
#include <gst/gst.h>
+#include <unistd.h>
/* threadc.c
* this tests if we can make a GstThread, with enough cothreads to stress it
gulong id;
GstElement *thread;
+ alarm(10);
+
gst_init (&argc, &argv);
for (i = 0; i < runs; ++i)
#include <gst/gst.h>
+#include <unistd.h>
/* threadc.c
* this tests if we can make a GstBin and iterate it inside a GThread
int i;
GstElement *pipeline;
+ alarm(10);
+
g_thread_init (NULL);
gst_init (&argc, &argv);