[test] Fix unittest_sink with recent change in GstTensorsInfo
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Thu, 9 Feb 2023 12:38:32 +0000 (21:38 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 17 Apr 2023 07:15:16 +0000 (16:15 +0900)
- Add init and free of tensors_info in the callback

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
tests/nnstreamer_sink/unittest_sink.cc

index 395c817..c23d794 100644 (file)
@@ -6431,6 +6431,8 @@ _manual_extra_tensors_new_data_cb (GstElement *element, GstBuffer *buffer, gpoin
   gint *output, i;
   gboolean ret;
   GstTensorsInfo ts_info;
+
+  gst_tensors_info_init (&ts_info);
   ts_info.num_tensors = 20;
 
   data_received++;
@@ -6443,10 +6445,12 @@ _manual_extra_tensors_new_data_cb (GstElement *element, GstBuffer *buffer, gpoin
     gst_memory_unmap (mem_res, &info_res);
     gst_memory_unref (mem_res);
   }
+
+  gst_tensors_info_free (&ts_info);
 }
 
 /**
- * @brief TBU
+ * @brief Test for extra tensors which are created with gst_tensors_extra_append_memory_to_buffer API.
  */
 TEST (extraTensors, manualextratensors)
 {