Skip to content

Commit

Permalink
[test] Fix pipeline for gst_parse_lanch
Browse files Browse the repository at this point in the history
- Remove erroneous "gst-launch-1.0" string in pipeline description.

Signed-off-by: Yongjoo Ahn <[email protected]>
  • Loading branch information
anyj0527 authored and jaeyun-jung committed Nov 5, 2024
1 parent 2100c36 commit 20e7867
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/nnstreamer_datarepo/unittest_datareposink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ create_image_test_file ()

loop = g_main_loop_new (NULL, FALSE);

gchar *str_pipeline = g_strdup ("gst-launch-1.0 videotestsrc num-buffers=5 ! pngenc ! "
gchar *str_pipeline = g_strdup ("videotestsrc num-buffers=5 ! pngenc ! "
"datareposink location=img_%02d.png json=img.json");

GstElement *pipeline = gst_parse_launch (str_pipeline, NULL);
Expand Down
22 changes: 11 additions & 11 deletions tests/nnstreamer_edge/edge/unittest_edge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST (edgeSink, properties0)
gchar *str_val;

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf ("gst-launch-1.0 videotestsrc ! videoconvert ! videoscale ! "
pipeline = g_strdup_printf ("videotestsrc ! videoconvert ! videoscale ! "
"video/x-raw,width=320,height=240,format=RGB,framerate=10/1 ! "
"tensor_converter ! edgesink name=sinkx port=0");
gstpipe = gst_parse_launch (pipeline, NULL);
Expand Down Expand Up @@ -83,7 +83,7 @@ TEST (edgeSink, properties2_n)

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf (
"gst-launch-1.0 videotestsrc ! videoconvert ! videoscale ! "
"videotestsrc ! videoconvert ! videoscale ! "
"video/x-raw,width=320,height=240,format=RGB,framerate=10/1 ! "
"tensor_converter ! edgesink host=f.a.i.l name=sinkx port=0");
gstpipe = gst_parse_launch (pipeline, NULL);
Expand All @@ -108,7 +108,7 @@ TEST (edgeSrc, properties0)
gchar *str_val;

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc name=srcx ! "
pipeline = g_strdup_printf ("edgesrc name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink");
gstpipe = gst_parse_launch (pipeline, NULL);
Expand Down Expand Up @@ -150,7 +150,7 @@ TEST (edgeSrc, properties2_n)
GstElement *gstpipe;

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc host=f.a.i.l port=0 name=srcx ! "
pipeline = g_strdup_printf ("edgesrc host=f.a.i.l port=0 name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink");
gstpipe = gst_parse_launch (pipeline, NULL);
Expand Down Expand Up @@ -223,7 +223,7 @@ TEST (edgeSinkSrc, runNormal)
appsrc_handle = gst_bin_get_by_name (GST_BIN (sink_gstpipe), "appsrc");
EXPECT_NE (appsrc_handle, nullptr);

src_pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc dest-port=%u name=srcx ! "
src_pipeline = g_strdup_printf ("edgesrc dest-port=%u name=srcx ! "
"other/tensor,dimension=(string)3:4:2:2,type=(string)int32,framerate=(fraction)0/1 ! "
"tensor_sink name=sinkx async=false",
port);
Expand Down Expand Up @@ -279,7 +279,7 @@ TEST (edgeCustom, sinkNormal)

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf (
"gst-launch-1.0 videotestsrc ! videoconvert ! videoscale ! "
"videotestsrc ! videoconvert ! videoscale ! "
"video/x-raw,width=320,height=240,format=RGB,framerate=10/1 ! "
"tensor_converter ! edgesink connect-type=CUSTOM custom-lib=%s name=sinkx port=0",
CUSTOM_LIB_PATH);
Expand All @@ -306,7 +306,7 @@ TEST (edgeCustom, sinkInvalidProp_n)

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf (
"gst-launch-1.0 videotestsrc ! videoconvert ! videoscale ! "
"videotestsrc ! videoconvert ! videoscale ! "
"video/x-raw,width=320,height=240,format=RGB,framerate=10/1 ! "
"tensor_converter ! edgesink connect-type=CUSTOM name=sinkx port=0");
gstpipe = gst_parse_launch (pipeline, nullptr);
Expand All @@ -329,7 +329,7 @@ TEST (edgeCustom, sinkInvalidProp2_n)

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf (
"gst-launch-1.0 videotestsrc ! videoconvert ! videoscale ! "
"videotestsrc ! videoconvert ! videoscale ! "
"video/x-raw,width=320,height=240,format=RGB,framerate=10/1 ! "
"tensor_converter ! edgesink connect-type=CUSTOM custom-lib=libINVALID.so name=sinkx port=0");
gstpipe = gst_parse_launch (pipeline, nullptr);
Expand All @@ -351,7 +351,7 @@ TEST (edgeCustom, srcNormal)
GstElement *gstpipe = nullptr;

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc connect-type=CUSTOM custom-lib=%s name=srcx ! "
pipeline = g_strdup_printf ("edgesrc connect-type=CUSTOM custom-lib=%s name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink",
CUSTOM_LIB_PATH);
Expand All @@ -377,7 +377,7 @@ TEST (edgeCustom, srcInvalidProp_n)
GstElement *gstpipe = nullptr;

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc connect-type=CUSTOM name=srcx ! "
pipeline = g_strdup_printf ("edgesrc connect-type=CUSTOM name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink");
gstpipe = gst_parse_launch (pipeline, nullptr);
Expand All @@ -400,7 +400,7 @@ TEST (edgeCustom, srcInvalidProp2_n)

/* Create a nnstreamer pipeline */
pipeline = g_strdup_printf (
"gst-launch-1.0 edgesrc connect-type=CUSTOM custom-lib=libINVALID.so name=srcx ! "
"edgesrc connect-type=CUSTOM custom-lib=libINVALID.so name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink");
gstpipe = gst_parse_launch (pipeline, nullptr);
Expand Down
22 changes: 11 additions & 11 deletions tests/nnstreamer_trainer/unittest_trainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST (tensor_trainer, SetParams)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=1 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"model-save-path=new_model.bin model-load-path=old_model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -145,7 +145,7 @@ TEST (tensor_trainer, invalidFramework0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer model-config=%s "
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -188,7 +188,7 @@ TEST (tensor_trainer, invalidFramework1_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer model-config=%s "
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -229,7 +229,7 @@ TEST (tensor_trainer, invalidModelConfig0_n)
json_path = get_file_path (json);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s"
"datareposrc location=%s json=%s"
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer"
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -270,7 +270,7 @@ TEST (tensor_trainer, invalidModelConfig1_n)
non_existent_path = get_file_path ("non_existent_file.ini");

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s"
"datareposrc location=%s json=%s"
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer"
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -312,7 +312,7 @@ TEST (tensor_trainer, invalidModelSavePath0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"num-inputs=1 num-labels=1 num-training-samples=100 num-validation-samples=100 "
Expand Down Expand Up @@ -356,7 +356,7 @@ TEST (tensor_trainer, invalidModelNumTrainingSamples0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -402,7 +402,7 @@ TEST (tensor_trainer, invalidModelNumValidationSamples0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -448,7 +448,7 @@ TEST (tensor_trainer, invalidEpochs0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"model-save-path=model.bin num-inputs=1 num-labels=1 "
Expand Down Expand Up @@ -494,7 +494,7 @@ TEST (tensor_trainer, invalidNumInputs0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s "
"model-save-path=model.bin num-labels=1 num-training-samples=100 "
Expand Down Expand Up @@ -540,7 +540,7 @@ TEST (tensor_trainer, invalidNumLabels0_n)
model_config_path = get_file_path (model_config);

gchar *str_pipeline = g_strdup_printf (
"gst-launch-1.0 datareposrc location=%s json=%s "
"datareposrc location=%s json=%s "
"start-sample-index=3 stop-sample-index=202 tensors-sequence=0,1 epochs=5 ! "
"tensor_trainer name=tensor_trainer framework=nntrainer model-config=%s"
"model-save-path=model.bin num-inputs=1 num-validation-samples=100 epochs=5 ! "
Expand Down

0 comments on commit 20e7867

Please sign in to comment.