public void NoPointer() { var value = new AbstractValue(2).AddTaint(); Assert.IsNull(value.PointsTo); StringAssert.Contains("0x00000002", value.ToString()); StringAssert.Contains("t", value.ToString()); }
public void Pointer() { buffer = new AbstractBuffer(new[] { new AbstractValue(2) }); pointer = new AbstractValue(buffer); Assert.AreEqual(2, pointer.PointsTo[0].Value); StringAssert.StartsWith("*0x00000002", pointer.ToString()); }
public void AssignmentAtByteZero() { var values = AbstractValue.GetNewBuffer(16); pointer = new AbstractValue(values); pointer.PointsTo[0] = new AbstractValue(0x31337); Assert.AreEqual(0x31337, pointer.PointsTo[0].Value); Assert.AreEqual("*0x00031337", pointer.ToString()); }
public void NotInitialized() { var uninitializedValue = new AbstractValue(); Assert.IsFalse(uninitializedValue.IsInitialized); Assert.AreEqual(AbstractValue.UNKNOWN, uninitializedValue.Value); Assert.AreEqual("?", uninitializedValue.ToString()); }
public void AssignmentAtByteZero() { var values = AbstractValue.GetNewBuffer(16); pointer = new AbstractValue(values); pointer.PointsTo[0] = new AbstractValue(0x31337); Assert.AreEqual(0x31337, pointer.PointsTo[0].Value); Assert.AreEqual("*0x00031337", pointer.ToString()); }
public void PointerPointerPointer() { buffer = new AbstractBuffer(new[] {new AbstractValue(2)}); pointer = new AbstractValue(buffer); var pointerPointer = new AbstractValue(new[] {pointer}); var pointerPointerPointer = new AbstractValue(new[] {pointerPointer}); Assert.AreEqual(2, pointerPointerPointer.PointsTo[0].PointsTo[0].PointsTo[0].Value); StringAssert.StartsWith("***0x00000002", pointerPointerPointer.ToString()); }
public void NotInitialized() { var uninitializedValue = new AbstractValue(); Assert.IsFalse(uninitializedValue.IsInitialized); Assert.AreEqual(AbstractValue.UNKNOWN, uninitializedValue.Value); Assert.AreEqual("?", uninitializedValue.ToString()); }
public void NoPointer() { var value = new AbstractValue(2).AddTaint(); Assert.IsNull(value.PointsTo); StringAssert.Contains("0x00000002", value.ToString()); StringAssert.Contains("t", value.ToString()); }