[NUI] Add Devel(internal) TCs
authorDongsug Song <dongsug.song@samsung.com>
Tue, 6 Apr 2021 09:32:37 +0000 (18:32 +0900)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 20 Apr 2021 06:13:00 +0000 (15:13 +0900)
src/Tizen.NUI/src/public/Animation/AlphaFunction.cs
test/Tizen.NUI.Tests/Tizen.NUI.TCT/Program.cs
test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Accessibility/TSAccessibilityDoGestureSignal.cs [new file with mode: 0755]
test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/BaseComponents/TSViewPublicMethods.cs [new file with mode: 0755]
test/Tizen.NUI.Tests/nunitlite/TUnit/TRunner.cs

index c2799db..0e058da 100755 (executable)
@@ -78,10 +78,11 @@ namespace Tizen.NUI
         {
         }
 
-        internal AlphaFunction(SWIGTYPE_p_f_float__float function) : this(Interop.AlphaFunction.NewAlphaFunction(SWIGTYPE_p_f_float__float.getCPtr(function)), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
+        // Not used : This will be remained by 2021-05-30 to check side effect. After 2021-05-30 this will be removed cleanly
+        // internal AlphaFunction(SWIGTYPE_p_f_float__float function) : this(Interop.AlphaFunction.NewAlphaFunction(SWIGTYPE_p_f_float__float.getCPtr(function)), true)
+        // {
+        //     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        // }
 
         /// <summary>
         /// This specifies the various types of BuiltinFunctions.
@@ -315,13 +316,14 @@ namespace Tizen.NUI
             return propertyKey;
         }
 
-        internal SWIGTYPE_p_f_float__float GetCustomFunction()
-        {
-            global::System.IntPtr cPtr = Interop.AlphaFunction.GetCustomFunction(SwigCPtr);
-            SWIGTYPE_p_f_float__float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_float__float(cPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
+        // Not used : This will be remained by 2021-05-30 to check side effect. After 2021-05-30 this will be removed cleanly
+        // internal SWIGTYPE_p_f_float__float GetCustomFunction()
+        // {
+        //     global::System.IntPtr cPtr = Interop.AlphaFunction.GetCustomFunction(SwigCPtr);
+        //     SWIGTYPE_p_f_float__float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_float__float(cPtr);
+        //     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        //     return ret;
+        // }
 
         /// This will not be public opened.
         [EditorBrowsable(EditorBrowsableState.Never)]
index f982259..1ad01bf 100755 (executable)
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Devel.Tests
         {
             base.OnResume();
 
-            tlog.Debug(tag, $"OnResume() START!");
+            tlog.Debug(tag, $"### OnResume() START!");
 
             TRunner t = new TRunner();
             t.LoadTestsuite();
diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Accessibility/TSAccessibilityDoGestureSignal.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Accessibility/TSAccessibilityDoGestureSignal.cs
new file mode 100755 (executable)
index 0000000..50170d6
--- /dev/null
@@ -0,0 +1,162 @@
+
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+    using tlog = Tizen.Log;
+
+    [TestFixture]
+    [Description("internal/Accessibility/AccessibilityDoGestureSignal")]
+    public class InternalAccessibilityDoGestureSignalTest
+    {
+        private const string tag = "NUITEST";
+        private delegate bool dummyCallback(IntPtr accessibilityManager);
+        private bool OnDummyCallback(IntPtr data)
+        {
+            return false;
+        }
+
+        [SetUp]
+        public void Init()
+        {
+            tlog.Info(tag, "Init() is called!");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            tlog.Info(tag, "Destroy() is called!");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal constructor")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalConstructor()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalConstructor START");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            testingTarget.Dispose();
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalConstructor END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal GetSizeOfGestureInfo")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalGetSizeOfGestureInfo()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalGetSizeOfGestureInfo START");
+
+            uint size = AccessibilityDoGestureSignal.GetSizeOfGestureInfo();
+
+            tlog.Debug(tag, $"size={size}");
+            Assert.IsNotNull(size, "should be not null");
+
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalGetSizeOfGestureInfo END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal Empty")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalEmpty()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalEmpty START");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            var result = testingTarget.Empty();
+            Assert.IsTrue(result);
+
+            testingTarget.Dispose();
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalEmpty END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal GetConnectionCount")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalGetConnectionCount()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignal_GetConnectionCount START");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            var result = testingTarget.GetConnectionCount();
+            Assert.IsTrue(result == 0, "result should be 0");
+
+            testingTarget.Dispose();
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalGetConnectionCount END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal Connection")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalConnection()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalConnection START");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            dummyCallback callback = OnDummyCallback;
+            testingTarget.Connect(callback);
+            testingTarget.Disconnect(callback);
+            testingTarget.Dispose();
+
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalConnection END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal Disconnection")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalDisconnection()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalDisconnection START");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            dummyCallback callback = OnDummyCallback;
+            testingTarget.Connect(callback);
+            testingTarget.Disconnect(callback);
+            testingTarget.Dispose();
+
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalDisconnection END (OK)");
+        }
+
+        [Test]
+        [Description("AccessibilityDoGestureSignal Emit")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void AccessibilityDoGestureSignalEmit()
+        {
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit START");
+            var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+            var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+
+            tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
+
+            var testingTarget = new AccessibilityDoGestureSignal();
+            Assert.IsNotNull(testingTarget, "should be not null");
+            Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+            testingTarget.Emit();
+            testingTarget.Dispose();
+
+            tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit END (OK)");
+        }
+
+    }
+}
diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/BaseComponents/TSViewPublicMethods.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/BaseComponents/TSViewPublicMethods.cs
new file mode 100755 (executable)
index 0000000..22f4c5a
--- /dev/null
@@ -0,0 +1,148 @@
+
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+    using tlog = Tizen.Log;
+
+    [TestFixture]
+    [Description("public/BaseComponents/ViewPublicMethods")]
+    public class PublicBaseComponentsViewPublicMethodsTest
+    {
+        private const string tag = "NUITEST";
+
+        [SetUp]
+        public void Init()
+        {
+            tlog.Info(tag, "Init() is called!");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            tlog.Info(tag, "Destroy() is called!");
+        }
+
+        [Test]
+        [Description("View.AnimateBackgroundColor method")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void ViewAnimateBackgroundColor()
+        {
+            tlog.Debug(tag, $"ViewAnimateBackgroundColor START");
+
+            var view = new View()
+            {
+                Size = new Size2D(100, 100),
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.TopCenter,
+                PivotPoint = PivotPoint.TopCenter,
+                BackgroundColor = Color.AquaMarine,
+            };
+            NUIApplication.GetDefaultWindow().Add(view);
+
+            Assert.IsNotNull(view, "should be not null");
+
+            var animation = view.AnimateBackgroundColor(new Color(0, 0, 0, 1), 0, 300);
+
+            Assert.IsNotNull(animation, "should be not null");
+
+            view.Unparent();
+            view.Dispose();
+            tlog.Debug(tag, $"ViewAnimateBackgroundColor END ");
+        }
+
+        [Test]
+        [Description("View.AnimateColor method")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void ViewAnimateColor()
+        {
+            tlog.Debug(tag, $"ViewAnimateColor START");
+
+            var view = new View()
+            {
+                Size = new Size2D(200, 200),
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.CenterRight,
+                PivotPoint = PivotPoint.CenterRight,
+                BackgroundColor = Color.Azure,
+            };
+            NUIApplication.GetDefaultWindow().Add(view);
+
+            Assert.IsNotNull(view, "should be not null");
+
+            var animation = view.AnimateColor("background", new Color(0, 0, 0, 1), 0, 200);
+
+            Assert.IsNotNull(animation, "should be not null");
+
+            view.Unparent();
+            view.Dispose();
+            tlog.Debug(tag, $"ViewAnimateColor END ");
+        }
+
+        [Test]
+        [Description("View.Add method, child null")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void ViewAddArgumentNull()
+        {
+            tlog.Debug(tag, $"ViewAddArgumentNull START");
+
+            var view = new View()
+            {
+                Size = new Size2D(200, 200),
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.CenterRight,
+                PivotPoint = PivotPoint.CenterRight,
+                BackgroundColor = Color.Azure,
+            };
+            NUIApplication.GetDefaultWindow().Add(view);
+
+            Assert.IsNotNull(view, "should be not null");
+
+            try
+            {
+                view.Add(null);
+            }
+            catch (Exception e)
+            {
+                tlog.Fatal(tag, $"Exception occured, e={e}");
+                Assert.Fail("No Exception required!");
+            }
+            finally
+            {
+                view.Unparent();
+                view.Dispose();
+                tlog.Debug(tag, $"ViewAddArgumentNull END ");
+            }
+        }
+
+        [Test]
+        [Description("View.HasFocus method")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public void ViewHasFocus()
+        {
+            tlog.Debug(tag, $"ViewHasFocus START");
+
+            var view = new View()
+            {
+                Size = new Size2D(200, 200),
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.CenterRight,
+                PivotPoint = PivotPoint.CenterRight,
+                BackgroundColor = Color.Azure,
+                Focusable = true,
+            };
+            NUIApplication.GetDefaultWindow().Add(view);
+
+            Assert.IsNotNull(view, "should be not null");
+
+            Assert.IsFalse(view.HasFocus(), "should be false!");
+            tlog.Debug(tag, $"ViewHasFocus END ");
+        }
+
+
+    }
+}
index e1f9705..5e6d8f8 100755 (executable)
@@ -56,12 +56,18 @@ namespace NUnitLite.TUnit
         public TRunner(Assembly testAssembly)
         {
             _testAssembly = testAssembly;
+            Tizen.Log.Fatal("NUITEST", $"");
+            Tizen.Log.Fatal("NUITEST", $"TRunner() _testAssembly={_testAssembly}");
 #if TIZEN
             TSettings.GetInstance().ConnectTestkitStub();
 #endif
         }
 
-        public TRunner() : this(Assembly.GetEntryAssembly()) { }
+        public TRunner() : this(Assembly.GetEntryAssembly())
+        {
+            Tizen.Log.Fatal("NUITEST", $"");
+            Tizen.Log.Fatal("NUITEST", $"TRunner()");
+        }
 
         /// <summary>
         /// Get the app name of the Tizen package
@@ -106,20 +112,25 @@ namespace NUnitLite.TUnit
         /// </summary>
         public void LoadTestsuite()
         {
+            Tizen.Log.Fatal("NUITEST", $"");
+            Tizen.Log.Fatal("NUITEST", $"LoadTestsuite()");
             TSettings.CurTCIndex = 0;
             string cache_path = Tizen.Applications.Application.Current.DirectoryInfo.Cache;
             string dllPath = cache_path.Replace("cache", "bin");
             string pkgName = GetPackageName(dllPath);
             if (pkgName == "")
             {
+                Tizen.Log.Fatal("NUITEST", $"The package name is invalid!");
                 TLogger.WriteError("The package name is invalid!");
                 return;
             }
 
             //TLogger.Write("Executing the application: " + pkgName + "...");
+            Tizen.Log.Fatal("NUITEST", $"Executing the application: {pkgName}");
 
             string exeFilePathName = string.Format(dllPath + "Tizen.{0}.Tests.exe", pkgName);
             //TLogger.Write("exeFilePathName : " + exeFilePathName);
+            Tizen.Log.Fatal("NUITEST", $"exeFilePathName : {exeFilePathName}");
 
             AssemblyName asmName = new AssemblyName(GetAssemblyName(exeFilePathName));
             _testAssembly = Assembly.Load(asmName);
@@ -136,6 +147,8 @@ namespace NUnitLite.TUnit
             TSettings.GetInstance().SetOutputFilePathName(outputFilePathName);
             string[] s = new string[1] { exeFilePathName };
 
+            Tizen.Log.Fatal("NUITEST", $"outputFilePathName : {outputFilePathName}");
+            
             //new TextRunner(_testAssembly).Execute(s);
             LoadTestsuite(s, outputFilePathName);
         }