mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Test cases for bugs 277624 and 277625.
This commit is contained in:
parent
934e4908a5
commit
0b4728e54c
1 changed files with 32 additions and 7 deletions
|
@ -36,9 +36,8 @@ import org.eclipse.cdt.internal.ui.text.CIndenter;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class CIndenterTest extends BaseUITestCase {
|
public class CIndenterTest extends BaseUITestCase {
|
||||||
|
private HashMap<String, String> fOptions;
|
||||||
private HashMap fOptions;
|
private Map<String, String> fDefaultOptions;
|
||||||
private Map fDefaultOptions;
|
|
||||||
|
|
||||||
public static TestSuite suite() {
|
public static TestSuite suite() {
|
||||||
return suite(CIndenterTest.class, "_");
|
return suite(CIndenterTest.class, "_");
|
||||||
|
@ -47,11 +46,11 @@ public class CIndenterTest extends BaseUITestCase {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
fDefaultOptions= DefaultCodeFormatterOptions.getDefaultSettings().getMap();
|
fDefaultOptions= DefaultCodeFormatterOptions.getDefaultSettings().getMap();
|
||||||
fOptions= new HashMap();
|
fOptions= new HashMap<String, String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
CCorePlugin.setOptions(new HashMap(fDefaultOptions));
|
CCorePlugin.setOptions(new HashMap<String, String>(fDefaultOptions));
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +344,34 @@ public class CIndenterTest extends BaseUITestCase {
|
||||||
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION,
|
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION,
|
||||||
DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
|
DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
|
||||||
assertIndenterResult();
|
assertIndenterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//x =
|
||||||
|
//0;
|
||||||
|
|
||||||
|
//x =
|
||||||
|
// 0;
|
||||||
|
public void _testWrappedAssignment_277624_1() throws Exception {
|
||||||
|
assertIndenterResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
//x = 2 +
|
||||||
|
//2;
|
||||||
|
|
||||||
|
//x = 2 +
|
||||||
|
// 2;
|
||||||
|
public void _testWrappedAssignment_277624_2() throws Exception {
|
||||||
|
assertIndenterResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
//for (int i = 0;
|
||||||
|
//i < 2; i++)
|
||||||
|
|
||||||
|
//for (int i = 0;
|
||||||
|
// i < 2; i++)
|
||||||
|
public void _testWrappedFor_277625() throws Exception {
|
||||||
|
assertIndenterResult();
|
||||||
|
}
|
||||||
|
|
||||||
//class A
|
//class A
|
||||||
//{
|
//{
|
||||||
|
@ -458,5 +484,4 @@ public class CIndenterTest extends BaseUITestCase {
|
||||||
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.TAB);
|
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.TAB);
|
||||||
assertIndenterResult();
|
assertIndenterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue