From 0422a2cad8fe351af91276bea7cf2e9adf211187 Mon Sep 17 00:00:00 2001 From: "huiyu.eun" Date: Wed, 17 Apr 2019 11:10:15 +0900 Subject: [PATCH] [Non-ACR][NUI] Fix GetHashcode checker It can return negative value. Change-Id: I92cefc5a49836d2f73ba833104d164ea33c5d688 Signed-off-by: huiyu.eun --- .../Tizen.NUI.Tests/testcase/TSPosition.cs | 25 +++++++++++----------- .../Tizen.NUI.Tests/testcase/TSPosition2D.cs | 25 +++++++++++----------- .../Tizen.NUI.Tests/testcase/TSRelativeVector2.cs | 25 +++++++++++----------- .../Tizen.NUI.Tests/testcase/TSRelativeVector3.cs | 25 +++++++++++----------- .../Tizen.NUI.Tests/testcase/TSRelativeVector4.cs | 25 +++++++++++----------- tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize.cs | 25 +++++++++++----------- tct-suite-vs/Tizen.NUI.Tests/testcase/TSSize2D.cs | 25 +++++++++++----------- tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector2.cs | 25 +++++++++++----------- tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector3.cs | 25 +++++++++++----------- tct-suite-vs/Tizen.NUI.Tests/testcase/TSVector4.cs | 25 +++++++++++----------- 10 files changed, 130 insertions(+), 120 deletions(-) diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition.cs index 67a4db4..2a5676f 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 c68b47c..27299b7 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 ad389e7..e579e3a 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 0751785..37962d4 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 2c334fd..372112c 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 99ffff8..559cc0e 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 a5034c7..07f95db 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 52a8755..f15ae9c 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 c6fc67c..ed91ea2 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 a3ffebf..582f9be 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"); } } } -- 2.7.4