/** * Append an instruction to the end of this list. * * @param i * instruction to append * @return instruction handle of the appended instruction */ public InstructionHandle append(final Instruction i) { final InstructionHandle ih = InstructionHandle.getInstructionHandle(i); append(ih); return ih; }
/** * Append an instruction to the end of this list. * * @param i instruction to append * @return instruction handle of the appended instruction */ public InstructionHandle append(Instruction i) { InstructionHandle ih = InstructionHandle.getInstructionHandle(i); append(ih); return ih; }
/** * Insert an instruction at start of this list. * * @param i * instruction to insert * @return instruction handle of the inserted instruction */ public InstructionHandle insert(final Instruction i) { final InstructionHandle ih = InstructionHandle.getInstructionHandle(i); insert(ih); return ih; }
/** * Insert an instruction at start of this list. * * @param i instruction to insert * @return instruction handle of the inserted instruction */ public InstructionHandle insert(Instruction i) { InstructionHandle ih = InstructionHandle.getInstructionHandle(i); insert(ih); return ih; }
@Test(expected=ClassGenException.class) public void testGetIHnull() { InstructionHandle.getInstructionHandle(null); }
@Test(expected=ClassGenException.class) public void testsetInstructionNull() { final InstructionHandle ih = InstructionHandle.getInstructionHandle(new NOP());// have to start with a valid non BI Assert.assertNotNull(ih); ih.setInstruction(null); Assert.assertNotNull(ih); }
@Test public void testsetInstructionI() { final InstructionHandle ih = InstructionHandle.getInstructionHandle(new NOP());// have to start with a valid non BI Assert.assertNotNull(ih); ih.setInstruction(new NOP()); Assert.assertNotNull(ih); }
@Test(expected=ClassGenException.class) public void testsetInstructionnotI() { final InstructionHandle ih = InstructionHandle.getInstructionHandle(new NOP());// have to start with a valid non BI Assert.assertNotNull(ih); ih.setInstruction(new GOTO(null)); Assert.assertNotNull(ih); }