Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2008-03-13 11:32:53 +0000
committerAndrew Ferguson2008-03-13 11:32:53 +0000
commit83b3470a9edbd79f66da26b11ba63d3d43f1b62f (patch)
tree3274eb6ee2c4571930c213a993f2e513a2163162 /core/org.eclipse.cdt.ui.tests
parent2ee490ecf38060997a582bd9ec0d87f3b2afe6be (diff)
downloadorg.eclipse.cdt-83b3470a9edbd79f66da26b11ba63d3d43f1b62f.tar.gz
org.eclipse.cdt-83b3470a9edbd79f66da26b11ba63d3d43f1b62f.tar.xz
org.eclipse.cdt-83b3470a9edbd79f66da26b11ba63d3d43f1b62f.zip
fix behaviour when commenting methods preceded by a macro
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/DefaultCCommentAutoEditStrategyTest.java15
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java32
2 files changed, 40 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/DefaultCCommentAutoEditStrategyTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/DefaultCCommentAutoEditStrategyTest.java
index 88bff2d97bc..8bb388553ce 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/DefaultCCommentAutoEditStrategyTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/DefaultCCommentAutoEditStrategyTest.java
@@ -41,7 +41,7 @@ import org.eclipse.cdt.internal.ui.text.CTextTools;
* Testing the auto indent strategies.
*/
public class DefaultCCommentAutoEditStrategyTest extends AbstractAutoEditTest {
- private HashMap fOptions;
+ private HashMap<String,String> fOptions;
/**
* @param name
@@ -522,6 +522,19 @@ public class DefaultCCommentAutoEditStrategyTest extends AbstractAutoEditTest {
public void testFollowingDeclaration9() {
assertDeclarationFollowingX("void baz(int x) {}");
}
+
+ // #define STATIC static
+ //
+ // class D {
+ // public:
+ // X
+ // STATIC void D::foo(int x) {
+ //
+ // }
+ // };
+ public void testFollowingDeclaration13() throws CoreException {
+ assertDeclarationFollowingX("STATIC void D::foo(int x) {\n \n }");
+ }
// #define MM void foo()
// X
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java
index e6a7a6c479f..2b2b9da6a4a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java
@@ -13,8 +13,6 @@
package org.eclipse.cdt.ui.tests.text.doctools.doxygen;
-import java.util.HashMap;
-
import junit.framework.Test;
import org.eclipse.core.resources.IFile;
@@ -23,7 +21,6 @@ import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
@@ -45,7 +42,6 @@ import org.eclipse.cdt.internal.ui.text.CTextTools;
* Testing the auto indent strategies.
*/
public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEditStrategyTest {
- private HashMap fOptions;
protected ICProject fCProject;
/**
@@ -62,7 +58,6 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
protected void setUp() throws Exception {
super.setUp();
fCProject= CProjectHelper.createCCProject("test"+System.currentTimeMillis(), null);
- fOptions= CCorePlugin.getOptions();
}
/*
@@ -70,7 +65,6 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
*/
protected void tearDown() throws Exception {
CProjectHelper.delete(fCProject);
- CCorePlugin.setOptions(fOptions);
super.tearDown();
}
@@ -332,6 +326,32 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
assertAutoEditBehaviour();
}
+ // #define STATIC static
+ //
+ // class D {
+ // public:
+ // /**X
+ // STATIC void D::foo(int x) {
+ //
+ // }
+ // };
+
+ // #define STATIC static
+ //
+ // class D {
+ // public:
+ // /**
+ // * X
+ // * @param x
+ // */
+ // STATIC void D::foo(int x) {
+ //
+ // }
+ // };
+ public void testAutoDocCommentContent17() throws CoreException {
+ assertAutoEditBehaviour();
+ }
+
protected void assertAutoEditBehaviour() throws CoreException {
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
final IDocument doc = new Document();

Back to the top