use of edu.cmu.ml.proppr.prove.wam.Instruction.OP in project ProPPR by TeamCohen.
the class WamProgramTest method testLoad.
@Test
public void testLoad() throws IOException {
WamProgram program = WamBaseProgram.load(new File(SimpleProgramProverTest.PROGRAM));
OP[] simpleProgram = { OP.comment, OP.allocate, OP.initfreevar, OP.initfreevar, OP.fclear, OP.fpushstart, OP.fpushconst, OP.fpushconst, OP.fpushconst, OP.freport, OP.pushboundvar, OP.pushfreevar, OP.callp, OP.pushboundvar, OP.pushboundvar, OP.callp, OP.returnp, OP.comment, OP.allocate, OP.initfreevar, OP.initfreevar, OP.fclear, OP.fpushstart, OP.fpushconst, OP.fpushconst, OP.fpushconst, OP.freport, OP.pushboundvar, OP.callp, OP.pushboundvar, OP.pushboundvar, OP.callp, OP.returnp, OP.comment, OP.unifyconst, OP.unifyconst, OP.fclear, OP.fpushstart, OP.fpushconst, OP.fpushconst, OP.fpushconst, OP.freport, OP.returnp, OP.comment, OP.unifyconst, OP.unifyconst, OP.fclear, OP.fpushstart, OP.fpushconst, OP.fpushconst, OP.fpushconst, OP.freport, OP.returnp, OP.comment, OP.unifyconst, OP.fclear, OP.fpushstart, OP.fpushconst, OP.fpushconst, OP.fpushconst, OP.freport, OP.returnp };
assertEquals(simpleProgram.length, program.size());
for (int i = 0; i < simpleProgram.length; i++) {
assertEquals("Instruction " + i, simpleProgram[i], program.getInstruction(i).opcode);
}
assertTrue(program.hasLabel("coworker/2"));
List<Integer> addr = program.getAddresses("coworker/2");
assertEquals("coworker/2", 1, addr.get(0).intValue());
assertTrue(program.hasLabel("employee/2"));
addr = program.getAddresses(("employee/2"));
assertEquals("employee/2", 18, addr.get(0).intValue());
}
Aggregations