use of com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace in project binnavi by google.
the class PostgreSQLProviderTest method testSetDescription3.
@Test(expected = NullPointerException.class)
public void testSetDescription3() throws CouldntSaveDataException, CouldntLoadDataException {
final INaviProject project = getProvider().loadProjects().get(0);
final CAddressSpace addressSpace = getProvider().createAddressSpace(project, "SOME_OTHER_ADDRESS_SPACE");
getProvider().setDescription(addressSpace, null);
}
use of com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace in project binnavi by google.
the class PostgreSQLProviderTestSetup method testCreateAddressSpace.
@Test
public void testCreateAddressSpace() throws CouldntSaveDataException {
final CAddressSpace addressSpace = getProvider().createAddressSpace(loadProject(), "Test Address Space");
assertNotNull(addressSpace);
}
use of com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace in project binnavi by google.
the class CProjectContent method createAddressSpace.
/**
* Creates a new address space with the given name in the project. The new address space is
* immediately saved to the database.
*
* This function is guaranteed to be exception-safe. If an exception is thrown while saving the
* address space to the database, the project object remains unchanged.
*
* @param name The name of the new address space.
*
* @return The new address space that was created in the project.
*
* @throws CouldntSaveDataException Thrown if the address space couldn't be saved to the database.
*/
public CAddressSpace createAddressSpace(final String name) throws CouldntSaveDataException {
Preconditions.checkNotNull(name, "IE00240: The value null is illegal for address space names");
final CAddressSpace space = m_provider.createAddressSpace(m_project, name);
m_addressSpaces.add(space);
for (final IProjectListener listener : m_listeners) {
try {
listener.addedAddressSpace(m_project, space);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
m_project.getConfiguration().updateModificationDate();
return space;
}
use of com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace in project binnavi by google.
the class CProjectContentTest method testRemoveTrace.
@Test
public void testRemoveTrace() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException, CouldntDeleteException {
final CProjectContent projectContent = new CProjectContent(m_project, m_listeners, m_provider, m_addressSpaces, m_views, m_traces);
@SuppressWarnings("unused") final INaviView view = new MockView(m_provider);
@SuppressWarnings("unused") final INaviView view2 = projectContent.createView("Name", "description");
assertNotNull(CViewFilter.getTaggedViews(projectContent.getViews(), new CTag(4, "foo", "bar", TagType.VIEW_TAG, m_provider)));
final CAddressSpace spaceOne = projectContent.createAddressSpace("Address Space 1");
spaceOne.load();
final CAddressSpace spaceTwo = projectContent.createAddressSpace("Address Space 2");
spaceTwo.load();
final CAddressSpace spaceThree = projectContent.createAddressSpace("Address Space 3");
spaceThree.load();
final CAddressSpace spaceFour = projectContent.createAddressSpace("Address Space 4");
spaceFour.load();
m_project.load();
final TraceList trace = new TraceList(3, "name", "desc", m_provider);
projectContent.removeTrace(trace);
try {
projectContent.removeTrace(null);
fail();
} catch (final NullPointerException e) {
}
final TraceList trace2 = new TraceList(3, "name", "desc", new MockSqlProvider());
try {
projectContent.removeTrace(trace2);
fail();
} catch (final Exception e) {
}
}
use of com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace in project binnavi by google.
the class PostgreSQLProviderTest method testCAddressSpaceLoaderLoadAddressSpaces1.
@Test
public void testCAddressSpaceLoaderLoadAddressSpaces1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final DebuggerTemplateManager debuggerManager = new DebuggerTemplateManager(getProvider());
final CProject project = getProvider().createProject("PROJECT_234");
getProvider().createAddressSpace(project, "ADDRESS_SPACE_234");
final List<INaviModule> modules = getProvider().loadModules();
final List<INaviModule> convertedModules = new ArrayList<INaviModule>();
convertedModules.add(modules.get(0));
final List<CAddressSpace> addressSpaces = PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, convertedModules);
final CAddressSpace addressSpace = addressSpaces.get(0);
addressSpace.load();
addressSpace.getContent().addModule(modules.get(0));
addressSpace.getContent().setImageBase(modules.get(0), new CAddress(0x1234));
@SuppressWarnings("unused") final List<CAddressSpace> addressSpaces2 = PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, convertedModules);
}
Aggregations