[corlib] Disable a test that is incompatible with how nunitlite runs tests
[mono.git] / mcs / class / corlib / System.Reflection.Emit / OpCode.cs
index b0755484185bddc6e2a2dcc830b535b45dfba42b..aa3453d20069185d4d7e8abaf1ed258b6aab6f10 100644 (file)
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
 
+       [ComVisible (true)]
        public struct OpCode {
 
                internal byte op1, op2;
@@ -59,7 +58,7 @@ namespace System.Reflection.Emit {
 
                public override int GetHashCode ()
                {
-                       return Value;
+                       return Name.GetHashCode ();
                }
 
                public override bool Equals (Object obj)
@@ -72,6 +71,11 @@ namespace System.Reflection.Emit {
                        return v.op1 == op1 && v.op2 == op2;
                }
 
+               public bool Equals (OpCode obj)
+               {
+                       return obj.op1 == op1 && obj.op2 == op2;
+               }
+
                public override string ToString ()
                {
                        return Name;
@@ -133,5 +137,15 @@ namespace System.Reflection.Emit {
                                }
                        }
                }
+
+               public static bool operator == (OpCode a, OpCode b)
+               {
+                       return a.op1 == b.op1 && a.op2 == b.op2;
+               }
+
+               public static bool operator != (OpCode a, OpCode b)
+               {
+                       return a.op1 != b.op1 || a.op2 != b.op2;
+               }
        }
 }