From: huiyu.eun Date: Wed, 17 Apr 2019 02:10:15 +0000 (+0900) Subject: [Non-ACR][NUI] Fix GetHashcode checker X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0422a2cad8fe351af91276bea7cf2e9adf211187;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][NUI] Fix GetHashcode checker It can return negative value. Change-Id: I92cefc5a49836d2f73ba833104d164ea33c5d688 Signed-off-by: huiyu.eun --- diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs index 67a4db45c..2a5676f0a 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs @@ -794,20 +794,21 @@ namespace Tizen.NUI.Tests Assert.AreEqual(position.Z, vector.Z, "The value of Z is not correct."); } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Position.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Position.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var position = new Position(10.0f, 20.0f, 30.0f); + var hash = position.GetHashCode(); Assert.IsNotNull(position, "Can't create success object Position"); - Assert.IsInstanceOf(position, "Should be an instance of Position type."); - Assert.GreaterOrEqual(position.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(position, "Should be an instance of Position type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs index c68b47cf4..27299b7d0 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs @@ -381,20 +381,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Position2D.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Position2D.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var position = new Position2D(10, 20); + var hash = position.GetHashCode(); Assert.IsNotNull(position, "Can't create success object Position2D"); - Assert.IsInstanceOf(position, "Should be an instance of Position2D type."); - Assert.GreaterOrEqual(position.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(position, "Should be an instance of Position2D type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector2.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector2.cs index ad389e7d1..e579e3a2e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector2.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector2.cs @@ -343,20 +343,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.RelativeVector2.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.RelativeVector2.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector1 = new RelativeVector2(1.0f, 0.0f); + var hash = vector1.GetHashCode(); Assert.IsNotNull(vector1, "Can't create success object RelativeVector2"); - Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector2 type."); - Assert.GreaterOrEqual(vector1.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector2 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector3.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector3.cs index 075178535..37962d49e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector3.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector3.cs @@ -373,20 +373,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.RelativeVector3.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.RelativeVector3.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector1 = new RelativeVector3(0.5f, 0.6f, 0.7f); + var hash = vector1.GetHashCode(); Assert.IsNotNull(vector1, "Can't create success object RelativeVector3"); - Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector3 type."); - Assert.GreaterOrEqual(vector1.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector3 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector4.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector4.cs index 2c334fded..372112c4b 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector4.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeVector4.cs @@ -406,20 +406,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.RelativeVector4.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.RelativeVector4.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector1 = new RelativeVector4(10.0f, 20.0f, 30.0f, 40.0f); + var hash = vector1.GetHashCode(); Assert.IsNotNull(vector1, "Can't create success object RelativeVector4"); - Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector4 type."); - Assert.GreaterOrEqual(vector1.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector1, "Should be an instance of RelativeVector4 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize.cs index 99ffff8f7..559cc0e04 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize.cs @@ -393,20 +393,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Size.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Size.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var size = new Size(10.0f, 20.0f, 30.0f); + var hash = size.GetHashCode(); Assert.IsNotNull(size, "Can't create success object Size"); - Assert.IsInstanceOf(size, "Should be an instance of Size type."); - Assert.GreaterOrEqual(size.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(size, "Should be an instance of Size type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize2D.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize2D.cs index a5034c7de..07f95dbe0 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize2D.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize2D.cs @@ -330,20 +330,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Size2D.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Size2D.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var size = new Size2D(10, 20); + var hash = size.GetHashCode(); Assert.IsNotNull(size, "Can't create success object Size2D"); - Assert.IsInstanceOf(size, "Should be an instance of Size2D type."); - Assert.GreaterOrEqual(size.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(size, "Should be an instance of Size2D type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector2.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector2.cs index 52a875554..f15ae9cfb 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector2.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector2.cs @@ -513,20 +513,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Vector2.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Vector2.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector = new Vector2(10.0f, 20.0f); + var hash = vector.GetHashCode(); Assert.IsNotNull(vector, "Can't create success object Vector2"); - Assert.IsInstanceOf(vector, "Should be an instance of Vector2 type."); - Assert.GreaterOrEqual(vector.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector, "Should be an instance of Vector2 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector3.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector3.cs index c6fc67c06..ed91ea23e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector3.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector3.cs @@ -654,20 +654,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Vector3.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Vector3.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector = new Vector3(10.0f, 20.0f, 30.0f); + var hash = vector.GetHashCode(); Assert.IsNotNull(vector, "Can't create success object Vector3"); - Assert.IsInstanceOf(vector, "Should be an instance of Vector3 type."); - Assert.GreaterOrEqual(vector.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector, "Should be an instance of Vector3 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector4.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector4.cs index a3ffebfd8..582f9bebe 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector4.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector4.cs @@ -641,20 +641,21 @@ namespace Tizen.NUI.Tests } } - [Test] - [Category("P1")] - [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] - [Property("SPEC", "Tizen.NUI.Vector4.GetHashCode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void GetHashCode_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Test] + [Category("P1")] + [Description("Test GetHashCode. Check whether GetHashCode returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Vector4.GetHashCode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetHashCode_CHECK_RETURN_VALUE() + { + /* TEST CODE */ var vector = new Vector4(10.0f, 20.0f, 30.0f, 40.0f); + var hash = vector.GetHashCode(); Assert.IsNotNull(vector, "Can't create success object Vector4"); - Assert.IsInstanceOf(vector, "Should be an instance of Vector4 type."); - Assert.GreaterOrEqual(vector.GetHashCode(), 0, "Should be true"); + Assert.IsInstanceOf(vector, "Should be an instance of Vector4 type."); + Assert.IsTrue(hash >= Int32.MinValue && hash <= Int32.MaxValue, "The value of hash is out of Integer range"); } } }