[ML][Pipeline] Fix issues reported by TCT team 47/255147/3
authorPawel Wasowski <p.wasowski2@samsung.com>
Fri, 12 Mar 2021 14:32:18 +0000 (15:32 +0100)
committerPawel Wasowski <p.wasowski2@samsung.com>
Fri, 12 Mar 2021 14:32:18 +0000 (15:32 +0100)
commit741109a727fdd6548e9fc106c3b6e3034f857f86
tree6c4a398791101fd7967f664fcdfd8fa95a322866
parentd9909ef2a22eb2f1cb4219a6869713c3821ad671
[ML][Pipeline] Fix issues reported by TCT team

Fixed problems:
- Pipeline::{getNodeInfo, getSwitch, getValve}: throw TypeMismatchError
when no argument is passed
- NodeInfo::setProperty: throw TypeMismatchError, instead of AbortError
when value type is other than expected
- Pipeline::unregisterSinkListener: throw InvalidValuesError when sink
has not been registered

[Verification] Code was tested with the snippets below and worked fine

///// checking problems with getNodeInfo, getSwitch, getValve,
///// and unregisterSinkListener
var pipelineDefinition = "videotestsrc name=vsrc is-live=true " +
                         "! videoconvert " +
                         "! videoscale name=vscale " +
                         "! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 " +
                         "! tensor_converter " +
                         "! valve name=valvex " +
                         "! input-selector name=is01 " +
                         "! tensor_sink name=sinkx";
var pipeline = tizen.ml.pipeline.createPipeline(pipelineDefinition);

pipeline.getNodeInfo();
// TypeMismatchError

pipeline.getSwitch();
// TypeMismatchError

pipeline.getValve();
// TypeMismatchError

pipeline.unregisterSinkListener('test')
// InvalidValuesError

///// checking problem with setProperty
pipelineDefinition = "videotestsrc name=vsrc is-live=true " +
                    "! videoconvert " +
                    "! videoscale name=vscale " +
                    "! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 " +
                    "! tensor_converter " +
                    "! valve name=valvex " +
                    "! input-selector name=is01 " +
                    "! tensor_sink name=sinkx";
pipeline = tizen.ml.pipeline.createPipeline(pipelineDefinition);
nodeInfo = pipeline.getNodeInfo("vsrc");
nodeInfo.setProperty("is-live", "DOUBLE", NaN);
// TypeMismatchError

Change-Id: I25438b037e0a2dd2f91f8d9b398cffcaf457386b
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
src/ml/js/ml_pipeline.js
src/ml/ml_instance.cc
src/ml/ml_pipeline.cc