Commit 4f9dad74 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

refcounting tests sure would be nice to have

Original commit message from CVS:
refcounting tests sure would be nice to have
parent 223a929f
# 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
......
#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);
......
# 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
......
#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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment