tests/avtp: Plug some (more) leaks
authorEderson de Souza <ederson.desouza@intel.com>
Fri, 29 May 2020 18:36:06 +0000 (11:36 -0700)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 1 Jun 2020 18:03:19 +0000 (18:03 +0000)
Some leaks were introduced in new tests - this patch fix them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1312>

tests/check/elements/avtpcrfcheck.c
tests/check/elements/avtpcrfsync.c
tests/check/elements/avtpcrfutil.c
tests/check/elements/avtpcvfpay.c

index a967ea0..c49c161 100644 (file)
@@ -160,6 +160,8 @@ GST_START_TEST (test_properties)
   g_object_set (G_OBJECT (element), "drop-invalid", drop_invalid, NULL);
   g_object_get (G_OBJECT (element), "drop-invalid", &val, NULL);
   fail_unless (val == drop_invalid);
+
+  gst_object_unref (element);
 }
 
 GST_END_TEST;
@@ -183,6 +185,7 @@ GST_START_TEST (test_crf_cvf_data)
   test_crf_tstamps (h, buf, 218000, 119400, 2);
   test_crf_tstamps (h, buf, 218000, 102000, 2);
 
+  gst_buffer_unref (buf);
   gst_harness_teardown (h);
 }
 
@@ -206,6 +209,7 @@ GST_START_TEST (test_crf_aaf_data)
   test_crf_tstamps (h, buf, 112900, 0, 2);
   test_crf_tstamps (h, buf, 210000, 0, 2);
 
+  gst_buffer_unref (buf);
   gst_harness_teardown (h);
 }
 
@@ -227,6 +231,7 @@ GST_START_TEST (test_crf_period_zero)
 
   test_crf_tstamps (h, buf, 112, 110, 1);
 
+  gst_buffer_unref (buf);
   gst_harness_teardown (h);
 }
 
index 9f6e925..6eb06ef 100644 (file)
@@ -197,6 +197,8 @@ GST_START_TEST (test_properties)
   g_object_set (G_OBJECT (element), "streamid", streamid, NULL);
   g_object_get (G_OBJECT (element), "streamid", &val64, NULL);
   fail_unless_equals_uint64_hex (val64, streamid);
+
+  gst_object_unref (element);
 }
 
 GST_END_TEST;
@@ -221,6 +223,8 @@ GST_START_TEST (test_set_avtp_tstamp)
   res = avtp_cvf_pdu_get (&pdu, AVTP_CVF_FIELD_TIMESTAMP, &tstamp);
   fail_unless (res == 0);
   fail_unless_equals_uint64 (tstamp, 12345);
+
+  g_object_unref (avtpcrfsync);
 }
 
 GST_END_TEST;
@@ -243,6 +247,8 @@ GST_START_TEST (test_set_avtp_mr_bit)
   res = avtp_cvf_pdu_get (&pdu, AVTP_CVF_FIELD_MR, &mr_bit);
   fail_unless (res == 0);
   fail_unless_equals_uint64 (mr_bit, 1);
+
+  g_object_unref (avtpcrfsync);
 }
 
 GST_END_TEST;
index d2df4c4..a477026 100644 (file)
@@ -97,6 +97,8 @@ GST_START_TEST (test_get_avtp_tstamp)
       AVTP_SUBTYPE_TSCF);
   tstamp = get_avtp_tstamp (avtpcrfbase, &pdu);
   fail_unless_equals_uint64 (tstamp, GST_CLOCK_TIME_NONE);
+
+  g_object_unref (avtpcrfbase);
 }
 
 GST_END_TEST;
index a74c18f..11aa21e 100644 (file)
@@ -182,6 +182,7 @@ GST_START_TEST (test_payloader_spread_ts)
   for (i = 0; i < 10; i++) {
     out = gst_harness_pull (h);
     fail_unless_equals_uint64 (GST_BUFFER_DTS (out), first_tx_time);
+    gst_buffer_unref (out);
 
     first_tx_time += measurement_interval / max_interval_frames;
   }