Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2008-02-27 13:07:54 +0000
committerAnton Leherbauer2008-02-27 13:07:54 +0000
commit928c56b35e61d06a493e9c77d9f47c05a329681e (patch)
tree0f587b8426ae5f84e9347f10608f80cda0847ce2 /core/org.eclipse.cdt.ui.tests
parent8c248ed68bc4382fe6413b58a1391af74a0e1f90 (diff)
downloadorg.eclipse.cdt-928c56b35e61d06a493e9c77d9f47c05a329681e.tar.gz
org.eclipse.cdt-928c56b35e61d06a493e9c77d9f47c05a329681e.tar.xz
org.eclipse.cdt-928c56b35e61d06a493e9c77d9f47c05a329681e.zip
Fix for 192656: [Formatter] Indentation of class definition
and 191980: [Formatter] Identation of exception specification
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/CodeFormatterTest.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
index 56da77b73ed..12a1d383952 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
@@ -28,6 +28,7 @@ import org.eclipse.cdt.ui.tests.BaseUITestCase;
import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
import org.eclipse.cdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.eclipse.cdt.internal.formatter.align.Alignment;
/**
* Tests for the CodeFormatter.
@@ -491,4 +492,43 @@ public class CodeFormatterTest extends BaseUITestCase {
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, CCorePlugin.DO_NOT_INSERT);
assertFormatterResult();
}
+
+ //class Example: public FooClass, public virtual BarClass {};
+
+ //class Example:
+ // public FooClass,
+ // public virtual BarClass {
+ //};
+ public void testAlignmentOfClassDefinitionBaseClause1_Bug192656() throws Exception {
+ fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BASE_CLAUSE_IN_TYPE_DECLARATION,
+ Integer.toString(Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE));
+ assertFormatterResult();
+ }
+
+ //class Example: public FooClass, public virtual BarClass {};
+
+ //class Example: public FooClass,
+ // public virtual BarClass {
+ //};
+ public void testAlignmentOfClassDefinitionBaseClause2_Bug192656() throws Exception {
+ fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BASE_CLAUSE_IN_TYPE_DECLARATION,
+ Integer.toString(Alignment.M_NEXT_PER_LINE_SPLIT | Alignment.M_FORCE | Alignment.M_INDENT_ON_COLUMN));
+ assertFormatterResult();
+ }
+
+ //class Example: { void foo() throw(int); };
+ //void Example::foo()throw(int){}
+
+ //class Example: {
+ // void foo()
+ // throw(int);
+ //};
+ //void Example::foo()
+ // throw(int) {
+ //}
+ public void testAlignmentOfExceptionSpecificationInMethodDeclaration_Bug191980() throws Exception {
+ fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
+ Integer.toString(Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE | Alignment.M_INDENT_BY_ONE));
+ assertFormatterResult();
+ }
}

Back to the top