[Camera][Non-ACR] Fix camera tc bug 81/220781/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 22 Nov 2019 05:52:35 +0000 (14:52 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 23 Dec 2019 07:07:00 +0000 (07:07 +0000)
Change-Id: I4a1cb2ef5e7e867d956616727bd37a46b3e5119a
(cherry picked from commit a8157d8f0f13962ab8fbe612e6c52084ff9f0f89)

tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 8279bec..1258861
@@ -159,18 +159,14 @@ namespace Tizen.Multimedia.Tests
             {
                 Range range = TestCamera.Settings.PanRange;
 
-                /* TESTCODE
-                 * Test Absolute Pan Type.
-                 */
-                int val = 1;
-                TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute, val);
-                Assert.AreEqual(val, TestCamera.Settings.GetPan(), "Pan should be same as set value");
+                int absPan = range.Min + 1;
+                TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute, absPan);
+                Assert.AreEqual(absPan, TestCamera.Settings.GetPan(), "Pan should be same as set value");
 
-                /* TESTCODE
-                 * Test Relative Pan Type.
-                 */
-                TestCamera.Settings.SetPan(CameraPtzMoveType.Relative, val);
-                Assert.AreEqual(val, TestCamera.Settings.GetPan(), "Pan should be same as set value");
+                int relPan = range.Min + 1;
+                TestCamera.Settings.SetPan(CameraPtzMoveType.Relative, relPan);
+                Assert.AreEqual(absPan + relPan, TestCamera.Settings.GetPan(),
+                    "Relative Pan value should be same as set value based on current pan value");
             }
             catch (NotSupportedException)
             {
@@ -216,12 +212,14 @@ namespace Tizen.Multimedia.Tests
             {
                 Range range = TestCamera.Settings.TiltRange;
 
-                int val = 1;
-                TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute, val);
-                Assert.AreEqual(val, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
+                int absPan = range.Min + 1;
+                TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute, absPan);
+                Assert.AreEqual(absPan, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
 
-                TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative, val);
-                Assert.AreEqual(val, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
+                int relPan = range.Min + 1;
+                TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative, relPan);
+                Assert.AreEqual(absPan + relPan, TestCamera.Settings.GetTilt(),
+                    "Relative Tilt value should be same as set value based on current pan value");
             }
             catch (NotSupportedException)
             {
@@ -1101,22 +1099,20 @@ namespace Tizen.Multimedia.Tests
         [Property("AUTHOR", "Vivek Ellur, vivek.ellur@samsung.com")]
         public void PtzType_PROPERTY_SET_ENUM_ALL()
         {
-            try
-            {
-                TestCamera.Settings.PtzType = CameraPtzType.Mechanical;
-            }
-            catch (NotSupportedException)
+            foreach ( CameraPtzType type in Enum.GetValues(typeof(CameraPtzType)))
             {
-                Assert.Pass("Ptz feature is not supported.");
-            }
-
-            try
-            {
-                TestCamera.Settings.PtzType = CameraPtzType.Electronic;
-            }
-            catch (NotSupportedException)
-            {
-                Assert.Pass("Ptz feature is not supported.");
+                try
+                {
+                    TestCamera.Settings.PtzType = type;
+                }
+                catch (NotSupportedException)
+                {
+                    Log.Info("Tizen.Camera.Tests", type + " is not supported.");
+                }
+                catch (Exception e)
+                {
+                    Assert.Fail("PtzType setting is failed. " + e.Message);
+                }
             }
         }