示例#1
0
		public void SubIncrement()
		{
			var id = new Identifier("id", PrimitiveType.Word16, null);
            var emitter = new CodeEmitterImpl();
			var add = emitter.ISub(id, 3);
			Assert.AreEqual(PrimitiveType.Word16, add.DataType);
			Assert.AreEqual(PrimitiveType.Word16, add.Right.DataType);
			Assert.AreEqual("id - 0x0003", add.ToString());
		}
示例#2
0
        public void SubIncrement()
        {
            var id      = new Identifier("id", PrimitiveType.Word16, null);
            var emitter = new CodeEmitterImpl();
            var add     = emitter.ISub(id, 3);

            Assert.AreEqual(PrimitiveType.Word16, add.DataType);
            Assert.AreEqual(PrimitiveType.Word16, add.Right.DataType);
            Assert.AreEqual("id - 3<16>", add.ToString());
        }
示例#3
0
 public void SubPointer()
 {
     var ptr = new Pointer(new StructureType("tmp", 16), 4);
     var id = new Identifier("id", ptr, null);
     var emitter = new CodeEmitterImpl();
     var sub = emitter.ISub(id, 3);
     Assert.AreEqual("(ptr (struct \"tmp\" 0010))", sub.DataType.ToString());
     Assert.AreEqual(PrimitiveType.Word32, sub.Right.DataType);
     Assert.AreEqual("id - 0x00000003", sub.ToString());
 }
示例#4
0
        public void SubPointer()
        {
            var ptr     = new Pointer(new StructureType("tmp", 16), 32);
            var id      = new Identifier("id", ptr, null);
            var emitter = new CodeEmitterImpl();
            var sub     = emitter.ISub(id, 3);

            Assert.AreEqual("(ptr32 (struct \"tmp\" 0010))", sub.DataType.ToString());
            Assert.AreEqual(PrimitiveType.Word32, sub.Right.DataType);
            Assert.AreEqual("id - 3<32>", sub.ToString());
        }