mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-31 20:48:56 +00:00
refcounting tests sure would be nice to have
Original commit message from CVS: refcounting tests sure would be nice to have
This commit is contained in:
parent
223a929f5d
commit
4f9dad74fe
6 changed files with 72 additions and 58 deletions
|
@ -1,17 +1,23 @@
|
|||
# GstObject is no longer instantiatable in glib2
|
||||
# neither is GstElement
|
||||
testprogs = pad
|
||||
if BUILD_FAILING_TESTS
|
||||
tests_failing = element
|
||||
else
|
||||
tests_failing =
|
||||
endif
|
||||
tests_working = bin element_pad pad
|
||||
|
||||
# element_SOURCES = element.c mem.c
|
||||
element_SOURCES = element.c mem.c
|
||||
pad_SOURCES = pad.c mem.c
|
||||
# element_pad_SOURCES = element_pad.c mem.c
|
||||
# bin_SOURCES = bin.c mem.c
|
||||
|
||||
TESTS = $(testprogs)
|
||||
element_pad_SOURCES = element_pad.c mem.c
|
||||
bin_SOURCES = bin.c mem.c
|
||||
|
||||
check_PROGRAMS = $(testprogs)
|
||||
TESTS = $(tests_failing) $(tests_working)
|
||||
|
||||
EXTRA_DIST = thread.c object.c element.c element_pad.c bin.c
|
||||
check_PROGRAMS = $(TESTS)
|
||||
|
||||
EXTRA_DIST = thread.c object.c
|
||||
|
||||
noinst_HEADERS = mem.h
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
|
@ -115,18 +115,18 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_pad_disconnect (pad2, pad);
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_print ("connect/disconnect pad %ld\n", vmsize()-usage1);
|
||||
gst_pad_connect (pad, pad2);
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_pad_disconnect (pad, pad2);
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_print ("connect/disconnect pad wrong direction %ld\n", vmsize()-usage1);
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
@ -148,11 +148,11 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
||||
|
@ -160,11 +160,11 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
|
||||
|
@ -174,32 +174,32 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_destroy (GST_OBJECT (pad2));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_destroy (GST_OBJECT (pad));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
|
||||
g_print ("pad destroy effects on connect pad ok %ld\n", vmsize()-usage1);
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
# GstObject is no longer instantiatable in glib2
|
||||
# neither is GstElement
|
||||
testprogs = pad
|
||||
if BUILD_FAILING_TESTS
|
||||
tests_failing = element
|
||||
else
|
||||
tests_failing =
|
||||
endif
|
||||
tests_working = bin element_pad pad
|
||||
|
||||
# element_SOURCES = element.c mem.c
|
||||
element_SOURCES = element.c mem.c
|
||||
pad_SOURCES = pad.c mem.c
|
||||
# element_pad_SOURCES = element_pad.c mem.c
|
||||
# bin_SOURCES = bin.c mem.c
|
||||
|
||||
TESTS = $(testprogs)
|
||||
element_pad_SOURCES = element_pad.c mem.c
|
||||
bin_SOURCES = bin.c mem.c
|
||||
|
||||
check_PROGRAMS = $(testprogs)
|
||||
TESTS = $(tests_failing) $(tests_working)
|
||||
|
||||
EXTRA_DIST = thread.c object.c element.c element_pad.c bin.c
|
||||
check_PROGRAMS = $(TESTS)
|
||||
|
||||
EXTRA_DIST = thread.c object.c
|
||||
|
||||
noinst_HEADERS = mem.h
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
|
@ -115,18 +115,18 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_pad_disconnect (pad2, pad);
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_print ("connect/disconnect pad %ld\n", vmsize()-usage1);
|
||||
gst_pad_connect (pad, pad2);
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_pad_disconnect (pad, pad2);
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_print ("connect/disconnect pad wrong direction %ld\n", vmsize()-usage1);
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
@ -148,11 +148,11 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
||||
|
@ -160,11 +160,11 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
|
||||
|
@ -174,32 +174,32 @@ main (int argc, gchar *argv[])
|
|||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_destroy (GST_OBJECT (pad2));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_PAD_CONNECTED (pad));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad2 = gst_pad_new ("padname2", GST_PAD_SRC);
|
||||
|
||||
gst_pad_connect (pad2, pad);
|
||||
g_assert (GST_PAD_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_CONNECTED (pad));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad2));
|
||||
g_assert (GST_PAD_IS_CONNECTED (pad));
|
||||
|
||||
gst_object_destroy (GST_OBJECT (pad));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad2));
|
||||
g_assert (!GST_PAD_CONNECTED (pad2));
|
||||
g_assert (!GST_PAD_IS_CONNECTED (pad2));
|
||||
gst_object_unref (GST_OBJECT (pad2));
|
||||
|
||||
g_print ("pad destroy effects on connect pad ok %ld\n", vmsize()-usage1);
|
||||
|
|
Loading…
Reference in a new issue