guint received; /**< received buffer count */
guint mem_blocks; /**< memory blocks in received buffer */
gsize received_size; /**< received buffer size */
- gboolean start; /**< stream started */
- gboolean end; /**< eos reached */
+ gboolean invalid_timestamp; /**< flag to check timestamp */
+ gboolean test_failed; /**< flag to indicate error */
+ gboolean start; /**< stream started (for tensor_sink signal) */
+ gboolean end; /**< eos reached (for tensor_sink signal) */
gchar *caps_name; /**< negotiated caps name */
GstTensorConfig tensor_config; /**< tensor config from negotiated caps */
GstTensorsConfig tensors_config; /**< tensors config from negotiated caps */
gst_object_unref (g_test_data.pipeline);
g_test_data.pipeline = NULL;
}
+
+ g_free (g_test_data.caps_name);
}
/**
case GST_MESSAGE_WARNING:
_print_log ("received error message");
g_test_data.status = TEST_ERR_MESSAGE;
+ g_test_data.test_failed = TRUE;
g_main_loop_quit (g_test_data.loop);
break;
if (g_test_data.mem_blocks != mem_blocks) {
_print_log ("invalid memory, old[%d] new[%d]", g_test_data.mem_blocks,
mem_blocks);
- g_assert (0);
+ g_test_data.test_failed = TRUE;
}
if (g_test_data.received_size != buf_size) {
_print_log ("invalid size, old[%zd] new[%zd]", g_test_data.received_size,
buf_size);
- g_assert (0);
+ g_test_data.test_failed = TRUE;
}
}
_print_log ("dts %" GST_TIME_FORMAT, GST_TIME_ARGS (dts));
}
+ /** check timestamp */
+ if (!GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS_OR_PTS (buffer))) {
+ g_test_data.invalid_timestamp = TRUE;
+ }
+
if (g_test_data.caps_name == NULL) {
GstPad *sink_pad;
GstCaps *caps;
caps = gst_pad_get_current_caps (sink_pad);
structure = gst_caps_get_structure (caps, 0);
- g_test_data.caps_name = (gchar *) gst_structure_get_name (structure);
+ g_test_data.caps_name = g_strdup (gst_structure_get_name (structure));
_print_log ("caps name [%s]", g_test_data.caps_name);
if (g_str_equal (g_test_data.caps_name, "other/tensor")) {
if (!gst_tensor_config_from_structure (&g_test_data.tensor_config,
structure)) {
_print_log ("failed to get tensor config from caps");
- g_assert (0);
+ g_test_data.test_failed = TRUE;
}
} else if (g_str_equal (g_test_data.caps_name, "other/tensors")) {
if (!gst_tensors_config_from_structure (&g_test_data.tensors_config,
structure)) {
_print_log ("failed to get tensors config from caps");
- g_assert (0);
+ g_test_data.test_failed = TRUE;
}
}
if (gst_app_src_push_buffer (GST_APP_SRC (appsrc), buf) != GST_FLOW_OK) {
_print_log ("failed to push buffer [%d]", i);
- failed = TRUE;
+ g_test_data.test_failed = failed = TRUE;
goto error;
}
}
if (gst_app_src_end_of_stream (GST_APP_SRC (appsrc)) != GST_FLOW_OK) {
_print_log ("failed to set eos");
- failed = TRUE;
+ g_test_data.test_failed = failed = TRUE;
goto error;
}
g_test_data.received = 0;
g_test_data.mem_blocks = 0;
g_test_data.received_size = 0;
+ g_test_data.invalid_timestamp = FALSE;
+ g_test_data.test_failed = FALSE;
g_test_data.start = FALSE;
g_test_data.end = FALSE;
g_test_data.caps_name = NULL;
("appsrc name=appsrc caps=text/x-raw,format=utf8 ! "
"tensor_converter frames-per-tensor=3 ! tensor_sink name=test_sink");
break;
- break;
case TEST_TYPE_TENSORS:
/** other/tensors with tensor_mux */
str_pipeline =
return TRUE;
error:
+ g_test_data.test_failed = TRUE;
_free_test_data ();
return FALSE;
}
g_object_get (g_test_data.sink, "qos", &res_qos, NULL);
EXPECT_EQ (res_qos, !qos);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check caps and config for tensor */
{
GstCaps *caps;
gst_caps_unref (caps);
}
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check caps and config for tensor */
{
GstCaps *caps;
gst_caps_unref (caps);
}
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check received buffers */
EXPECT_EQ (g_test_data.received, 0);
+ EXPECT_TRUE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensors"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensors config for video */
EXPECT_TRUE (gst_tensors_config_validate (&g_test_data.tensors_config));
EXPECT_EQ (g_test_data.tensors_config.info.num_tensors, 2);
gst_caps_unref (caps);
}
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_INT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_INT16);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT16);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
- EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_INT8);
+ EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.info.dimension[0],
GST_TENSOR_STRING_SIZE);
EXPECT_EQ (g_test_data.tensor_config.info.dimension[1], 1);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
- EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_INT8);
+ EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.info.dimension[0],
GST_TENSOR_STRING_SIZE);
EXPECT_EQ (g_test_data.tensor_config.info.dimension[1], 3);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
gst_caps_unref (caps);
}
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensors"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensors config for video */
EXPECT_TRUE (gst_tensors_config_validate (&g_test_data.tensors_config));
EXPECT_EQ (g_test_data.tensors_config.info.num_tensors, 3);
gst_caps_unref (caps);
}
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for text */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, t_type);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 0);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for video */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT8);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 30);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_INT16);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}
/** check caps name */
EXPECT_TRUE (g_str_equal (g_test_data.caps_name, "other/tensor"));
+ /** check timestamp */
+ EXPECT_FALSE (g_test_data.invalid_timestamp);
+
/** check tensor config for audio */
EXPECT_TRUE (gst_tensor_config_validate (&g_test_data.tensor_config));
EXPECT_EQ (g_test_data.tensor_config.info.type, _NNS_UINT16);
EXPECT_EQ (g_test_data.tensor_config.rate_n, 16000);
EXPECT_EQ (g_test_data.tensor_config.rate_d, 1);
+ EXPECT_FALSE (g_test_data.test_failed);
_free_test_data ();
}