Exemplo n.º 1
0
		public void AddIncrement()
		{
			var id = new Identifier("id", PrimitiveType.Word16, null);
            var emitter = new CodeEmitterImpl();
			var add = emitter.IAdd(id, 3);
			Assert.AreEqual(PrimitiveType.Word16, add.DataType);
			Assert.AreEqual(PrimitiveType.Word16, add.Right.DataType);
			Assert.AreEqual("id + 0x0003", add.ToString());
		}
Exemplo n.º 2
0
        public void AddIncrement()
        {
            var id      = new Identifier("id", PrimitiveType.Word16, null);
            var emitter = new CodeEmitterImpl();
            var add     = emitter.IAdd(id, 3);

            Assert.AreEqual(PrimitiveType.Word16, add.DataType);
            Assert.AreEqual(PrimitiveType.Word16, add.Right.DataType);
            Assert.AreEqual("id + 3<16>", add.ToString());
        }
Exemplo n.º 3
0
        public void AddPointer()
        {
            var ptr     = new Pointer(new StructureType("tmp", 16), 32);
            var id      = new Identifier("id", ptr, null);
            var emitter = new CodeEmitterImpl();
            var add     = emitter.IAdd(id, 3);

            Assert.AreEqual(PrimitiveType.Word32, add.DataType);
            Assert.AreEqual(PrimitiveType.Word32, add.Right.DataType);
            Assert.AreEqual("id + 3<32>", add.ToString());
        }