mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
Fixed tests broken due to enablement of folding in C editor.
This commit is contained in:
parent
39d3edc175
commit
aceb2222db
1 changed files with 13 additions and 10 deletions
|
@ -1,12 +1,13 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2010 Symbian Software Systems and others.
|
* Copyright (c) 2008, 2012 Symbian Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.tests.text.doctools;
|
package org.eclipse.cdt.ui.tests.text.doctools;
|
||||||
|
|
||||||
|
@ -18,6 +19,7 @@ import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import org.eclipse.jface.text.BadLocationException;
|
import org.eclipse.jface.text.BadLocationException;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
import org.eclipse.jface.text.IRegion;
|
import org.eclipse.jface.text.IRegion;
|
||||||
|
@ -46,9 +48,6 @@ import org.eclipse.cdt.ui.tests.BaseUITestCase;
|
||||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
import org.eclipse.cdt.internal.ui.text.doctools.DocCommentOwnerManager;
|
import org.eclipse.cdt.internal.ui.text.doctools.DocCommentOwnerManager;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DocCommentHighlightingTest extends BaseUITestCase {
|
public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
private static final DocCommentOwnerManager DCMAN= DocCommentOwnerManager.getInstance();
|
private static final DocCommentOwnerManager DCMAN= DocCommentOwnerManager.getInstance();
|
||||||
private static final String LINKED_FOLDER= "resources/docComments";
|
private static final String LINKED_FOLDER= "resources/docComments";
|
||||||
|
@ -77,7 +76,6 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
private static final int[] comment12= {449, 19};
|
private static final int[] comment12= {449, 19};
|
||||||
private static final int[] scomment7= {469, 17};
|
private static final int[] scomment7= {469, 17};
|
||||||
|
|
||||||
|
|
||||||
private ICProject fCProject;
|
private ICProject fCProject;
|
||||||
private final String fTestFilename= "/"+PROJECT+"/src/this.cpp";
|
private final String fTestFilename= "/"+PROJECT+"/src/this.cpp";
|
||||||
|
|
||||||
|
@ -95,10 +93,13 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
fCProject= EditorTestHelper.createCProject(PROJECT, LINKED_FOLDER);
|
fCProject= EditorTestHelper.createCProject(PROJECT, LINKED_FOLDER);
|
||||||
CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.REMOVE_TRAILING_WHITESPACE, false);
|
IPreferenceStore preferenceStore = CUIPlugin.getDefault().getPreferenceStore();
|
||||||
AbstractTextEditor fEditor= (CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename), true);
|
preferenceStore.setValue(PreferenceConstants.REMOVE_TRAILING_WHITESPACE, false);
|
||||||
|
preferenceStore.setValue(PreferenceConstants.EDITOR_FOLDING_ENABLED, false);
|
||||||
|
AbstractTextEditor fEditor=
|
||||||
|
(CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename), true);
|
||||||
fSourceViewer= EditorTestHelper.getSourceViewer(fEditor);
|
fSourceViewer= EditorTestHelper.getSourceViewer(fEditor);
|
||||||
// source positions depend on Windows line separator
|
// Source positions depend on Windows line separator
|
||||||
adjustLineSeparator(fSourceViewer.getDocument(), "\r\n");
|
adjustLineSeparator(fSourceViewer.getDocument(), "\r\n");
|
||||||
fEditor.doSave(new NullProgressMonitor());
|
fEditor.doSave(new NullProgressMonitor());
|
||||||
assertTrue(EditorTestHelper.joinReconciler(fSourceViewer, 0, 10000, 100));
|
assertTrue(EditorTestHelper.joinReconciler(fSourceViewer, 0, 10000, 100));
|
||||||
|
@ -111,7 +112,9 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
if (fCProject != null)
|
if (fCProject != null)
|
||||||
CProjectHelper.delete(fCProject);
|
CProjectHelper.delete(fCProject);
|
||||||
|
|
||||||
CUIPlugin.getDefault().getPreferenceStore().setToDefault(PreferenceConstants.REMOVE_TRAILING_WHITESPACE);
|
IPreferenceStore preferenceStore = CUIPlugin.getDefault().getPreferenceStore();
|
||||||
|
preferenceStore.setToDefault(PreferenceConstants.REMOVE_TRAILING_WHITESPACE);
|
||||||
|
preferenceStore.setToDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED);
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue