use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testAddMultipleNative.
@Test
public void testAddMultipleNative() {
internalManager.addBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertTrue(apiManager.hasEchoBreakpoint(module, new Address(0x124)));
internalManager.clearBreakpointsPassive(BreakpointType.ECHO);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testGetBreakpoint.
@Test
public void testGetBreakpoint() {
try {
apiManager.getBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
try {
apiManager.getBreakpoint(null, new Address(0x123));
fail();
} catch (final NullPointerException exception) {
}
apiManager.setBreakpoint(module, new Address(0x123));
final Breakpoint breakpoint = apiManager.getBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint.getAddress().toLong());
final Module module = ModuleFactory.get();
apiManager.setBreakpoint(module, new Address(0x123));
assertTrue(apiManager.hasBreakpoint(module, new Address(0x123)));
final Breakpoint breakpoint2 = apiManager.getBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint2.getAddress().toLong());
apiManager.removeBreakpoint(module, new Address(0x123));
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testHasBreakpoint.
@Test
public void testHasBreakpoint() {
try {
apiManager.hasBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
assertFalse(apiManager.hasBreakpoint(module, new Address(0x123)));
apiManager.setBreakpoint(module, new Address(0x123));
assertTrue(apiManager.hasBreakpoint(module, new Address(0x123)));
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testRemoveBreakpoint.
@Test
public void testRemoveBreakpoint() {
try {
apiManager.removeBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
apiManager.setBreakpoint(module, new Address(0x123));
apiManager.setBreakpoint(module, new Address(0x124));
apiManager.addListener(mockListener);
apiManager.removeBreakpoint(module, new Address(0x123));
internalManager.removeBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertEquals("removedBreakpoint/124;", mockListener.events);
assertEquals(1, apiManager.getBreakpoints().size());
apiManager.removeListener(mockListener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testGetEchoBreakpoints.
@Test
public void testGetEchoBreakpoints() {
apiManager.setEchoBreakpoint(module, new Address(0x123));
final List<Breakpoint> breakpoints = apiManager.getEchoBreakpoints();
assertEquals(0x123, breakpoints.get(0).getAddress().toLong());
}
Aggregations