use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class PostgreSQLProviderTest method testCModuleFunctionsgetViewsWithAddresses1.
@Test
public void testCModuleFunctionsgetViewsWithAddresses1() throws CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final IFilledList<UnrelocatedAddress> addresses = new FilledList<UnrelocatedAddress>();
List<INaviView> views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x10033DCL)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(1, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x1003429)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, false);
assertEquals(2, views.size());
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class PostgreSQLProviderTest method testCProjectFunctionsgetViewsWithAddresses1.
@Test
public void testCProjectFunctionsgetViewsWithAddresses1() throws CouldntLoadDataException, LoadCancelledException {
final INaviProject project = getProvider().loadProjects().get(0);
project.load();
final IFilledList<UnrelocatedAddress> addresses = new FilledList<UnrelocatedAddress>();
List<INaviView> views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x10033DCL)));
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x1003429)));
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, false);
assertEquals(0, views.size());
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class PostgreSQLProviderTest method testGetViewsWithAddress_Project1.
@Test
public void testGetViewsWithAddress_Project1() throws CouldntLoadDataException, LoadCancelledException {
final INaviProject project = getProvider().loadProjects().get(0);
project.load();
assertEquals(0, getProvider().getViewsWithAddress(project, Lists.newArrayList(new UnrelocatedAddress(new CAddress(0x01002B69))), true).size());
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class CEventValueTableModelTest method foo.
@Test
public void foo() {
final CEventValueTableModel model = new CEventValueTableModel();
final INaviModule mockModule = new MockModule();
final TraceEvent event = new TraceEvent(77, new BreakpointAddress(mockModule, new UnrelocatedAddress(new CAddress(0x123))), TraceEventType.REGULAR_BREAKPOINT, Lists.newArrayList(new TraceRegister("eax", new CAddress(0x123), new byte[] { 05, 06, 07 })));
assertEquals(0, model.getRowCount());
model.setEvent(event);
assertEquals(1, model.getRowCount());
assertEquals("eax", model.getValueAt(0, 0));
assertEquals("00000123", model.getValueAt(0, 1));
assertEquals("05 06 07", model.getValueAt(0, 2));
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class CBreakpointManagerTest method testRemoveRegularBreakpoint.
@Test
public void testRemoveRegularBreakpoint() {
// Error condition: Null argument
try {
m_manager.removeBreakpoints(BreakpointType.REGULAR, null);
fail("Exception not raised");
} catch (final NullPointerException ex) {
}
assertEquals(3, m_manager.getNumberOfBreakpoints(BreakpointType.REGULAR));
m_manager.removeBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x123)))));
assertEquals(2, m_manager.getNumberOfBreakpoints(BreakpointType.REGULAR));
m_manager.removeBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x456)))));
assertEquals(1, m_manager.getNumberOfBreakpoints(BreakpointType.REGULAR));
m_manager.removeBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x789)))));
assertEquals(0, m_manager.getNumberOfBreakpoints(BreakpointType.REGULAR));
}
Aggregations