mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Remove field in test
The field implies that the fSourceViewer has a longer life than it does. But reality is that the viewer is only valid until the editor gets reopened while the test is running.
This commit is contained in:
parent
e157c2fbfe
commit
8ff58a5262
1 changed files with 3 additions and 5 deletions
|
@ -80,8 +80,6 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
private ICProject fCProject;
|
private ICProject fCProject;
|
||||||
private final String fTestFilename = "/" + PROJECT + "/src/this.cpp";
|
private final String fTestFilename = "/" + PROJECT + "/src/this.cpp";
|
||||||
|
|
||||||
private static SourceViewer fSourceViewer;
|
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new TestSuite(DocCommentHighlightingTest.class);
|
return new TestSuite(DocCommentHighlightingTest.class);
|
||||||
}
|
}
|
||||||
|
@ -99,11 +97,11 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
preferenceStore.setValue(PreferenceConstants.EDITOR_FOLDING_ENABLED, false);
|
preferenceStore.setValue(PreferenceConstants.EDITOR_FOLDING_ENABLED, false);
|
||||||
AbstractTextEditor fEditor = (CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename),
|
AbstractTextEditor fEditor = (CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename),
|
||||||
true);
|
true);
|
||||||
fSourceViewer = EditorTestHelper.getSourceViewer(fEditor);
|
SourceViewer sourceViewer = EditorTestHelper.getSourceViewer(fEditor);
|
||||||
// Source positions depend on Windows line separator
|
// Source positions depend on Windows line separator
|
||||||
adjustLineSeparator(fSourceViewer.getDocument(), "\r\n");
|
adjustLineSeparator(sourceViewer.getDocument(), "\r\n");
|
||||||
fEditor.doSave(new NullProgressMonitor());
|
fEditor.doSave(new NullProgressMonitor());
|
||||||
assertTrue(EditorTestHelper.joinReconciler(fSourceViewer, 0, 10000, 100));
|
assertTrue(EditorTestHelper.joinReconciler(sourceViewer, 0, 10000, 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue