use of org.eclipse.cdt.core.model.IFunction in project linuxtools by eclipse.
the class CachegrindFunction method findElement.
private ICElement findElement(String name, IParent parent) throws CModelException {
ICElement element = null;
List<ICElement> dom = parent.getChildrenOfType(ICElement.C_FUNCTION);
dom.addAll(parent.getChildrenOfType(ICElement.C_METHOD));
for (int i = 0; i < dom.size(); i++) {
ICElement func = dom.get(i);
if ((func instanceof IFunction || func instanceof IMethod) && func.getElementName().equals(name)) {
element = func;
}
}
return element;
}
use of org.eclipse.cdt.core.model.IFunction in project linuxtools by eclipse.
the class CModelLabelsTest method testFunctionLabel.
@Test
public void testFunctionLabel() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testFunctionLabel");
CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
CachegrindOutput output = view.getOutputs()[0];
// $NON-NLS-1$
CachegrindFile file = getFileByName(output, "cpptest.cpp");
// $NON-NLS-1$
CachegrindFunction func = getFunctionByName(file, "main");
assertTrue(func.getModel() instanceof IFunction);
checkLabelProvider(func, file);
}
Aggregations