FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_nnstreamer_ml_service_startup\\n", __LINE__, API_NAMESPACE);
#endif
g_bIsFeatureMismatched = false;
- g_bFeatureMLService = false;
- g_bFeatureML = TCTCheckSystemInfoFeatureSupported(FEATURE_ML, API_NAMESPACE);
+ g_bFeatureMLService = false;
+ g_bFeatureML = TCTCheckSystemInfoFeatureSupported(FEATURE_ML, API_NAMESPACE);
g_bFeatureMLService = TCTCheckSystemInfoFeatureSupported(FEATURE_ML_SERVICE, API_NAMESPACE);
if (g_bFeatureML && g_bFeatureMLService)
PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline", NnStreamerGetError(nRetVal));
if (0 != strcmp (g_Pipeline, get_pipeline))
{
- FPRINTF("[Line : %d][%s] Set and Get pipeline value mismatch \\n", __LINE__, API_NAMESPACE);
- g_free (get_pipeline);
- return 1;
+ FPRINTF("[Line : %d][%s] Set and Get pipeline value mismatch \\n", __LINE__, API_NAMESPACE);
+ g_free (get_pipeline);
+ return 1;
}
g_free (get_pipeline);
PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline", NnStreamerGetError(nRetVal));
if (0 != strcmp (pipeline2, get_pipeline))
{
- FPRINTF("[Line : %d][%s] Set and Get pipeline value mismatch for second key\\n", __LINE__, API_NAMESPACE);
- g_free (pipeline2);
- g_free (get_pipeline);
- return 1;
+ FPRINTF("[Line : %d][%s] Set and Get pipeline value mismatch for second key\\n", __LINE__, API_NAMESPACE);
+ g_free (pipeline2);
+ g_free (get_pipeline);
+ return 1;
}
g_free (pipeline2);
g_free (get_pipeline);
return 0;
}
+
+/*
+* @testcase ITc_nnstreamer_ml_service_launch_destroy_pipeline_p
+* @since_tizen 7.0
+* @author SRID(shobhit.v)
+* @reviewer SRID(ankit.sr1)
+* @type auto
+* @description launch and destroy pipeline
+* @scenario launch pipeline and destroy pipeline
+* @apicovered ml_service_set_pipeline, ml_service_launch_pipeline, ml_service_get_pipeline_state, ml_service_destroy, and ml_service_delete_pipeline
+* @passcase When ml_service_set_pipeline, ml_service_launch_pipeline, ml_service_get_pipeline_state, and ml_service_destroy are successful.
+* @failcase If target API fails or any precondition API fails
+* @precondition None
+* @postcondition None
+*/
+//& purpose: API to Check for launch and destroy pipeline of ml service handle
+//& type: auto
+int ITc_nnstreamer_ml_service_launch_destroy_pipeline_p(void)
+{
+ START_TEST_ML_SERVICE;
+
+ const gchar *key = "ServiceName";
+ gchar *test_pipeline = "videotestsrc ! fakesink";
+ ml_service_h service_handle = NULL;
+
+ /* set simple pipeline */
+ int nRetVal = ml_service_set_pipeline(key, test_pipeline);
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_set_pipeline", NnStreamerGetError(nRetVal));
+
+ /* launch the pipeline and check the state */
+ nRetVal = ml_service_launch_pipeline(key, &service_handle);
+ ML_SERVICE_FEATURE_CHECK;
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_launch_pipeline", NnStreamerGetError(nRetVal));
+ if (service_handle == NULL)
+ {
+ FPRINTF("[Line : %d][%s] service handle value remains NULL\\n", __LINE__, API_NAMESPACE);
+ ml_service_destroy(service_handle);
+ ml_service_delete_pipeline(key);
+ return 1;
+ }
+
+ nRetVal = ml_service_get_pipeline_state(service_handle, &state);
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline_state", NnStreamerGetError(nRetVal));
+ if (state != ML_PIPELINE_STATE_PAUSED)
+ {
+ FPRINTF("[Line : %d][%s] state value mismatch for service handle\\n", __LINE__, API_NAMESPACE);
+ ml_service_destroy(service_handle);
+ ml_service_delete_pipeline(key);
+ return 1;
+ }
+
+ /*destroy the pipeline*/
+ nRetVal = ml_service_destroy(service_handle);
+ ML_SERVICE_FEATURE_CHECK;
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_destroy", NnStreamerGetError(nRetVal));
+
+ /* delete finished service */
+ nRetVal = ml_service_delete_pipeline(key);
+ PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRetVal, "ml_service_delete_pipeline", NnStreamerGetError(nRetVal));
+ return 0;
+}
+
+/*
+* @testcase ITc_nnstreamer_ml_service_start_stop_pipeline_p
+* @since_tizen 7.0
+* @author SRID(shobhit.v)
+* @reviewer SRID(ankit.sr1)
+* @type auto
+* @description start and stop pipeline of launched ml service handle
+* @scenario start pipeline and stop pipeline
+* @apicovered ml_service_set_pipeline, ml_service_launch_pipeline, ml_service_get_pipeline_state, ml_service_destroy, and ml_service_delete_pipeline
+* @passcase When ml_service_set_pipeline, ml_service_launch_pipeline, ml_service_get_pipeline_state, ml_service_start_pipeline, ml_service_stop_pipeline, and ml_service_destroy are successful.
+* @failcase If target API fails or any precondition API fails
+* @precondition None
+* @postcondition None
+*/
+//& purpose: API to Check for start and stop pipeline feature in launched ml service handle
+//& type: auto
+int ITc_nnstreamer_ml_service_start_stop_pipeline_p(void)
+{
+ START_TEST_ML_SERVICE;
+
+ const gchar *key = "ServiceName";
+ gchar *test_pipeline = "videotestsrc ! fakesink";
+ ml_service_h service_handle = NULL;
+
+ /* set simple pipeline */
+ int nRetVal = ml_service_set_pipeline(key, test_pipeline);
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_set_pipeline", NnStreamerGetError(nRetVal));
+
+ /* launch the pipeline and check the state */
+ nRetVal = ml_service_launch_pipeline(key, &service_handle);
+ PRINT_RESULT(ML_ERROR_NONE, nRetVal, "ml_service_launch_pipeline", NnStreamerGetError(nRetVal));
+ if (service_handle == NULL)
+ {
+ FPRINTF("[Line : %d][%s] service handle value remains NULL\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ nRetVal = ml_service_get_pipeline_state(service_handle, &state);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline_state", NnStreamerGetError(nRetVal), ml_service_start_pipeline(service_handle); ml_service_stop_pipeline(service_handle); ml_service_destroy(service_handle); ml_service_delete_pipeline(key));
+ if (state != ML_PIPELINE_STATE_PAUSED)
+ {
+ FPRINTF("[Line : %d][%s] state value mismatch for service handle\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ /* start the pipeline and check the state */
+ nRetVal = ml_service_start_pipeline(service_handle);
+ ML_SERVICE_FEATURE_CHECK;
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRetVal, "ml_service_start_pipeline", NnStreamerGetError(nRetVal), ml_service_stop_pipeline(service_handle); ml_service_destroy(service_handle); ml_service_delete_pipeline(key));
+
+ nRetVal = ml_service_get_pipeline_state(service_handle, &state);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline_state", NnStreamerGetError(nRetVal), ml_service_stop_pipeline(service_handle); ml_service_destroy(service_handle); ml_service_delete_pipeline(key));
+ if (state != ML_PIPELINE_STATE_PLAYING)
+ {
+ FPRINTF("[Line : %d][%s] state value mismatch for service handle\\n", __LINE__, API_NAMESPACE);
+ ml_service_stop_pipeline(service_handle);
+ ml_service_destroy(service_handle);
+ ml_service_delete_pipeline(key);
+ return 1;
+ }
+
+ /* stop the pipeline and check the state */
+ nRetVal = ml_service_stop_pipeline(service_handle);
+ ML_SERVICE_FEATURE_CHECK;
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRetVal, "ml_service_stop_pipeline", NnStreamerGetError(nRetVal), ml_service_destroy(service_handle); ml_service_delete_pipeline(key));
+
+ nRetVal = ml_service_get_pipeline_state(service_handle, &state);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRetVal, "ml_service_get_pipeline_state", NnStreamerGetError(nRetVal), ml_service_destroy(service_handle); ml_service_delete_pipeline(key));
+ if (state != ML_PIPELINE_STATE_PAUSED)
+ {
+ FPRINTF("[Line : %d][%s] state value mismatch for service handle\\n", __LINE__, API_NAMESPACE);
+ ml_service_destroy(service_handle);
+ ml_service_delete_pipeline(key);
+ return 1;
+ }
+
+ /*destroy the pipeline*/
+ nRetVal = ml_service_destroy(service_handle);
+ PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRetVal, "ml_service_destroy", NnStreamerGetError(nRetVal));
+
+ /* delete finished service */
+ nRetVal = ml_service_delete_pipeline(key);
+ PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRetVal, "ml_service_delete_pipeline", NnStreamerGetError(nRetVal));
+ return 0;
+}