tests/check/elements/: Fix the dp tests, but activating the pads for the streamheader...
authorStefan Kost <ensonic@users.sourceforge.net>
Fri, 22 Dec 2006 12:10:18 +0000 (12:10 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 11 Sep 2012 00:54:31 +0000 (01:54 +0100)
Original commit message from CVS:
* tests/check/elements/gdpdepay.c: (cleanup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (cleanup_gdppay),
(setup_gdppay_streamheader):
Fix the dp tests, but activating the pads for the streamheader tests
too and cleaning up conditionaly

tests/check/elements/gdpdepay.c
tests/check/elements/gdppay.c

index 5857c2e..119f1cd 100644 (file)
@@ -84,10 +84,15 @@ cleanup_gdpdepay (GstElement * gdpdepay)
   GST_DEBUG ("cleanup_gdpdepay");
 
   gst_pad_set_active (mysrcpad, FALSE);
-  gst_pad_set_active (mysinkpad, FALSE);
+  if (mysinkpad)
+    gst_pad_set_active (mysinkpad, FALSE);
+  if (myshsinkpad)
+    gst_pad_set_active (myshsinkpad, FALSE);
   gst_check_teardown_src_pad (gdpdepay);
   gst_check_teardown_sink_pad (gdpdepay);
   gst_check_teardown_element (gdpdepay);
+  mysinkpad = NULL;
+  myshsinkpad = NULL;
 }
 
 static void
@@ -270,6 +275,8 @@ setup_gdpdepay_streamheader ()
   gdpdepay = gst_check_setup_element ("gdpdepay");
   mysrcpad = gst_check_setup_src_pad (gdpdepay, &srctemplate, NULL);
   myshsinkpad = gst_check_setup_sink_pad (gdpdepay, &shsinktemplate, NULL);
+  gst_pad_set_active (mysrcpad, TRUE);
+  gst_pad_set_active (myshsinkpad, TRUE);
 
   return gdpdepay;
 }
index a554d31..80f386f 100644 (file)
@@ -82,11 +82,16 @@ cleanup_gdppay (GstElement * gdppay)
 {
   GST_DEBUG ("cleanup_gdppay");
 
-  gst_pad_set_active (mysrcpad, FALSE);
+  if (mysrcpad)
+    gst_pad_set_active (mysrcpad, FALSE);
+  if (myshsrcpad)
+    gst_pad_set_active (myshsrcpad, FALSE);
   gst_pad_set_active (mysinkpad, FALSE);
   gst_check_teardown_src_pad (gdppay);
   gst_check_teardown_sink_pad (gdppay);
   gst_check_teardown_element (gdppay);
+  mysrcpad = NULL;
+  myshsrcpad = NULL;
 }
 
 GST_START_TEST (test_audio)
@@ -220,6 +225,8 @@ setup_gdppay_streamheader ()
   gdppay = gst_check_setup_element ("gdppay");
   myshsrcpad = gst_check_setup_src_pad (gdppay, &shsrctemplate, NULL);
   mysinkpad = gst_check_setup_sink_pad (gdppay, &sinktemplate, NULL);
+  gst_pad_set_active (myshsrcpad, TRUE);
+  gst_pad_set_active (mysinkpad, TRUE);
 
   return gdppay;
 }