use of org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart in project linuxtools by eclipse.
the class LinkedResourceMarkerTest method testLinkedMarkers.
@Test
public void testLinkedMarkers() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testLinkedMarkers");
ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
IValgrindMessage[] errors = view.getMessages();
ArrayList<IMarker> markers = new ArrayList<>(Arrays.asList(proj.getProject().findMarkers(ValgrindLaunchPlugin.MARKER_TYPE, true, IResource.DEPTH_INFINITE)));
assertEquals(5, markers.size());
for (IValgrindMessage error : errors) {
findMarker(markers, error);
}
assertEquals(0, markers.size());
}
use of org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart in project linuxtools by eclipse.
the class MarkerTest method testMarkers.
@Test
public void testMarkers() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testDefaults");
ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
IValgrindMessage[] errors = view.getMessages();
ArrayList<IMarker> markers = new ArrayList<>(Arrays.asList(proj.getProject().findMarkers(ValgrindLaunchPlugin.MARKER_TYPE, true, IResource.DEPTH_INFINITE)));
assertEquals(5, markers.size());
for (IValgrindMessage error : errors) {
findMarker(markers, error);
}
assertEquals(0, markers.size());
}
use of org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart in project linuxtools by eclipse.
the class WrongDeallocationResolution method removeMessage.
/**
* Removes message from Valgrind view.
* @param message The message to be removed
*/
private void removeMessage(IValgrindMessage message) {
ValgrindViewPart valgrindView = ValgrindUIPlugin.getDefault().getView();
valgrindView.getMessagesViewer().getTreeViewer().remove(message);
}
use of org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart in project linuxtools by eclipse.
the class WrongDeallocationResolution method getMessagesByText.
/**
* Returns all of the messages from the currently active Valgrind view that
* contains a given {@link String} in their description.
* @param text the {@link String} to match the Valgrind messages' descriptions
* @return All messages containing the given text.
*/
private IValgrindMessage[] getMessagesByText(String text) {
ValgrindViewPart valgrindView = ValgrindUIPlugin.getDefault().getView();
ArrayList<IValgrindMessage> foundMessages = new ArrayList<>();
if (valgrindView != null) {
IValgrindMessage[] messages = valgrindView.getMessages();
if (messages != null && messages.length != 0) {
for (IValgrindMessage message : messages) {
if (message.getText().contains(text)) {
foundMessages.add(message);
}
}
}
}
IValgrindMessage[] foundMessagesArray = new IValgrindMessage[foundMessages.size()];
foundMessages.toArray(foundMessagesArray);
return foundMessagesArray;
}
Aggregations