use of com.google.security.zynamics.binnavi.API.disassembly.Reference in project binnavi by google.
the class OperandExpressionTest method testReferences.
@Test
public void testReferences() throws CouldntSaveDataException, CouldntDeleteException {
final MockOperandExpressionListener listener = new MockOperandExpressionListener();
final MockOperandTreeNode node = new MockOperandTreeNode();
final OperandExpression expression = new OperandExpression(node);
expression.addListener(listener);
final Reference reference1 = expression.addReference(new Address(0x123), ReferenceType.CALL_VIRTUAL);
final Reference reference2 = expression.addReference(new Address(0x124), ReferenceType.DATA);
final List<Reference> references = expression.getReferences();
assertEquals(2, references.size());
assertEquals(reference1, references.get(0));
assertEquals(reference2, references.get(1));
assertEquals("addedReference;addedReference;", listener.events);
expression.deleteReference(reference1);
assertEquals(1, expression.getReferences().size());
assertEquals("addedReference;addedReference;removedReference;", listener.events);
expression.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Reference in project binnavi by google.
the class ReferenceTest method testConstructor.
@Test
public void testConstructor() {
final Reference reference = new Reference(new CReference(new CAddress(0), ReferenceType.CALL_DIRECT));
assertEquals(com.google.security.zynamics.binnavi.API.disassembly.ReferenceType.CALL_DIRECT, reference.getType());
assertEquals(0, reference.getTarget().toLong());
assertEquals("CALL_DIRECT Reference to 0", reference.toString());
}
Aggregations