Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2008-03-13 15:22:23 +0000
committerAndrew Ferguson2008-03-13 15:22:23 +0000
commitc6068febf4468d4df972e3b94ac3f3d0a48e1e2c (patch)
tree4efeb37dbcfafe8a103905161d0b6851857e0265 /core/org.eclipse.cdt.ui.tests
parent72d5a9c71385607f5654900e4ea2642f0d53a3c6 (diff)
downloadorg.eclipse.cdt-c6068febf4468d4df972e3b94ac3f3d0a48e1e2c.tar.gz
org.eclipse.cdt-c6068febf4468d4df972e3b94ac3f3d0a48e1e2c.tar.xz
org.eclipse.cdt-c6068febf4468d4df972e3b94ac3f3d0a48e1e2c.zip
allow auto-generation of tags for pure virtual declarations, and between function declarators and comment bodies
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/doctools/DocCommentHighlightingTest.java20
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java74
2 files changed, 81 insertions, 13 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
index b12a3a0ad73..a3adb83cbe9 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
@@ -126,8 +126,8 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
}
}
- protected List/*<Position>*/ findRangesColored(RGB rgb) {
- List result= new ArrayList();
+ protected List<Position> findRangesColored(RGB rgb) {
+ List<Position> result= new ArrayList<Position>();
IEditorPart p= get();
ISourceViewer vw= ((CEditor)p).getViewer();
Accessor a= new Accessor(vw, TextViewer.class);
@@ -156,8 +156,8 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
return null;
}
- private List/*<Position>*/ mkPositions(int[][] raw) {
- List result= new ArrayList();
+ private List<Position> mkPositions(int[][] raw) {
+ List<Position> result= new ArrayList<Position>();
for(int i=0; i<raw.length; i++) {
Assert.assertEquals(2, raw[i].length);
result.add(new Position(raw[i][0], raw[i][1]));
@@ -168,42 +168,42 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
public void testDCOM_A() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerA"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment1, scomment1});
+ List<Position> expected= mkPositions(new int[][] {comment1, scomment1});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
public void testDCOM_B() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerB"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment2, scomment2});
+ List<Position> expected= mkPositions(new int[][] {comment2, scomment2});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
public void testDCOM_C() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerC"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment3, scomment3});
+ List<Position> expected= mkPositions(new int[][] {comment3, scomment3});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
public void testDCOM_ABC() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerABC"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment1, comment2, comment3, scomment1, scomment2, scomment3});
+ List<Position> expected= mkPositions(new int[][] {comment1, comment2, comment3, scomment1, scomment2, scomment3});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
public void testDCOM_BDFG() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerBDFG"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment2, comment4, comment6, comment7, comment8, scomment2});
+ List<Position> expected= mkPositions(new int[][] {comment2, comment4, comment6, comment7, comment8, scomment2});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
public void testDCOM_PUNC() throws BadLocationException, InterruptedException {
DCMAN.setCommentOwner(fCProject.getProject(), DCMAN.getOwner("org.cdt.test.ownerPUNC"), true);
runEventQueue(1000);
- List/*<Position>*/ expected= mkPositions(new int[][] {comment9, comment10, scomment4, scomment5, comment11, comment12, scomment7});
+ List<Position> expected= mkPositions(new int[][] {comment9, comment10, scomment4, scomment5, comment11, comment12, scomment7});
assertEquals(expected, findRangesColored(TestGenericTagConfiguration.DEFAULTRGB));
}
}
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 2b2b9da6a4a..3818e2bc7f1 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
@@ -236,10 +236,43 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
// * @param x
// */
// {}
- public void _testAutoDocCommentContent9() throws CoreException {
+ public void testAutoDocCommentContent9() throws CoreException {
+ assertAutoEditBehaviour();
+ }
+
+ // /**
+ // *
+ // */
+ // void foo_bar(int x)
+ // /**X
+ // {}
+
+ // /**
+ // *
+ // */
+ // void foo_bar(int x)
+ // /**
+ // * X
+ // * @param x
+ // */
+ // {}
+ public void testAutoDocCommentContent9b() throws CoreException {
+ assertAutoEditBehaviour();
+ }
+
+ // void foo_bar(int x)
+ // {
+ // /**X
+ // }
+
+ // void foo_bar(int x)
+ // {
+ // /**
+ // * X
+ // */
+ // }
+ public void testAutoDocCommentContent9c() throws CoreException {
assertAutoEditBehaviour();
- // TODO - desired behaviour when there is a comment preceding the declaration
- // needs defining
}
// void foo_bar(int x)
@@ -352,6 +385,41 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
assertAutoEditBehaviour();
}
+ // class D {
+ // public:
+ // /**X
+ // virtual void foo(D x) = 0;
+ // };
+
+ // class D {
+ // public:
+ // /**
+ // * X
+ // * @param x
+ // */
+ // virtual void foo(D x) = 0;
+ // };
+ public void testAutoDocCommentContent18() throws CoreException {
+ assertAutoEditBehaviour();
+ }
+
+ // class D {
+ // public:
+ // /**X
+ // virtual void foo(D x);
+ // };
+
+ // class D {
+ // public:
+ // /**
+ // * X
+ // */
+ // virtual void foo(D x);
+ // };
+ public void testAutoDocCommentContent19() throws CoreException {
+ assertAutoEditBehaviour();
+ }
+
protected void assertAutoEditBehaviour() throws CoreException {
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
final IDocument doc = new Document();

Back to the top