Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VM UT] update UT name #3115

Merged
merged 12 commits into from
Feb 7, 2024
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtDebugger.cs file belongs to the neo project and is free
// UT_Debugger.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -15,7 +15,7 @@
namespace Neo.Test
{
[TestClass]
public class UtDebugger
public class UT_Debugger
{
[TestMethod]
public void TestBreakPoint()
Expand Down Expand Up @@ -97,10 +97,10 @@ public void TestStepOver()
{
using ExecutionEngine engine = new();
using ScriptBuilder script = new();
/* ┌ CALL
/* ┌ CALL
│ ┌> NOT
│ │ RET
└> │ PUSH0
└> │ PUSH0
└─┘ RET */
script.EmitCall(4);
script.Emit(OpCode.NOT);
Expand Down Expand Up @@ -135,7 +135,7 @@ public void TestStepInto()
using ExecutionEngine engine = new();
using ScriptBuilder script = new();
/* ┌ CALL
│ ┌> NOT
│ ┌> NOT
│ │ RET
└> │ PUSH0
└─┘ RET */
Expand Down Expand Up @@ -185,7 +185,7 @@ public void TestBreakPointStepOver()
{
using ExecutionEngine engine = new();
using ScriptBuilder script = new();
/* ┌ CALL
/* ┌ CALL
│ ┌> NOT
│ │ RET
└>X│ PUSH0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtEvaluationStack.cs file belongs to the neo project and is free
// UT_EvaluationStack.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -19,7 +19,7 @@
namespace Neo.Test
{
[TestClass]
public class UtEvaluationStack
public class TestEvaluationStack
shargon marked this conversation as resolved.
Show resolved Hide resolved
{
private static EvaluationStack CreateOrderedStack(int count)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtExecutionContext.cs file belongs to the neo project and is free
// UT_ExecutionContext.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -17,15 +17,15 @@
namespace Neo.Test
{
[TestClass]
public class UtExecutionContext
public class UT_ExecutionContext
{
class TestState
{
public bool Flag = false;
}

[TestMethod]
public void StateTest()
public void TestStateTest()
{
var context = new ExecutionContext(Array.Empty<byte>(), -1, new ReferenceCounter());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtReferenceCounter.cs file belongs to the neo project and is free
// UT_ReferenceCounter.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -16,7 +16,7 @@
namespace Neo.Test
{
[TestClass]
public class UtReferenceCounter
public class UT_ReferenceCounter
{
[TestMethod]
public void TestCircularReferences()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtScript.cs file belongs to the neo project and is free
// UT_Script.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -17,10 +17,10 @@
namespace Neo.Test
{
[TestClass]
public class UtScript
public class UT_Script
{
[TestMethod]
public void Conversion()
public void TestConversion()
{
byte[] rawScript;
using (var builder = new ScriptBuilder())
Expand All @@ -39,7 +39,7 @@ public void Conversion()
}

[TestMethod]
public void StrictMode()
public void TestStrictMode()
{
var rawScript = new byte[] { (byte)OpCode.PUSH0, 0xFF };
Assert.ThrowsException<BadScriptException>(() => new Script(rawScript, true));
Expand All @@ -58,7 +58,7 @@ public void StrictMode()
}

[TestMethod]
public void Parse()
public void TestParse()
{
Script script;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtScriptBuilder.cs file belongs to the neo project and is free
// UT_ScriptBuilder.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -21,7 +21,7 @@
namespace Neo.Test
{
[TestClass]
public class UtScriptBuilder
public class UT_ScriptBuilder
{
[TestMethod]
public void TestEmit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtSlot.cs file belongs to the neo project and is free
// UT_Slot.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -20,7 +20,7 @@
namespace Neo.Test
{
[TestClass]
public class UtSlot
public class UT_Slot
{
private static Slot CreateOrderedSlot(int count)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtStackItem.cs file belongs to the neo project and is free
// UT_StackItem.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -17,10 +17,10 @@
namespace Neo.Test
{
[TestClass]
public class UtStackItem
public class UT_StackItem
{
[TestMethod]
public void HashCodeTest()
public void TestHashCode()
{
StackItem itemA = "NEO";
StackItem itemB = "NEO";
Expand Down Expand Up @@ -80,7 +80,7 @@ public void HashCodeTest()
}

[TestMethod]
public void NullTest()
public void TestNull()
{
StackItem nullItem = System.Array.Empty<byte>();
Assert.AreNotEqual(StackItem.Null, nullItem);
Expand All @@ -90,7 +90,7 @@ public void NullTest()
}

[TestMethod]
public void EqualTest()
public void TestEqual()
{
StackItem itemA = "NEO";
StackItem itemB = "NEO";
Expand All @@ -106,7 +106,7 @@ public void EqualTest()
}

[TestMethod]
public void CastTest()
public void TestCast()
{
// Signed byte

Expand Down Expand Up @@ -187,7 +187,7 @@ public void CastTest()
}

[TestMethod]
public void DeepCopyTest()
public void TestDeepCopy()
{
Array a = new()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtStruct.cs file belongs to the neo project and is free
// UT_Struct.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -17,19 +17,19 @@
namespace Neo.Test
{
[TestClass]
public class UtStruct
public class UT_Struct
{
private readonly Struct @struct;

public UtStruct()
public UT_Struct()
{
@struct = new Struct { 1 };
for (int i = 0; i < 20000; i++)
@struct = new Struct { @struct };
}

[TestMethod]
public void Clone()
public void TestClone()
{
Struct s1 = new() { 1, new Struct { 2 } };
Struct s2 = s1.Clone(ExecutionEngineLimits.Default);
Expand All @@ -41,7 +41,7 @@ public void Clone()
}

[TestMethod]
public void Equals()
public void TestEquals()
{
Struct s1 = new() { 1, new Struct { 2 } };
Struct s2 = new() { 1, new Struct { 2 } };
Expand All @@ -52,7 +52,7 @@ public void Equals()
}

[TestMethod]
public void EqualsDos()
public void TestEqualsDos()
{
string payloadStr = new string('h', 65535);
Struct s1 = new();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtUnsafe.cs file belongs to the neo project and is free
// UT_Unsafe.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -15,10 +15,10 @@
namespace Neo.Test
{
[TestClass]
public class UtUnsafe
public class UT_Unsafe
{
[TestMethod]
public void NotZero()
public void TestNotZero()
{
Assert.IsFalse(Unsafe.NotZero(System.Array.Empty<byte>()));
Assert.IsFalse(Unsafe.NotZero(new byte[4]));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtUtility.cs file belongs to the neo project and is free
// UT_Utility.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -17,10 +17,10 @@
namespace Neo.Test
{
[TestClass]
public class UtUtility
public class UT_Utility
{
[TestMethod]
public void SqrtTest()
public void TestSqrtTest()
{
Assert.ThrowsException<InvalidOperationException>(() => BigInteger.MinusOne.Sqrt());

Expand All @@ -33,7 +33,7 @@ public void SqrtTest()
}

[TestMethod]
public void ModInverseTest()
public void TestModInverseTest()
{
Assert.ThrowsException<ArgumentOutOfRangeException>(() => BigInteger.One.ModInverse(BigInteger.Zero));
Assert.ThrowsException<ArgumentOutOfRangeException>(() => BigInteger.One.ModInverse(BigInteger.One));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// UtVMJson.cs file belongs to the neo project and is free
// UT_VMJson.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
Expand All @@ -19,7 +19,7 @@
namespace Neo.Test
{
[TestClass]
public class UtVMJson : VMJsonTestBase
public class UT_VMJson : VMJsonTestBase
{
[TestMethod]
public void TestOthers() => TestJson("./Tests/Others");
Expand Down