public void Reference() { var remoteValue = RemoteValueFakeUtil.Create("dummyType&", TypeFlags.IS_REFERENCE, "dummyName", "0xDEADC0DE"); remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xAAAAAAAA)); Assert.That(RemoteValueExtensions.GetMemoryContextAddress(remoteValue), Is.EqualTo(0xDEADC0DE)); }
public void ValueWithAnAddressIsEditable() { var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0xDEADBEEF"); remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal); remoteValue.SetAddressOf(RemoteValueFakeUtil.Create("int*", TypeFlags.IS_INTEGER | TypeFlags.IS_POINTER, "", "0xCAB005E")); remoteValue.SetTypeInfo(new SbTypeStub("int[23]", TypeFlags.NONE)); var varInfo = CreateVarInfo(remoteValue, null); Assert.That(varInfo.IsReadOnly, Is.False); }
public void ValueWithAnErrorAddressOfIsReadOnly() { var sbAddress = RemoteValueFakeUtil.Create("", TypeFlags.NONE, "$10", ""); sbAddress.SetError(new SbErrorStub(false)); var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0xDEADBEEF"); remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal); remoteValue.SetAddressOf(sbAddress); remoteValue.SetTypeInfo(new SbTypeStub("int*", TypeFlags.NONE)); var varInfo = varInfoBuilder.Create(remoteValue); Assert.That(varInfo.IsReadOnly, Is.True); }
public void SimpleArrayValueIsNotEditable() { var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0xDEADBEEF"); remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal); remoteValue.SetAddressOf(RemoteValueFakeUtil.Create( "int (*)[23]", TypeFlags.HAS_CHILDREN | TypeFlags.HAS_VALUE | TypeFlags.IS_POINTER, "", "0xCAB005E")); remoteValue.SetTypeInfo(new SbTypeStub( "int[23]", TypeFlags.HAS_CHILDREN | TypeFlags.IS_ARRAY)); var varInfo = CreateVarInfo(remoteValue, null); Assert.That(varInfo.IsReadOnly, Is.True); }