[Device][Non-ACR][Skip brightness test if not supported] 79/273379/7
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 5 Apr 2022 06:29:18 +0000 (23:29 -0700)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 6 Apr 2022 01:16:48 +0000 (18:16 -0700)
Change-Id: I20da48b5e093fc7fa7f8483c502afca5729a98d6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs

index 4d182dd..af5bb5f 100755 (executable)
@@ -9,7 +9,8 @@ namespace Tizen.System.Tests
     [Description("Tizen.System.Display tests")]
     class DisplayTests
     {
-        private int isSupport = 1;
+        private int isDisplaySupport = 1;
+        private int isDisplayBrightnessSupport = 1;
         [SetUp]
         public void Init()
         {
@@ -20,9 +21,21 @@ namespace Tizen.System.Tests
             ret_value = Tizen.System.Information.TryGetValue<string>("tizen.org/feature/profile", out value);
             if (ret_value == true && String.Compare(value, "tv", true) == 0)
             {
-                isSupport = 0;
+                isDisplaySupport = 0;
                 return;
             }
+
+            try
+            {
+                foreach (Display dis in Display.Displays)
+                {
+                    dis.Brightness = 30;
+                }
+            }
+            catch (NotSupportedException e)
+            {
+                isDisplayBrightnessSupport = 0;
+            }
         }
 
         [TearDown]
@@ -39,7 +52,7 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void NumberOfDisplays_PROPERTY_READ_ONLY()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1)
             {
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NumberofDisplays_READ  Value:" + Display.NumberOfDisplays);
                 Assert.IsTrue(Display.NumberOfDisplays > 0, "Number of displays can't be zero");
@@ -59,7 +72,7 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void Displays_PROPERTY_READ_ONLY()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1)
             {
                 Assert.IsTrue(Display.Displays.Count > 0, "Number of displays can't be zero");
             }
@@ -78,7 +91,7 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void MaxBrightness_PROPERTY_READ_ONLY()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
             {
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "MaxBrightness_READ  count:" + Display.Displays.Count);
                 foreach (Display dis in Display.Displays)
@@ -89,7 +102,7 @@ namespace Tizen.System.Tests
             }
             else
             {
-                Assert.IsTrue(true, "display is not supported");
+                Assert.IsTrue(true, "display brightness is not supported");
             }
         }
 
@@ -102,7 +115,7 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void State_PROPERTY_READ_WRITE()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1)
             {
                 Display.State = DisplayState.Normal;
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "State_READ  Value:" + Display.State);
@@ -124,18 +137,18 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void Brightness_READ_WRITE()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
             {
                 foreach (Display dis in Display.Displays)
                 {
                     dis.Brightness = 30;
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "MaxBrightness_READ  Value:" + dis.Brightness);
+                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Brightness_READ  Value:" + dis.Brightness);
                     Assert.IsTrue(dis.Brightness == 30, "set/get  brightness value should be same");
                 }
             }
             else
             {
-                Assert.IsTrue(true, "display is not supported");
+                Assert.IsTrue(true, "display brightness is not supported");
             }
         }
 
@@ -148,7 +161,7 @@ namespace Tizen.System.Tests
         [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
         public void Brightness_CHANGE_VALUE()
         {
-            if (isSupport == 1)
+            if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
             {
                 //Minimum value for brightness is not defined . we can't check the value.
                 Display dis = Display.Displays[0];