From: Haesu Gwon Date: Fri, 17 Jul 2020 09:23:49 +0000 (+0900) Subject: [MediaVision][Non-ACR] Rollback TCs for Target property X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceb9416ff0200d7d78e42fc0af755c55815b3a9f;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaVision][Non-ACR] Rollback TCs for Target property Change-Id: Icade53761b616d20f1a612cbda6f46c9b236dcfb --- diff --git a/tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs b/tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs index 9d2c19fd8..df744dad2 100644 --- a/tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs +++ b/tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs @@ -121,21 +121,6 @@ namespace Tizen.Multimedia.Vision.Tests using (var config = new InferenceModelConfiguration() { WeightFilePath = TestHelper.TFLitePath + "face_detector/not.found", - //MeanValue = 127.5, - //StdValue = 127.5, - //ConfidenceThreshold = 0.3, - //Backend = InferenceBackendType.TFLite, - //Device = InferenceTargetDevice.CPU, - //TensorSize = new Size(300, 300), - //TensorChannels = 3, - //InputNodeName = "normalized_input_image_tensor", - //OutputNodeName = new string[] - //{ - // "TFLite_Detection_PostProcess", - // "TFLite_Detection_PostProcess:1", - // "TFLite_Detection_PostProcess:2", - // "TFLite_Detection_PostProcess:3" - //} }) { Assert.Throws(() => config.LoadInferenceModel()); @@ -361,6 +346,52 @@ namespace Tizen.Multimedia.Vision.Tests } } + [Test] + [Category("P1")] + [Description("Check whether Target returns correct default value.")] + [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PDV")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Target_CHECK_DEFAULT_VALUE() + { + Assert.That(_config.Target, Is.EqualTo(InferenceTargetType.CPU)); + } + + [Test] + [Category("P1")] + [Description("Check whether Target returns correct value.")] + [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Target_READ_WRITE() + { + _config.Target = InferenceTargetType.CPU; + Assert.IsInstanceOf(_config.Target, "Should return InferenceTargetType instance"); + Assert.AreEqual(InferenceTargetType.CPU, _config.Target, "Should be got same value."); + + _config.Target = InferenceTargetType.GPU; + Assert.IsInstanceOf(_config.Target, "Should return InferenceTargetType instance"); + Assert.AreEqual(InferenceTargetType.GPU, _config.Target, "Should be got same value."); + + _config.Target = InferenceTargetType.Custom; + Assert.IsInstanceOf(_config.Target, "Should return InferenceTargetType instance"); + Assert.AreEqual(InferenceTargetType.Custom, _config.Target, "Should be got same value."); + } + + [Test] + [Category("P2")] + [Description("Check whether Target throws exception if parameter is invalid")] + [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Target_THROWS_IF_PARAM_IS_INVALID() + { + Assert.Throws(() => _config.Target = (InferenceTargetType)10); + } + [Test] [Category("P1")] [Description("Check whether Device returns correct default value.")]