diff options
author | Marco Stornelli | 2019-03-16 14:33:43 +0000 |
---|---|---|
committer | Jeff Johnston | 2019-04-05 14:46:32 +0000 |
commit | eff560c583f419d393c3c6d3d8ea2a0c28bd551e (patch) | |
tree | 41d57a4aadbdb390d6cb623e639101482bb6698e /core/org.eclipse.cdt.ui.tests | |
parent | 174aaa05a3121f5268913105191f2469045ac406 (diff) | |
download | org.eclipse.cdt-eff560c583f419d393c3c6d3d8ea2a0c28bd551e.tar.gz org.eclipse.cdt-eff560c583f419d393c3c6d3d8ea2a0c28bd551e.tar.xz org.eclipse.cdt-eff560c583f419d393c3c6d3d8ea2a0c28bd551e.zip |
Bug 299482 - New options to format linkage declarations
Change-Id: Ied06beae3fc28255e2c1b6ba8b23fd69591e3d39
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
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.java | 40 |
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 c56437a0282..10c2d040e84 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 @@ -3850,4 +3850,44 @@ public class CodeFormatterTest extends BaseUITestCase { public void testAttributesWithStructs3_Bug467346() throws Exception { assertFormatterResult(); } + + //extern "C" { + //void func(); + //} + + //extern "C" { + // void func(); + //} + public void testLinkage1_Bug299482() throws Exception { + fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_LINKAGE, + DefaultCodeFormatterConstants.TRUE); + assertFormatterResult(); + } + + //extern "C" { + //void func(); + //} + + //extern "C"{ + //void func(); + //} + public void testLinkage2_Bug299482() throws Exception { + fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_LINKAGE_DECLARATION, + DefaultCodeFormatterConstants.FALSE); + assertFormatterResult(); + } + + //extern "C" { + //void func(); + //} + + //extern "C" + //{ + //void func(); + //} + public void testLinkage3_Bug299482() throws Exception { + fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_LINKAGE_DECLARATION, + DefaultCodeFormatterConstants.NEXT_LINE); + assertFormatterResult(); + } } |