public void TestExpressionNameWhenTypeInfoIsNull()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(null);

            Assert.That(remoteValue.GetVariableAssignExpression(), Is.Null);
        }
Example #2
0
        public void ValueWitNullAddressOfIsReadOnly()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetAddressOf(null);
            remoteValue.SetTypeInfo(new SbTypeStub("CustomType", TypeFlags.NONE));
            var varInfo = varInfoBuilder.Create(remoteValue);

            Assert.That(varInfo.IsReadOnly, Is.True);
        }
Example #3
0
        public void ReferenceValueIsEditable()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0xDEADBEEF");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetAddressOf(null);
            remoteValue.SetTypeInfo(new SbTypeStub("int", TypeFlags.IS_REFERENCE));
            var varInfo = CreateVarInfo(remoteValue, null);

            Assert.That(varInfo.IsReadOnly, Is.False);
        }
        public void TestExpressionNameWhenNoAddressOf()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(new SbTypeStub(
                                        "int", TypeFlags.HAS_VALUE | TypeFlags.IS_SCALAR));
            remoteValue.SetAddressOf(null);

            Assert.That(remoteValue.GetVariableAssignExpression(), Is.Null);
        }
        public void TestExpressionNameForPointerType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0x0ddba11");

            remoteValue.SetValueType(ValueType.VariableLocal);
            remoteValue.SetTypeInfo(new SbTypeStub("CustomType*", TypeFlags.IS_POINTER));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("((CustomType*)0x0ddba11)"));
        }
Example #6
0
        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 TestExpressionNameForScalarType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(
                new SbTypeStub("CustomType", TypeFlags.HAS_VALUE | TypeFlags.IS_SCALAR));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("(*((CustomType*)0xDEADBEEF))"));
        }
        public void TestExpressionNameForReferenceType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0x0ddba11");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(
                new SbTypeStub("CustomType&", TypeFlags.HAS_VALUE | TypeFlags.IS_REFERENCE));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("(*((CustomType*)0x0ddba11))"));
        }
Example #9
0
        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);
        }
Example #10
0
        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);
        }