Beispiel #1
0
        public override Boolean Equals(object obj)
        {
            var other = (MachineState)obj;

            if (!(instructionPointer == other.instructionPointer &&
                  registers.Equals(other.registers) &&
                  zeroFlag == other.zeroFlag))
            {
                return(false);
            }

            foreach (var key in dataSegment.Keys)
            {
                if (!other.dataSegment.ContainsKey(key))
                {
                    return(false);
                }

                if (!dataSegment[key].Equals(other.dataSegment[key]))
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
 public void Equals()
 {
     Assert.IsFalse(registers.Equals(null));
 }