use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BookmarkManagerTest method testToString.
@Test
public void testToString() {
m_apiManager.addBookmark(new Address(0x1233), "Fark");
m_apiManager.addBookmark(new Address(0x1234), "Fark");
m_apiManager.addBookmark(new Address(0x1235), "Fark");
assertEquals("Bookmark Manager (Managing 3 Bookmarks)", m_apiManager.toString());
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testGetEchoBreakpoint.
@Test
public void testGetEchoBreakpoint() {
try {
apiManager.getEchoBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
try {
apiManager.getEchoBreakpoint(null, new Address(0x123));
fail();
} catch (final NullPointerException exception) {
}
apiManager.setEchoBreakpoint(module, new Address(0x123));
final Breakpoint breakpoint = apiManager.getEchoBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint.getAddress().toLong());
final Module module = ModuleFactory.get();
apiManager.setEchoBreakpoint(module, new Address(0x123));
assertTrue(apiManager.hasEchoBreakpoint(module, new Address(0x123)));
final Breakpoint breakpoint2 = apiManager.getEchoBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint2.getAddress().toLong());
apiManager.removeEchoBreakpoint(module, new Address(0x123));
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testSetBreakpoint.
@Test
public void testSetBreakpoint() {
apiManager.addListener(mockListener);
try {
apiManager.setBreakpoint(null, null);
} catch (final NullPointerException exception) {
}
apiManager.setBreakpoint(module, new Address(0x123));
assertEquals("addedBreakpoint/123;", mockListener.events);
try {
apiManager.setBreakpoint(null, new Address(0x123));
} catch (final NullPointerException exception) {
}
internalManager.addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertEquals("addedBreakpoint/123;addedBreakpoint/124;", mockListener.events);
assertTrue(apiManager.hasBreakpoint(module, new Address(0x124)));
apiManager.removeListener(mockListener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Address in project binnavi by google.
the class BreakpointManagerTest method testRemoveEchoBreakpoint.
@Test
public void testRemoveEchoBreakpoint() {
try {
apiManager.removeEchoBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
apiManager.setEchoBreakpoint(module, new Address(0x123));
apiManager.setEchoBreakpoint(module, new Address(0x124));
apiManager.addListener(mockListener);
apiManager.removeEchoBreakpoint(module, new Address(0x123));
internalManager.removeBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertEquals("removedEchoBreakpoint/123;removedEchoBreakpoint/124;", mockListener.events);
assertEquals(0, 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 testSetEchoBreakpoint.
@Test
public void testSetEchoBreakpoint() {
apiManager.addListener(mockListener);
try {
apiManager.setEchoBreakpoint(null, null);
} catch (final NullPointerException exception) {
}
apiManager.setEchoBreakpoint(module, new Address(0x123));
assertEquals("addedEchoBreakpoint/123;", mockListener.events);
try {
apiManager.setEchoBreakpoint(null, new Address(0x123));
} catch (final NullPointerException exception) {
}
internalManager.addBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertEquals("addedEchoBreakpoint/123;addedEchoBreakpoint/124;", mockListener.events);
assertTrue(apiManager.hasEchoBreakpoint(module, new Address(0x124)));
apiManager.removeListener(mockListener);
}
Aggregations