use of org.eclipse.cdt.core.model.IMethod in project linuxtools by eclipse.
the class CModelLabelsTest method testNestedMethodLabel.
@Test
public void testNestedMethodLabel() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testNestedMethodLabel");
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, "A::B::e()");
assertTrue(func.getModel() instanceof IMethod);
checkLabelProvider(func, file);
}
use of org.eclipse.cdt.core.model.IMethod 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.IMethod in project linuxtools by eclipse.
the class CModelLabelsTest method testMethodLabel.
@Test
public void testMethodLabel() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testMethodLabel");
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, "A::A()");
assertTrue(func.getModel() instanceof IMethod);
checkLabelProvider(func, file);
}
Aggregations