예제 #1
0
    public void Type_Equals()
    {
        TestUtility.CreateInstances <WebAssemblyType>(out var a, out var b);
        a.Form = (FunctionType)1;
        TestUtility.AreNotEqual(a, b);
        b.Form = (FunctionType)1;
        TestUtility.AreEqual(a, b);

        a.Parameters = new WebAssemblyValueType[] { };
        TestUtility.AreEqual(a, b);
        a.Parameters = new[] { WebAssemblyValueType.Int32 };
        TestUtility.AreNotEqual(a, b);
        b.Parameters = new[] { WebAssemblyValueType.Int32 };
        TestUtility.AreEqual(a, b);
        a.Parameters = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float32 };
        TestUtility.AreNotEqual(a, b);
        b.Parameters = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float64 };
        TestUtility.AreNotEqual(a, b);
        b.Parameters = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float32 };
        TestUtility.AreEqual(a, b);

        a.Returns = new WebAssemblyValueType[] { };
        TestUtility.AreEqual(a, b);
        a.Returns = new[] { WebAssemblyValueType.Int32 };
        TestUtility.AreNotEqual(a, b);
        b.Returns = new[] { WebAssemblyValueType.Int32 };
        TestUtility.AreEqual(a, b);
        a.Returns = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float32 };
        TestUtility.AreNotEqual(a, b);
        b.Returns = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float64 };
        TestUtility.AreNotEqual(a, b);
        b.Returns = new[] { WebAssemblyValueType.Int32, WebAssemblyValueType.Float32 };
        TestUtility.AreEqual(a, b);
    }
예제 #2
0
 public void Call_Equals()
 {
     TestUtility.CreateInstances <Call>(out var a, out var b);
     a.Index = 1;
     TestUtility.AreNotEqual(a, b);
     b.Index = 1;
     TestUtility.AreEqual(a, b);
 }
예제 #3
0
        public void CallIndirect_Equals()
        {
            TestUtility.CreateInstances <CallIndirect>(out var a, out var b);

            a.Type = 1;
            TestUtility.AreNotEqual(a, b);
            b.Type = 1;
            TestUtility.AreEqual(a, b);

            a.Reserved = 1;
            TestUtility.AreNotEqual(a, b);
            b.Reserved = 1;
            TestUtility.AreEqual(a, b);
        }
예제 #4
0
        public void Float32Load_Equals()
        {
            TestUtility.CreateInstances <Float32Load>(out var a, out var b);

            a.Flags = MemoryImmediateInstruction.Options.Align2;
            TestUtility.AreNotEqual(a, b);
            b.Flags = MemoryImmediateInstruction.Options.Align2;
            TestUtility.AreEqual(a, b);

            a.Offset = 1;
            TestUtility.AreNotEqual(a, b);
            b.Offset = 1;
            TestUtility.AreEqual(a, b);
        }
예제 #5
0
        public void BranchTable_Equals()
        {
            TestUtility.CreateInstances<BranchTable>(out var a, out var b);

            a.DefaultLabel = 2;
            b.DefaultLabel = 1;
            TestUtility.AreNotEqual(a, b);
            b.DefaultLabel = 2;
            TestUtility.AreEqual(a, b);

            b.Labels = new uint[] { };
            TestUtility.AreEqual(a, b);
            b.Labels = new uint[] { 1 };
            TestUtility.AreNotEqual(a, b);
            a.Labels = new uint[] { 1 };
            TestUtility.AreEqual(a, b);
            a.Labels = new uint[] { 1, 2 };
            TestUtility.AreNotEqual(a, b);
        }