Massive patch to make 'make check' work properly. Many compilation fixes -- everything should compile now. Some tes...

Original commit message from CVS:
Massive patch to make 'make check' work properly.  Many compilation
fixes -- everything should compile now.  Some tests pass, some
fail; the expected sucess/failure is coded in the Makefile.am's.
gst-register is properly run for both 'make check' and 'make distcheck'.
Much of the common infrastructure is coded in testsuite/Rules.
This commit is contained in:
David Schleef 2003-10-15 01:25:41 +00:00
parent dcb2dce108
commit 9c87c528e7
58 changed files with 478 additions and 534 deletions

View file

@ -1,3 +1,6 @@
include Rules
if GST_DISABLE_PARSE
GST_PARSE_DIRS =
else
@ -10,35 +13,18 @@ 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)
check_PROGRAMS = $(testprogs)
# we have nothing but apps here, we can do this safely
LIBS = $(GST_LIBS)
AM_CFLAGS = $(GST_CFLAGS)
# we makes them, we gots to clean them
CLEANFILES = test-registry.xml
SUBDIRS = bytestream cleanup dynparams \
caps plugin elements clock refcounting threads \
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
plugin refcounting threads parse debug
tests_pass = test_gst_init
tests_fail =
# we makes them, we gots to clean them
CLEANFILES += test-registry.xml
EXTRA_DIST = gst-inspect-check

24
tests/old/testsuite/Rules Normal file
View file

@ -0,0 +1,24 @@
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.*

View file

@ -1,11 +1,8 @@
## 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

View file

@ -20,11 +20,14 @@
* 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))
@ -64,9 +67,11 @@ GType gst_bstest_get_type (void);
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",
};
@ -160,22 +165,15 @@ gst_bstest_class_init (GstBsTestClass * klass)
}
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);
}
otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad;
static GstPadLinkReturn
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps);
return gst_pad_get_allowed_caps (otherpad);
}
static void
@ -183,11 +181,11 @@ gst_bstest_init (GstBsTest * bstest)
{
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);
@ -237,6 +235,7 @@ gst_bstest_loop (GstElement * element)
do {
guint size = 0;
guint i = 0;
guint8 *ptr;
while (i < bstest->num_patterns) {
buf = NULL;
@ -244,7 +243,7 @@ gst_bstest_loop (GstElement * element)
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);
@ -254,18 +253,18 @@ gst_bstest_loop (GstElement * element)
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++;
}
@ -385,12 +384,6 @@ plugin_init (GModule * module, GstPlugin * plugin)
{
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.

View file

@ -1,23 +0,0 @@
#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;
}

View file

@ -1 +0,0 @@
int vmsize();

View file

@ -2,7 +2,6 @@
#include <stdlib.h>
#include <gst/gst.h>
#include "mem.h"
#define VM_THRES 1000
#define MAX_CONFIG_LINE 255
@ -112,7 +111,7 @@ run_test (GstBin *pipeline, gint iters)
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);
@ -146,6 +145,7 @@ main (int argc, char *argv[])
GSList *walk;
gint arg_walk;
gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
gst_init (&argc, &argv);
arg_walk = 1;

View file

@ -1,27 +1,30 @@
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)

View file

@ -1,20 +1,10 @@
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)

View file

@ -1,12 +1,6 @@
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)

View file

@ -1,10 +1,5 @@
#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)

View file

@ -1,10 +1,10 @@
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

View file

@ -21,6 +21,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/control/control.h>
@ -59,6 +62,7 @@ GType gst_dptest_get_type (void);
GstElementDetails gst_dptest_details = {
"DParamsTest",
"Filter",
"LGPL",
"Test for the GstDParam code",
VERSION,
"Steve Baker <stevebaker_org@yahoo.co.uk>",
@ -78,7 +82,7 @@ static void gst_dptest_set_property (GObject * object, guint prop_id, const GVal
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;
@ -178,10 +182,10 @@ gst_dptest_change_state (GstElement *element)
}
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);
@ -189,7 +193,7 @@ gst_dptest_chain (GstPad *pad, GstBuffer *buf)
/* 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");
}

View file

@ -1,18 +1,7 @@
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

View file

@ -1,11 +1,6 @@
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)

View file

@ -1,12 +1,8 @@
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)

View file

@ -21,6 +21,7 @@
#include <gst/gst.h>
#include <string.h>
#include <unistd.h>
/* variables used by the TEST_* macros */
static gint test = 0;
@ -58,6 +59,7 @@ static gchar *s;
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__); \
@ -70,6 +72,7 @@ static gchar *s;
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"

View file

@ -1,13 +1,10 @@
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)
@ -20,10 +17,3 @@ linked_LIBS = libtestplugin.la libtestplugin2.la
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:

View file

@ -1,29 +1,15 @@
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)

View file

@ -1,8 +1,7 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"
static GstElement*
create_bin (void)
@ -73,12 +72,16 @@ add_remove_test2 (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)
{
@ -97,7 +100,10 @@ add_remove_test3 (void)
gst_object_unref (GST_OBJECT (bin));
}
#endif
#if 0
/* This code is bogus */
static void
add_remove_test4 (void)
{
@ -123,14 +129,17 @@ 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)
@ -138,18 +147,21 @@ main (int argc, gchar *argv[])
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));
@ -157,7 +169,7 @@ main (int argc, gchar *argv[])
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++) {
@ -166,27 +178,31 @@ main (int argc, gchar *argv[])
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");
@ -194,23 +210,27 @@ main (int argc, gchar *argv[])
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");
@ -219,50 +239,58 @@ main (int argc, gchar *argv[])
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: %ld\n", vmsize()-usage1);
g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
return (vmsize()-usage1 ? -1 : 0);
//gst_alloc_trace_print_all ();
return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}

View file

@ -1,14 +1,13 @@
#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);
@ -19,17 +18,19 @@ main (int argc, gchar *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));
@ -37,7 +38,7 @@ main (int argc, gchar *argv[])
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++) {
@ -46,27 +47,31 @@ main (int argc, gchar *argv[])
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);
@ -74,15 +79,18 @@ main (int argc, gchar *argv[])
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));
@ -90,8 +98,10 @@ main (int argc, gchar *argv[])
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));
@ -101,16 +111,17 @@ main (int argc, gchar *argv[])
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);
}

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"
@ -12,13 +12,19 @@ main (int argc, gchar *argv[])
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();
@ -48,19 +54,23 @@ main (int argc, gchar *argv[])
}
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));
@ -80,18 +90,23 @@ main (int argc, gchar *argv[])
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));
@ -102,6 +117,7 @@ main (int argc, gchar *argv[])
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++) {
@ -125,5 +141,7 @@ main (int argc, gchar *argv[])
g_print ("leaked: %ld\n", vmsize()-usage1);
//gst_alloc_trace_print_all ();
return vmsize()-usage1;
}

View file

@ -11,7 +11,7 @@ make_and_check_element (gchar *type, gchar *name)
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;

View file

@ -1,11 +1,8 @@
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)

View file

@ -1,17 +1,8 @@
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)

View file

@ -35,7 +35,7 @@ construct_pipeline (GstElement *pipeline)
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
@ -106,7 +106,7 @@ main (gint argc, gchar *argv[])
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");

View file

@ -1,4 +1,5 @@
#include <gst/gst.h>
#include <unistd.h>
/* threadc.c
* this tests if we can make a GstThread, with enough cothreads to stress it
@ -59,6 +60,8 @@ main (gint argc, gchar *argv[])
gulong id;
GstElement *thread;
alarm(10);
gst_init (&argc, &argv);
for (i = 0; i < runs; ++i)

View file

@ -1,4 +1,5 @@
#include <gst/gst.h>
#include <unistd.h>
/* threadc.c
* this tests if we can make a GstBin and iterate it inside a GThread
@ -54,6 +55,8 @@ main (gint argc, gchar *argv[])
int i;
GstElement *pipeline;
alarm(10);
g_thread_init (NULL);
gst_init (&argc, &argv);

View file

@ -1,3 +1,6 @@
include Rules
if GST_DISABLE_PARSE
GST_PARSE_DIRS =
else
@ -10,35 +13,18 @@ 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)
check_PROGRAMS = $(testprogs)
# we have nothing but apps here, we can do this safely
LIBS = $(GST_LIBS)
AM_CFLAGS = $(GST_CFLAGS)
# we makes them, we gots to clean them
CLEANFILES = test-registry.xml
SUBDIRS = bytestream cleanup dynparams \
caps plugin elements clock refcounting threads \
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \
plugin refcounting threads parse debug
tests_pass = test_gst_init
tests_fail =
# we makes them, we gots to clean them
CLEANFILES += test-registry.xml
EXTRA_DIST = gst-inspect-check

24
testsuite/Rules Normal file
View file

@ -0,0 +1,24 @@
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.*

View file

@ -1,11 +1,8 @@
## 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

View file

@ -20,11 +20,14 @@
* 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))
@ -64,9 +67,11 @@ GType gst_bstest_get_type (void);
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",
};
@ -160,22 +165,15 @@ gst_bstest_class_init (GstBsTestClass * klass)
}
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);
}
otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad;
static GstPadLinkReturn
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps);
return gst_pad_get_allowed_caps (otherpad);
}
static void
@ -183,11 +181,11 @@ gst_bstest_init (GstBsTest * bstest)
{
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);
@ -237,6 +235,7 @@ gst_bstest_loop (GstElement * element)
do {
guint size = 0;
guint i = 0;
guint8 *ptr;
while (i < bstest->num_patterns) {
buf = NULL;
@ -244,7 +243,7 @@ gst_bstest_loop (GstElement * element)
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);
@ -254,18 +253,18 @@ gst_bstest_loop (GstElement * element)
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++;
}
@ -385,12 +384,6 @@ plugin_init (GModule * module, GstPlugin * plugin)
{
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.

View file

@ -1,23 +0,0 @@
#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;
}

View file

@ -1 +0,0 @@
int vmsize();

View file

@ -2,7 +2,6 @@
#include <stdlib.h>
#include <gst/gst.h>
#include "mem.h"
#define VM_THRES 1000
#define MAX_CONFIG_LINE 255
@ -112,7 +111,7 @@ run_test (GstBin *pipeline, gint iters)
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);
@ -146,6 +145,7 @@ main (int argc, char *argv[])
GSList *walk;
gint arg_walk;
gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
gst_init (&argc, &argv);
arg_walk = 1;

View file

@ -1,27 +1,30 @@
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)

View file

@ -1,20 +1,10 @@
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)

View file

@ -1,12 +1,6 @@
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)

View file

@ -1,10 +1,5 @@
#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)

View file

@ -1,10 +1,10 @@
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

View file

@ -21,6 +21,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/control/control.h>
@ -59,6 +62,7 @@ GType gst_dptest_get_type (void);
GstElementDetails gst_dptest_details = {
"DParamsTest",
"Filter",
"LGPL",
"Test for the GstDParam code",
VERSION,
"Steve Baker <stevebaker_org@yahoo.co.uk>",
@ -78,7 +82,7 @@ static void gst_dptest_set_property (GObject * object, guint prop_id, const GVal
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;
@ -178,10 +182,10 @@ gst_dptest_change_state (GstElement *element)
}
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);
@ -189,7 +193,7 @@ gst_dptest_chain (GstPad *pad, GstBuffer *buf)
/* 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");
}

View file

@ -1,18 +1,7 @@
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

View file

@ -1,11 +1,6 @@
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)

View file

@ -1,12 +1,8 @@
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)

View file

@ -21,6 +21,7 @@
#include <gst/gst.h>
#include <string.h>
#include <unistd.h>
/* variables used by the TEST_* macros */
static gint test = 0;
@ -58,6 +59,7 @@ static gchar *s;
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__); \
@ -70,6 +72,7 @@ static gchar *s;
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"

View file

@ -1,13 +1,10 @@
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)
@ -20,10 +17,3 @@ linked_LIBS = libtestplugin.la libtestplugin2.la
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:

View file

@ -1,29 +1,15 @@
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)

View file

@ -1,8 +1,7 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"
static GstElement*
create_bin (void)
@ -73,12 +72,16 @@ add_remove_test2 (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)
{
@ -97,7 +100,10 @@ add_remove_test3 (void)
gst_object_unref (GST_OBJECT (bin));
}
#endif
#if 0
/* This code is bogus */
static void
add_remove_test4 (void)
{
@ -123,14 +129,17 @@ 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)
@ -138,18 +147,21 @@ main (int argc, gchar *argv[])
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));
@ -157,7 +169,7 @@ main (int argc, gchar *argv[])
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++) {
@ -166,27 +178,31 @@ main (int argc, gchar *argv[])
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");
@ -194,23 +210,27 @@ main (int argc, gchar *argv[])
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");
@ -219,50 +239,58 @@ main (int argc, gchar *argv[])
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: %ld\n", vmsize()-usage1);
g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1);
return (vmsize()-usage1 ? -1 : 0);
//gst_alloc_trace_print_all ();
return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0);
}

View file

@ -1,14 +1,13 @@
#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);
@ -19,17 +18,19 @@ main (int argc, gchar *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));
@ -37,7 +38,7 @@ main (int argc, gchar *argv[])
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++) {
@ -46,27 +47,31 @@ main (int argc, gchar *argv[])
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);
@ -74,15 +79,18 @@ main (int argc, gchar *argv[])
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));
@ -90,8 +98,10 @@ main (int argc, gchar *argv[])
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));
@ -101,16 +111,17 @@ main (int argc, gchar *argv[])
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);
}

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
#define ITERS 100000
#define ITERS 100
#include <stdlib.h>
#include "mem.h"
@ -12,13 +12,19 @@ main (int argc, gchar *argv[])
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();
@ -48,19 +54,23 @@ main (int argc, gchar *argv[])
}
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));
@ -80,18 +90,23 @@ main (int argc, gchar *argv[])
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));
@ -102,6 +117,7 @@ main (int argc, gchar *argv[])
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++) {
@ -125,5 +141,7 @@ main (int argc, gchar *argv[])
g_print ("leaked: %ld\n", vmsize()-usage1);
//gst_alloc_trace_print_all ();
return vmsize()-usage1;
}

View file

@ -11,7 +11,7 @@ make_and_check_element (gchar *type, gchar *name)
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;

View file

@ -1,11 +1,8 @@
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)

View file

@ -1,17 +1,8 @@
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)

View file

@ -35,7 +35,7 @@ construct_pipeline (GstElement *pipeline)
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
@ -106,7 +106,7 @@ main (gint argc, gchar *argv[])
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");

View file

@ -1,4 +1,5 @@
#include <gst/gst.h>
#include <unistd.h>
/* threadc.c
* this tests if we can make a GstThread, with enough cothreads to stress it
@ -59,6 +60,8 @@ main (gint argc, gchar *argv[])
gulong id;
GstElement *thread;
alarm(10);
gst_init (&argc, &argv);
for (i = 0; i < runs; ++i)

View file

@ -1,4 +1,5 @@
#include <gst/gst.h>
#include <unistd.h>
/* threadc.c
* this tests if we can make a GstBin and iterate it inside a GThread
@ -54,6 +55,8 @@ main (gint argc, gchar *argv[])
int i;
GstElement *pipeline;
alarm(10);
g_thread_init (NULL);
gst_init (&argc, &argv);