[MediaVision][Non-ACR] Rollback TCs for Target property 96/238796/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 17 Jul 2020 09:23:49 +0000 (18:23 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 17 Jul 2020 09:23:49 +0000 (18:23 +0900)
Change-Id: Icade53761b616d20f1a612cbda6f46c9b236dcfb

tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs

index 9d2c19fd81fad54924ca8376d674ab4136b9318b..df744dad216dae113d228fe1cb85f65eafc6de8a 100644 (file)
@@ -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<FileNotFoundException>(() => 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<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
+            Assert.AreEqual(InferenceTargetType.CPU, _config.Target, "Should be got same value.");
+
+            _config.Target = InferenceTargetType.GPU;
+            Assert.IsInstanceOf<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
+            Assert.AreEqual(InferenceTargetType.GPU, _config.Target, "Should be got same value.");
+
+            _config.Target = InferenceTargetType.Custom;
+            Assert.IsInstanceOf<InferenceTargetType>(_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<ArgumentException>(() => _config.Target = (InferenceTargetType)10);
+        }
+
         [Test]
         [Category("P1")]
         [Description("Check whether Device returns correct default value.")]