use of com.google.security.zynamics.binnavi.debug.models.trace.TraceList in project binnavi by google.
the class CPostgreSQLModuleContentTest method testCreateTrace.
@Test
public void testCreateTrace() throws LoadCancelledException, CouldntLoadDataException, CouldntSaveDataException {
final CModule module = (CModule) getDatabase().getContent().getModules().get(0);
module.load();
final CModuleContent moduleContent1 = module.getContent();
assertNotNull(moduleContent1);
final TraceList trace = moduleContent1.getTraceContainer().createTrace("name", "desc");
assertNotNull(trace);
try {
moduleContent1.getTraceContainer().createTrace(null, null);
fail();
} catch (final NullPointerException e) {
}
try {
moduleContent1.getTraceContainer().createTrace("name", null);
fail();
} catch (final NullPointerException e) {
}
try {
moduleContent1.close();
moduleContent1.getTraceContainer().createTrace("name2", "desc2");
fail();
} catch (final IllegalStateException e) {
}
}
use of com.google.security.zynamics.binnavi.debug.models.trace.TraceList in project binnavi by google.
the class CPostgreSQLModuleContentTest method testCModuleContentConstructor.
@Test
public void testCModuleContentConstructor() throws LoadCancelledException, CouldntLoadDataException {
final CModule module = (CModule) getDatabase().getContent().getModules().get(0);
module.load();
final ListenerProvider<IModuleListener> listeners = new ListenerProvider<IModuleListener>();
final CCallgraph callgraph = module.getContent().getNativeCallgraph();
final IFilledList<INaviFunction> functions = new FilledList<INaviFunction>();
functions.add(module.getContent().getFunctionContainer().getFunctions().get(0));
final ICallgraphView nativeCallgraph = module.getContent().getViewContainer().getNativeCallgraphView();
final ImmutableList<IFlowgraphView> nativeFlowgraphs = module.getContent().getViewContainer().getNativeFlowgraphViews();
final List<INaviView> customViews = new ArrayList<INaviView>();
final ImmutableBiMap<INaviView, INaviFunction> viewFunctionMap = new ImmutableBiMap.Builder<INaviView, INaviFunction>().build();
new Pair<HashMap<INaviView, INaviFunction>, HashMap<INaviFunction, INaviView>>(null, null);
final IFilledList<TraceList> traces = new FilledList<TraceList>();
final SectionContainer sections = new SectionContainer(new SectionContainerBackend(getProvider(), module));
final TypeInstanceContainer instances = new TypeInstanceContainer(new TypeInstanceContainerBackend(getProvider(), module, module.getTypeManager(), sections), getProvider());
final CModuleContent moduleContent1 = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, traces, sections, instances);
assertNotNull(moduleContent1);
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(null, null, null, null, null, null, null, null, null, null, sections, instances);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, null, null, null, null, null, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), null, null, null, null, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, null, null, null, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, null, null, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, null, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, null, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, null, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, null, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, null, null, null);
fail();
} catch (final NullPointerException e) {
}
try {
@SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, traces, null, null);
fail();
} catch (final NullPointerException e) {
}
}
use of com.google.security.zynamics.binnavi.debug.models.trace.TraceList in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFunctionsSetDescription4.
@Test(expected = NullPointerException.class)
public void testTraceFunctionsSetDescription4() throws CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE", "SOME_TRACE_DESCRIPTION");
final TraceList trace = project.getContent().getTraces().get(0);
PostgreSQLTraceFunctions.setDescription((AbstractSQLProvider) getProvider(), trace, null);
}
use of com.google.security.zynamics.binnavi.debug.models.trace.TraceList in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFuntionsSetName1.
@Test
public void testTraceFuntionsSetName1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE_2344", "SOME_TRACE_DESCRIPTION_1235");
project.load();
final TraceList trace = project.getContent().getTraces().get(0);
assertEquals("SOME_TRACE_DESCRIPTION_1235", project.getContent().getTraces().get(0).getDescription());
final String name = "boing boing";
PostgreSQLTraceFunctions.setName((AbstractSQLProvider) getProvider(), trace, name);
project.close();
INaviProject project2 = null;
for (final INaviProject cProject : getProvider().loadProjects()) {
if (cProject.getConfiguration().getId() == project.getConfiguration().getId()) {
project2 = cProject;
}
}
getProvider().createTrace(project2, "SOME_TRACE_2", "SOME_TRACE_DESCRIPTION_2");
project2.load();
final TraceList trace2 = project2.getContent().getTraces().get(0);
assertEquals(name, trace2.getName());
}
use of com.google.security.zynamics.binnavi.debug.models.trace.TraceList in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFuntionsSetName4.
@Test(expected = NullPointerException.class)
public void testTraceFuntionsSetName4() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE_2344", "SOME_TRACE_DESCRIPTION_1235");
project.load();
final TraceList trace = project.getContent().getTraces().get(0);
PostgreSQLTraceFunctions.setName((AbstractSQLProvider) getProvider(), trace, null);
}
Aggregations