use of org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot in project linuxtools by eclipse.
the class DoubleClickTest method doDoubleClick.
private void doDoubleClick() {
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifTreeViewer treeViewer = view.getTreeViewer();
MassifSnapshot[] snapshots = view.getSnapshots();
// first detailed
node = snapshots[1].getRoot();
TreePath path = new TreePath(new Object[] { node });
while (node.getChildren().length > 0 && !node.hasSourceFile()) {
node = node.getChildren()[0];
path = path.createChildPath(node);
}
assertTrue(node.hasSourceFile());
treeViewer.getViewer().expandToLevel(node, AbstractTreeViewer.ALL_LEVELS);
TreeSelection selection = new TreeSelection(path);
// do double click
IDoubleClickListener listener = treeViewer.getDoubleClickListener();
listener.doubleClick(new DoubleClickEvent(treeViewer.getViewer(), selection));
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot in project linuxtools by eclipse.
the class MultiProcessTest method testNoExec.
@Test
public void testNoExec() throws CoreException, URISyntaxException, IOException {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testNoExec");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifOutput output = view.getOutput();
assertEquals(1, output.getPids().length);
MassifSnapshot[] snapshots = view.getSnapshots();
assertEquals(8, snapshots.length);
checkSnapshots(snapshots, 400, 8);
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot in project linuxtools by eclipse.
the class SortTest method checkOrder.
private void checkOrder(TableViewer viewer, int column, boolean ascending) {
TableItem[] items = viewer.getTable().getItems();
for (int i = 0; i < items.length - 1; i++) {
MassifSnapshot first = (MassifSnapshot) items[i].getData();
MassifSnapshot second = (MassifSnapshot) items[i + 1].getData();
switch(column) {
case 0:
assertTrue(ascending ? first.getNumber() <= second.getNumber() : first.getNumber() >= second.getNumber());
break;
case 1:
assertTrue(ascending ? first.getTime() <= second.getTime() : first.getTime() >= second.getTime());
break;
case 2:
assertTrue(ascending ? first.getTotal() <= second.getTotal() : first.getTotal() >= second.getTotal());
break;
case 3:
assertTrue(ascending ? first.getHeapBytes() <= second.getHeapBytes() : first.getHeapBytes() >= second.getHeapBytes());
break;
case 4:
assertTrue(ascending ? first.getHeapExtra() <= second.getHeapExtra() : first.getHeapExtra() >= second.getHeapExtra());
break;
case 5:
assertTrue(ascending ? first.getStacks() <= second.getStacks() : first.getStacks() >= second.getStacks());
break;
default:
fail();
}
}
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot in project linuxtools by eclipse.
the class TreeTest method testTreeNodes.
@Test
public void testTreeNodes() throws CoreException, URISyntaxException, IOException {
ILaunchConfiguration config = createConfiguration(proj.getProject());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
wc.doSave();
// $NON-NLS-1$
doLaunch(config, "testTreeNodes");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
TreeViewer treeViewer = view.getTreeViewer().getViewer();
MassifSnapshot[] snapshots = view.getSnapshots();
MassifHeapTreeNode[] nodes = (MassifHeapTreeNode[]) treeViewer.getInput();
for (int i = 0; i < nodes.length; i++) {
// every odd snapshot should be detailed with --detailed-freq=2
// and thus in the tree
assertEquals(snapshots[2 * i + 1].getRoot(), nodes[i]);
}
}
Aggregations