Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-11-21 15:47:46 +0000
committerLars Vogel2016-11-21 15:47:46 +0000
commit1d96180c906862e01c68adb3bbc8c1892f1601b8 (patch)
treed87d76beac9d628db1e34fae5fa5016c79585f23
parentac57c750e227a255c0d7f2feaa5df5d934402745 (diff)
downloadeclipse.platform.swt-1d96180c906862e01c68adb3bbc8c1892f1601b8.tar.gz
eclipse.platform.swt-1d96180c906862e01c68adb3bbc8c1892f1601b8.tar.xz
eclipse.platform.swt-1d96180c906862e01c68adb3bbc8c1892f1601b8.zip
Bug 507891 - Remove trailing whitespace in org.eclipse.swt.tests
Change-Id: I2298e9636f991ea8e70b35588e5babe0bb3f154a Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java92
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java100
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java18
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleTextEvent.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java28
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java14
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java76
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java28
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java146
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java94
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java28
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java50
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java56
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java10
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java162
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java274
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java30
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java8
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java10
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java12
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java32
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java12
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java22
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandItem.java10
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java8
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java12
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java364
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java8
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java54
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java30
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java274
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java26
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java314
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/SwtPerformanceTestCase.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java44
62 files changed, 1298 insertions, 1298 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
index 2881c23d90..484950c948 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
@@ -23,13 +23,13 @@ public class ConsistencyUtility {
static HashMap<String, String[]> eventOrdering = new HashMap<>();
static HashMap<String, Integer> eventTypes = new HashMap<>();
static {
-
+
eventOrdering.put("DoubleClick", new String[] {"MouseDown", "Selection:", "MouseUp", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
eventOrdering.put("DragDetect", new String[] {"MouseDown", "DragDetect", "MouseUp"});
eventOrdering.put("EnterSelection", new String[] {"Traverse:Return", "KeyDown", "DefaultSelection", "KeyUp"});
eventOrdering.put("KeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:", "KeyUp"});
eventOrdering.put("MenuDetect", new String[] {"MouseDown", "MenuDetect", "MouseUp"});
-
+
eventOrdering.put("ButtonMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
eventOrdering.put("ComboMouseSelection", new String[] {"MouseDown", "MouseUp", "Verify", "Modify", "Selection:"});
eventOrdering.put("CComboMouseSelection", new String[] {"Modify", "Selection:"});
@@ -42,7 +42,7 @@ public class ConsistencyUtility {
eventOrdering.put("TreeMouseSelection", new String[] {"MouseDown", "Selection:", "MouseUp" });
eventOrdering.put("TableTreeMouseSelection",new String[] {"MouseDown", "Selection:", "MouseUp" });
eventOrdering.put("CTabFolderMouseSelection",new String[] {"Selection:", "MouseDown", "MouseUp" });
-
+
eventOrdering.put("ListDoubleClick", new String[] {"MouseDown", "MouseUp", "Selection:", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
eventOrdering.put("ButtonEnterSelection", new String[] {"Traverse:Return", "KeyDown", "KeyUp"});
eventOrdering.put("ExpandBarEnterSelection",new String[] {"Traverse:Return", "Selection:", "KeyDown", "KeyUp"});
@@ -52,25 +52,25 @@ public class ConsistencyUtility {
eventOrdering.put("TableTreeDragDetect", new String[] {"MouseDown", "Selection:", "DragDetect", "MouseUp"});
eventOrdering.put("TableMenuDetect", new String[] {"MenuDetect", "MouseDown", "Selection:", "MouseUp"});
eventOrdering.put("TableTreeMenuDetect", new String[] {"MenuDetect", "MouseDown", "Selection:", "MouseUp"});
-
+
eventOrdering.put("ButtonSpaceSelection", new String[] {"Traverse:Mnemonic", "KeyDown", "KeyUp", "Selection:"});
eventOrdering.put("ExpandBarSpaceSelection",new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
eventOrdering.put("ListSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
eventOrdering.put("ToolBarSpaceSelection", new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
eventOrdering.put("TreeSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("TableTreeSpaceSelection",new String[] {"KeyDown", "KeyUp"});
-
+ eventOrdering.put("TableTreeSpaceSelection",new String[] {"KeyDown", "KeyUp"});
+
eventOrdering.put("ComboKeySelection", new String[] {"KeyDown", "Verify", "Modify", "Selection:", "KeyUp"});
eventOrdering.put("CComboKeySelection", new String[] {"Traverse:Arrow Next", "Modify", "Selection:", "KeyDown", "KeyUp"});
eventOrdering.put("CTabFolderKeySelection", new String[] {"Traverse:Arrow Next", "Selection:", "KeyDown", "KeyUp"});
eventOrdering.put("SliderKeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:Arrow Down", "KeyUp" });
-
+
eventOrdering.put("SliderArrowSelection", new String[] {"MouseDown", "Selection:Arrow Down", "MouseUp" });
-
+
eventOrdering.put("CoolBarChevronDragDetect",new String[] {"MouseDown", "DragDetect"});
eventOrdering.put("CoolBarChevronMenuDetect",new String[] {"MouseDown", "Selection:Arrow"});
eventOrdering.put("CoolBarChevronMouseSelection",new String[] {"MouseDown", "Selection:Arrow", });
-
+
eventOrdering.put("ScaleTroughSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
eventOrdering.put("SliderTroughSelection", new String[] {"MouseDown", "Selection:Page Down", "MouseUp" });
eventOrdering.put("ScaleThumbSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
@@ -80,22 +80,22 @@ public class ConsistencyUtility {
eventOrdering.put("ShellDispose", new String[] {"Dispose"});
eventOrdering.put("ShellIconify", new String[] {"FocusOut", "Iconify", "Deactivate", "Deiconify", "Activate", "FocusIn", "Activate"});
eventOrdering.put("ShellOpen", new String[] {"Activate", "FocusIn", "Show"});
-
+
eventOrdering.put("TabFolderPgdwnSelection",new String[] {"KeyDown", "Traverse:Page Next", "Selection:", "KeyUp", "KeyUp"});
eventOrdering.put("TabFolderPgupSelection", new String[] {"KeyDown", "Traverse:Page Previous", "Selection:", "KeyUp", "KeyUp"});
eventOrdering.put("CTabFolderPgdwnSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
eventOrdering.put("CTabFolderPgupSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
-
+
eventOrdering.put("StyledTextModify", new String[] {"Verify", "Modify", "KeyDown", "KeyUp"});
- eventOrdering.put("TextModify", new String[] {"KeyDown", "Verify", "Modify", "KeyUp"});
-
+ eventOrdering.put("TextModify", new String[] {"KeyDown", "Verify", "Modify", "KeyUp"});
+
eventOrdering.put("TreeKeyExpand", new String[] {"Traverse:Arrow Next", "KeyDown", "Expand", "KeyUp"});
eventOrdering.put("TreeMouseExpand", new String[] {"Expand", "MouseDown", "MouseUp"});
eventOrdering.put("TableTreeKeyExpand", new String[] {"Traverse:Arrow Next", "Expand", "KeyDown", "KeyUp"});
eventOrdering.put("TableTreeMouseExpand", new String[] {"Expand", "MouseDown", "Selection:", "MouseUp"});
-
+
eventOrdering.put("TableTreeTable", new String[] {"MouseDown", "MouseUp", "MouseDoubleClick", "KeyDown", "KeyUp", "MenuDetect", "DragDetect", "Traverse"});
-
+
eventTypes.put("None", Integer.valueOf(SWT.None));
eventTypes.put("KeyDown", Integer.valueOf(SWT.KeyDown));
eventTypes.put("KeyUp", Integer.valueOf(SWT.KeyUp));
@@ -134,9 +134,9 @@ public class ConsistencyUtility {
eventTypes.put("MenuDetect", Integer.valueOf(SWT.MenuDetect));
eventTypes.put("SetData", Integer.valueOf(SWT.SetData));
}
-
+
static String[] eventNames = {
- "None", "KeyDown", "KeyUp", "MouseDown",
+ "None", "KeyDown", "KeyUp", "MouseDown",
"MouseUp", "MouseMove", "MouseEnter", "MouseExit",
"MouseDoubleClick", "Paint", "Move", "Resize",
"Dispose", "Selection", "DefaultSelection", "FocusIn",
@@ -146,7 +146,7 @@ public class ConsistencyUtility {
"Help", "DragDetect", "Arm", "Traverse",
"MouseHover", "HardKeyDown", "HardKeyUp", "MenuDetect",
"SetData"};
-
+
static int[] convertEventNames(String[] origNames) {
String[] names = new String[origNames.length];
System.arraycopy(origNames, 0, names, 0, origNames.length);
@@ -157,7 +157,7 @@ public class ConsistencyUtility {
}
return types;
}
-
+
private static String[] removeDuplicates(String[] names) {
int dups=0;
for(int i=0; i<names.length; i++) {
@@ -178,13 +178,13 @@ public class ConsistencyUtility {
System.arraycopy(names, 0, temp, 0, names.length-dups);
return temp;
}
-
+
public static String[] selectionTypes = {
- "Drag", "Home", "End", "Arrow Down",
- "Arrow Up", "Page Down", "Page Up", "Check",
- "Arrow",
+ "Drag", "Home", "End", "Arrow Down",
+ "Arrow Up", "Page Down", "Page Up", "Check",
+ "Arrow",
};
-
+
public static int[] [] selectionConversion = {
{SWT.DRAG, 0},
{SWT.HOME, 1},
@@ -196,18 +196,18 @@ public class ConsistencyUtility {
{SWT.CHECK, 7},
{SWT.ARROW, 8},
};
-
+
static String getSelectionType(int type) {
for(int i=0; i<selectionConversion.length;i++) {
- if(type == selectionConversion[i][0])
+ if(type == selectionConversion[i][0])
return selectionTypes[selectionConversion[i][1]];
}
return "";
}
-
+
static String[] traversalTypes = {
- "None", "Escape", "Return", "Tab Previous",
- "Tab Next", "Arrow Previous", "Arrow Next", "Mnemonic",
+ "None", "Escape", "Return", "Tab Previous",
+ "Tab Next", "Arrow Previous", "Arrow Next", "Mnemonic",
"Page Previous", "Page Next"};
static String getTraversalType(int type) {
@@ -225,10 +225,10 @@ public class ConsistencyUtility {
static final int MOUSE_DOUBLECLICK = 40;
static final int MOUSE_DRAG = 50;
static final int SELECTION = 60;
-
+
static final int ESCAPE_MENU = 1;
-
-
+
+
//posts a click at display mapped x and y with button button
static boolean postClick(Display display, int x, int y, int button) {
Event event = new Event();
@@ -239,7 +239,7 @@ public class ConsistencyUtility {
System.out.println("MouseMove not posted");
return false;
}
-
+
event = new Event();
event.type = SWT.MouseDown;
event.button = button;
@@ -257,26 +257,26 @@ public class ConsistencyUtility {
return false;
}
// try {
-// Thread.sleep(1600);
+// Thread.sleep(1600);
// } catch(InterruptedException ie) {}
return true;
}
-
+
static boolean postClick(Display display, Point pt, int button) {
return postClick(display, pt.x, pt.y, button);
}
-
+
//doubleclicks at display mapped pt with button button
static boolean postDoubleClick(Display display, Point pt, int button) {
boolean ret = postClick(display, pt, button);
ret &= postClick(display, pt, button);
// try {
-// Thread.sleep(1600);
+// Thread.sleep(1600);
// } catch(InterruptedException ie) {}
return ret;
}
-
- //post a key press
+
+ //post a key press
static boolean postKeyPress(Display display, int ch, int keycode) {
Event event = new Event();
event.type = SWT.KeyDown;
@@ -298,9 +298,9 @@ public class ConsistencyUtility {
}
return true;
}
-
+
//post pressing and holding ch1/keycode1 and then pressing ch2/keycode2
- static boolean postDoubleKeyPress(Display display, int ch1, int keycode1,
+ static boolean postDoubleKeyPress(Display display, int ch1, int keycode1,
int ch2, int keycode2) {
Event event = new Event();
event.type = SWT.KeyDown;
@@ -323,7 +323,7 @@ public class ConsistencyUtility {
}
return true;
}
-
+
//posts a drag from display mapped origin to destination
//the button to drag with is system dependent
static boolean postDrag(Display display, Point origin, Point destination) {
@@ -336,7 +336,7 @@ public class ConsistencyUtility {
System.out.println("MouseMove not posted");
return false;
}
-
+
event = new Event();
event.type = SWT.MouseDown;
event.button = button;
@@ -344,7 +344,7 @@ public class ConsistencyUtility {
System.out.println("MouseDown not posted");
return false;
}
-
+
event = new Event();
event.type = SWT.MouseMove;
event.x = destination.x;
@@ -372,7 +372,7 @@ public class ConsistencyUtility {
return 1;
return 2;
}
-
+
//posts a selection ie clicks on pt1, then click on pt2 (for example, selecting
//one of the options in a combo by dropping down the list)
static boolean postSelection(final Display display, Point pt1, Point pt2) {
@@ -395,6 +395,6 @@ public class ConsistencyUtility {
} else if(SwtTestUtil.isLinux) {
x += -16;
}
- return postClick(display, x, y, button);
+ return postClick(display, x, y, button);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
index 2de1e666ef..4d42a105bb 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
@@ -17,14 +17,14 @@ import java.lang.reflect.Method;
import org.eclipse.swt.SWT;
/**
* Use this test class to validate an implementation of the StyledTextContent
- * interface. To perform the validation, copy this class to the package where
+ * interface. To perform the validation, copy this class to the package where
* your StyledTextContent implementation lives. Then specify the fully qualified
- * name of your StyledTextContent class as an argument to the main method of this
- * class.
- *
- * NOTE: This test class assumes that your StyledTextContent implementation
+ * name of your StyledTextContent class as an argument to the main method of this
+ * class.
+ *
+ * NOTE: This test class assumes that your StyledTextContent implementation
* handles the following delimiters:
- *
+ *
* /r
* /n
* /r/n
@@ -50,14 +50,14 @@ public class StyledTextContentSpec implements TextChangeListener {
boolean failed = false;
StyledText widget = null;
Shell shell = null;
-
+
public StyledTextContentSpec() {
}
public void assertTrue(String message, boolean condition) {
System.out.print("\t" + currentMethod.getName() + " " + message);
- if (!condition)
+ if (!condition)
fail(message);
- else
+ else
System.out.println(" passed");
}
public void fail(String message) {
@@ -71,7 +71,7 @@ public StyledTextContent getContentInstance() {
return contentInstance;
}
public static String getTestText() {
- return
+ return
"This is the first line.\r\n" +
"This is the second line.\r\n" +
"This is the third line.\r\n" +
@@ -152,7 +152,7 @@ public void run() {
} else {
System.out.println("FAILED");
}
- }
+ }
} catch (InvocationTargetException ex) {
System.out.println("\t" + currentMethod.getName() + " ERROR ==> " + ex.getTargetException().toString());
System.out.println("FAILED");
@@ -271,7 +271,7 @@ public void textChanging(TextChangingEvent event) {
public void test_Insert() {
StyledTextContent content = getContentInstance();
String newText;
-
+
content.setText("This\nis a test\r");
content.replaceTextRange(0, 0, "test\n ");
newText = content.getTextRange(0, content.getCharCount());
@@ -317,7 +317,7 @@ public void test_Insert() {
assertTrue(":4d:", content.getLine(1).equals("This"));
assertTrue(":4e:", content.getLine(2).equals("is a test"));
assertTrue(":4f:", content.getLine(3).isEmpty());
-
+
content.setText("This\nis a test\r");
content.replaceTextRange(7, 0, "\r\nnewLine");
newText = content.getTextRange(0, content.getCharCount());
@@ -373,7 +373,7 @@ public void test_Insert() {
assertTrue(":9c:", content.getLine(0).equals("This"));
assertTrue(":9d:", content.getLine(1).equals("*** is a test"));
assertTrue(":9e:", content.getLine(2).isEmpty());
-
+
content.setText("This\n");
content.replaceTextRange(5, 0, "line");
newText = content.getTextRange(0, content.getCharCount());
@@ -384,7 +384,7 @@ public void test_Insert() {
assertTrue(":10e:", content.getLineAtOffset(8) == 1);
assertTrue(":10f:", content.getLineAtOffset(9) == 1);
- // insert at beginning
+ // insert at beginning
content.setText("This\n");
content.replaceTextRange(0, 0, "line\n");
newText = content.getTextRange(0, content.getCharCount());
@@ -446,21 +446,21 @@ public void test_Empty() {
}
public void test_Line_Conversion() {
StyledTextContent content = getContentInstance();
-
+
content.setText("This\nis a test\rrepeat\nend\r");
- assertTrue(":1a:", content.getLineCount() == 5);
+ assertTrue(":1a:", content.getLineCount() == 5);
assertTrue(":1b:", content.getLine(0).equals("This"));
- assertTrue(":1c:", content.getOffsetAtLine(0) == 0);
+ assertTrue(":1c:", content.getOffsetAtLine(0) == 0);
assertTrue(":1d:", content.getLine(1).equals("is a test"));
assertTrue(":1e:", content.getLineAtOffset(4) == 0);
- assertTrue(":1f:", content.getOffsetAtLine(1) == 5);
+ assertTrue(":1f:", content.getOffsetAtLine(1) == 5);
assertTrue(":1g:", content.getLine(2).equals("repeat"));
- assertTrue(":1h:", content.getOffsetAtLine(2) == 15);
+ assertTrue(":1h:", content.getOffsetAtLine(2) == 15);
assertTrue(":1i:", content.getLine(3).equals("end"));
assertTrue(":1j:", content.getOffsetAtLine(3) == 22);
assertTrue(":1k:", content.getLine(4).isEmpty());
assertTrue(":1l:", content.getOffsetAtLine(4) == 26);
-
+
content.setText("This\r\nis a test");
assertTrue(":2a:", content.getLineCount() == 2);
assertTrue(":2b:", content.getLine(1).equals("is a test"));
@@ -471,7 +471,7 @@ public void test_Line_Conversion() {
assertTrue(":3a:", content.getLineCount() == 3);
assertTrue(":3b:", content.getLine(1).equals("is a test"));
assertTrue(":3c:", content.getLineAtOffset(15) == 1);
-
+
content.setText("\r\n");
assertTrue(":4a:", content.getLineCount() == 2);
assertTrue(":4b:", content.getLine(0).isEmpty());
@@ -483,24 +483,24 @@ public void test_Line_Conversion() {
content.setText("\r\n\n\r\r\n");
assertTrue(":5a:", content.getLineCount() == 5);
assertTrue(":5b:", content.getLine(0).isEmpty());
- assertTrue(":5c:", content.getOffsetAtLine(0) == 0);
+ assertTrue(":5c:", content.getOffsetAtLine(0) == 0);
assertTrue(":5d:", content.getLine(1).isEmpty());
- assertTrue(":5e:", content.getOffsetAtLine(1) == 2);
+ assertTrue(":5e:", content.getOffsetAtLine(1) == 2);
assertTrue(":5f:", content.getLine(2).isEmpty());
- assertTrue(":5g:", content.getOffsetAtLine(2) == 3);
+ assertTrue(":5g:", content.getOffsetAtLine(2) == 3);
assertTrue(":5h:", content.getLine(3).isEmpty());
assertTrue(":5i:", content.getOffsetAtLine(3) == 4);
assertTrue(":5j:", content.getLine(4).isEmpty());
assertTrue(":5k:", content.getOffsetAtLine(4) == 6);
-
+
content.setText("test\r\rtest2\r\r");
assertTrue(":6a:", content.getLineCount() == 5);
assertTrue(":6b:", content.getLine(0).equals("test"));
assertTrue(":6c:", content.getOffsetAtLine(0) == 0);
assertTrue(":6d:", content.getLine(1).isEmpty());
- assertTrue(":6e:", content.getOffsetAtLine(1) == 5);
+ assertTrue(":6e:", content.getOffsetAtLine(1) == 5);
assertTrue(":6f:", content.getLine(2).equals("test2"));
- assertTrue(":6g:", content.getOffsetAtLine(2) == 6);
+ assertTrue(":6g:", content.getOffsetAtLine(2) == 6);
assertTrue(":6h:", content.getLine(3).isEmpty());
assertTrue(":6i:", content.getOffsetAtLine(3) == 12);
assertTrue(":6j:", content.getLine(4).isEmpty());
@@ -508,19 +508,19 @@ public void test_Line_Conversion() {
}
public void test_Offset_To_Line() {
StyledTextContent content = getContentInstance();
-
+
content.setText("This\nis a test\rrepeat\nend\r");
assertTrue(":1a:", content.getLineAtOffset(0) == 0);
assertTrue(":1b:", content.getLineAtOffset(3) == 0);
assertTrue(":1c:", content.getLineAtOffset(4) == 0);
assertTrue(":1d:", content.getLineAtOffset(25) == 3);
assertTrue(":1e:", content.getLineAtOffset(26) == 4);
-
+
content.setText("This\r\nis a test");
assertTrue(":2a:", content.getLineAtOffset(5) == 0);
assertTrue(":2b:", content.getLineAtOffset(6) == 1);
assertTrue(":2c:", content.getLineAtOffset(10) == 1);
-
+
content.setText("\r\n");
assertTrue(":3a:", content.getLineAtOffset(0) == 0);
assertTrue(":3b:", content.getLineAtOffset(1) == 0);
@@ -547,28 +547,28 @@ public void test_Offset_To_Line() {
assertTrue(":6b:", content.getLineAtOffset(1) == 1);
assertTrue(":6c:", content.getLineAtOffset(2) == 2);
assertTrue(":6d:", content.getLineAtOffset(4) == 3);
-
+
content.setText("");
assertTrue(":7a:", content.getLineAtOffset(0) == 0);
-
+
content = getContentInstance();
- assertTrue(":8a:", content.getLineAtOffset(0) == 0);
+ assertTrue(":8a:", content.getLineAtOffset(0) == 0);
}
public void test_Line_To_Offset() {
StyledTextContent content = getContentInstance();
-
+
content.setText("This\nis a test\rrepeat\nend\r");
assertTrue(":1a:", content.getOffsetAtLine(0) == 0);
assertTrue(":1b:", content.getOffsetAtLine(1) == 5);
assertTrue(":1c:", content.getOffsetAtLine(2) == 15);
assertTrue(":1d:", content.getOffsetAtLine(3) == 22);
assertTrue(":1e:", content.getOffsetAtLine(4) == 26);
-
+
content.setText("This\r\nis a test");
assertTrue(":2a:", content.getOffsetAtLine(0) == 0);
assertTrue(":2b:", content.getOffsetAtLine(1) == 6);
-
+
content.setText("\r\n");
assertTrue(":3a:", content.getOffsetAtLine(0) == 0);
assertTrue(":3b:", content.getOffsetAtLine(1) == 2);
@@ -589,14 +589,14 @@ public void test_Line_To_Offset() {
public void test_Delete() {
StyledTextContent content = getContentInstance();
String newText;
-
+
content.setText("This\nis a test\r");
content.replaceTextRange(6, 2, "");
newText = content.getTextRange(0, content.getCharCount());
assertTrue(":1a:", newText.equals("This\nia test\r"));
assertTrue(":1b:", content.getLine(0).equals("This"));
assertTrue(":1c:", content.getLine(1).equals("ia test"));
-
+
content.setText("This\nis a test\r");
content.replaceTextRange(5, 9, "");
newText = content.getTextRange(0, content.getCharCount());
@@ -605,7 +605,7 @@ public void test_Delete() {
assertTrue(":2c:", content.getLine(0).equals("This"));
assertTrue(":2d:", content.getLine(1).isEmpty());
assertTrue(":2e:", content.getLine(2).isEmpty());
-
+
content.setText("This\nis a test\nline 3\nline 4");
content.replaceTextRange(21, 7, "");
newText = content.getTextRange(0, content.getCharCount());
@@ -614,7 +614,7 @@ public void test_Delete() {
assertTrue(":3c:", content.getLine(0).equals("This"));
assertTrue(":3d:", content.getLine(1).equals("is a test"));
assertTrue(":3e:", content.getLine(2).equals("line 3"));
-
+
content.setText("This\nis a test\nline 3\nline 4");
content.replaceTextRange(0, 5, "");
newText = content.getTextRange(0, content.getCharCount());
@@ -705,7 +705,7 @@ public void test_Delete() {
public void test_Replace() {
StyledTextContent content = getContentInstance();
String newText;
-
+
content.setText("This\nis a test\r");
content.replaceTextRange(5, 4, "a");
newText = content.getTextRange(0, content.getCharCount());
@@ -731,7 +731,7 @@ public void test_Replace() {
assertTrue(":3b:",content.getLineCount() == 2);
assertTrue(":3c:", content.getLine(0).equals("This was a test"));
assertTrue(":3d:", content.getLineAtOffset(15) == 0);
-
+
content.setText("Line 1\nLine 2\nLine 3");
content.replaceTextRange(0, 7, "La\nLb\n");
newText = content.getTextRange(0, content.getCharCount());
@@ -764,7 +764,7 @@ public void test_Special_Cases() {
StyledTextContent content = getContentInstance();
assertTrue(":0a:", content.getLineCount() == 1);
assertTrue(":0b:", content.getOffsetAtLine(0) == 0);
-
+
content.setText("This is the input/output text component.");
content.replaceTextRange(0, 0, "\n");
assertTrue(":1a:", content.getLine(0).isEmpty());
@@ -874,10 +874,10 @@ public void test_Special_Cases() {
assertTrue(":7e:", content.getLineCount() == 2);
assertTrue(":7f:", content.getLine(0).isEmpty());
assertTrue(":7g:", content.getLine(1).equals("1bc"));
-
+
content = getContentInstance();
content.replaceTextRange(0,0,"a");
-
+
content.setText("package test;\n/* Line 1\n * Line 2\n */\npublic class SimpleClass {\n}");
content.replaceTextRange(14, 23, "\t/*Line 1\n\t * Line 2\n\t */");
newText = content.getTextRange(0, content.getCharCount());
@@ -932,7 +932,7 @@ public void test_Text_Changed_Event() {
verify = 10;
content.setText("L1\r\n");
- try {content.replaceTextRange(3, 1, "");}
+ try {content.replaceTextRange(3, 1, "");}
catch (IllegalArgumentException ex) {assertTrue(":10:", true);}
verify = 11;
@@ -986,12 +986,12 @@ public void test_Text_Changed_Event() {
public void test_Delimiter_Special_Cases() {
StyledTextContent content = getContentInstance();
String newText;
-
+
content.setText("\nL1\r\nL2\r\n");
content.replaceTextRange(7, 2, "");
newText = content.getTextRange(0, content.getCharCount());
assertTrue(":1:", newText.equals("\nL1\r\nL2"));
-
+
content.setText("L1\r\n");
content.replaceTextRange(2, 2, "test\n\n");
newText = content.getTextRange(0, content.getCharCount());
@@ -1030,7 +1030,7 @@ protected void setUp() {
shell.open ();
}
protected void tearDown() {
- if (shell != null && !shell.isDisposed ())
+ if (shell != null && !shell.isDisposed ())
shell.dispose ();
shell = null;
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java
index b788d7ce7c..9db0510b45 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java
@@ -31,7 +31,7 @@ public class SwtTestUtil {
*/
// run test cases that may themselves be dubious
- // these should be eventually checked to see if
+ // these should be eventually checked to see if
// there is a valid failure or the test is bogus
public static boolean fCheckBogusTestCases = false;
@@ -43,22 +43,22 @@ public class SwtTestUtil {
// make dialog open calls, operator must then close them
public static boolean fTestDialogOpen = false;
-
+
public static boolean fTestConsistency = false;
- // used to specify verbose mode, if true unimplemented warning messages will
+ // used to specify verbose mode, if true unimplemented warning messages will
// be written to System.out
public static boolean verbose = false;
-
+
// allow specific image formats to be tested
public static String[] imageFormats = new String[] {"bmp", "jpg", "gif", "png"};
public static String[] imageFilenames = new String[] {"folder", "folderOpen", "target"};
public static String[] invalidImageFilenames = new String[] {"corrupt", "corruptBadBitDepth.png"};
public static String[] transparentImageFilenames = new String[] {"transparent.png"};
-
+
// specify reparentable platforms
public static String[] reparentablePlatforms = new String[] {"win32", "gtk", "cocoa"};
-
+
public static final String testFontName;
public final static boolean isWindows = SWT.getPlatform().startsWith("win32");
public final static boolean isCocoa = SWT.getPlatform().startsWith("cocoa");
@@ -67,11 +67,11 @@ public class SwtTestUtil {
public final static boolean isAIX = System.getProperty("os.name").equals("AIX");
public final static boolean isSolaris = System.getProperty("os.name").equals("Solaris") || System.getProperty("os.name").equals("SunOS");
public final static boolean isHPUX = System.getProperty("os.name").equals("HP-UX");
-
+
static {
testFontName = "Helvetica";
}
-
+
public static void assertSWTProblem(String message, int expectedCode, Throwable actualThrowable) {
if (actualThrowable instanceof SWTError) {
SWTError error = (SWTError) actualThrowable;
@@ -92,7 +92,7 @@ protected static boolean isReparentablePlatform() {
String platform = SWT.getPlatform();
for (int i=0; i<reparentablePlatforms.length; i++) {
if (reparentablePlatforms[i].equals(platform)) return true;
- }
+ }
return false;
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java
index 205041a51c..c32a50efc6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java
@@ -109,7 +109,7 @@ public void test_getMessageLjava_lang_String() {
assertTrue (
"invalid key did not return as itself",
"_NOT_FOUND_IN_PROPERTIES_".equals(SWT.getMessage("_NOT_FOUND_IN_PROPERTIES_")));
-
+
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java
index c9d9c0f82b..821ae9da4c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java
@@ -45,7 +45,7 @@ public void test_ConstructorI() {
public void test_ConstructorILjava_lang_String() {
assertTrue (
"did not fill in code properly",
- new SWTError(SWT.ERROR_CANNOT_BE_ZERO, "An uninteresting message").code
+ new SWTError(SWT.ERROR_CANNOT_BE_ZERO, "An uninteresting message").code
== SWT.ERROR_CANNOT_BE_ZERO);
}
@@ -60,33 +60,33 @@ public void test_ConstructorLjava_lang_String() {
public void test_getMessage() {
assertTrue (
"did not include creation string in result",
- new SWTError(SWT.ERROR_CANNOT_BE_ZERO, "An interesting message").getMessage()
+ new SWTError(SWT.ERROR_CANNOT_BE_ZERO, "An interesting message").getMessage()
.indexOf("An interesting message") >= 0);
}
@Test
public void test_printStackTrace() {
-
+
// WARNING: this test is not CLDC safe, because it requires java.io.PrintStream
-
+
try {
Class.forName("java.io.PrintStream");
} catch (ClassNotFoundException e) {
// ignore test if running on CLDC
return;
}
-
+
// test default SWTError
-
+
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setErr(new PrintStream(out));
SWTError error = new SWTError();
error.printStackTrace();
assertTrue(out.size() > 0);
assertTrue(new String(out.toByteArray()).indexOf("test_printStackTrace") != -1);
-
+
// test SWTError with code
-
+
out = new ByteArrayOutputStream();
System.setErr(new PrintStream(out));
error = new SWTError(SWT.ERROR_INVALID_ARGUMENT);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java
index 1872202772..c2e7dabae3 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java
@@ -46,7 +46,7 @@ public void test_ConstructorI() {
public void test_ConstructorILjava_lang_String() {
assertTrue (
"did not fill in code properly",
- new SWTException(SWT.ERROR_CANNOT_BE_ZERO, "An uninteresting message").code
+ new SWTException(SWT.ERROR_CANNOT_BE_ZERO, "An uninteresting message").code
== SWT.ERROR_CANNOT_BE_ZERO);
}
@@ -61,33 +61,33 @@ public void test_ConstructorLjava_lang_String() {
public void test_getMessage() {
assertTrue (
"did not include creation string in result",
- new SWTException(SWT.ERROR_CANNOT_BE_ZERO, "An interesting message").getMessage()
+ new SWTException(SWT.ERROR_CANNOT_BE_ZERO, "An interesting message").getMessage()
.indexOf("An interesting message") >= 0);
}
@Test
public void test_printStackTrace() {
-
+
// WARNING: this test is not CLDC safe, because it requires java.io.PrintStream
-
+
try {
Class.forName("java.io.PrintStream");
} catch (ClassNotFoundException e) {
// ignore test if running on CLDC
return;
}
-
+
// test default SWTException
-
+
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setErr(new PrintStream(out));
SWTException error = new SWTException();
error.printStackTrace();
assertTrue(out.size() > 0);
assertTrue(new String(out.toByteArray()).indexOf("test_printStackTrace") != -1);
-
+
// test SWTException with code
-
+
out = new ByteArrayOutputStream();
System.setErr(new PrintStream(out));
error = new SWTException(SWT.ERROR_INVALID_ARGUMENT);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java
index d9d49061b5..4e4739025c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java
@@ -31,7 +31,7 @@ import org.junit.Test;
*
* @see org.eclipse.swt.accessibility.Accessible
*/
-public class Test_org_eclipse_swt_accessibility_Accessible {
+public class Test_org_eclipse_swt_accessibility_Accessible {
@Before
public void setUp() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java
index a42b3fe1c6..545136d296 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java
@@ -42,7 +42,7 @@ public void test_ConstructorLjava_lang_Object() {
// The source object should be a widget's accessible.
AccessibleControlEvent event = new AccessibleControlEvent(shell.getAccessible());
assertNotNull(event);
-
+
// Test with some other object also.
event = new AccessibleControlEvent(Integer.valueOf(5));
assertNotNull(event);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java
index bcbfcfd26d..0c2fd4f008 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java
@@ -42,7 +42,7 @@ public void test_ConstructorLjava_lang_Object() {
// The source object should be a widget's accessible.
AccessibleEvent event = new AccessibleEvent(shell.getAccessible());
assertNotNull(event);
-
+
// Test with some other object also.
event = new AccessibleEvent(Integer.valueOf(5));
assertNotNull(event);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleTextEvent.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleTextEvent.java
index 5f619a3759..0eca5de1e3 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleTextEvent.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleTextEvent.java
@@ -42,7 +42,7 @@ public void test_ConstructorLjava_lang_Object() {
// The source object should be a widget's accessible.
AccessibleTextEvent event = new AccessibleTextEvent(shell.getAccessible());
assertNotNull(event);
-
+
// Test with some other object also.
event = new AccessibleTextEvent(Integer.valueOf(5));
assertNotNull(event);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java
index 214eb44874..746fae77d0 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java
@@ -121,7 +121,7 @@ public void test_equalsLjava_lang_Object() {
public void test_hashCode() {
Set<StyleRange> set = new HashSet<>();
Color testColor = new Color(Display.getDefault(), 0, 0, 0);
-
+
//regression test for bug 30924
set.add(new StyleRange());
set.add(new StyleRange(0, 1, testColor, null));
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java
index 41a0dc62a7..f1b1a7bfb6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java
@@ -33,7 +33,7 @@ public class Test_org_eclipse_swt_custom_StyledTextContent {
class ContentImplementation implements StyledTextContent {
String textContent = "";
-
+
@Override
public void addTextChangeListener(TextChangeListener listener){
}
@@ -80,7 +80,7 @@ public class Test_org_eclipse_swt_custom_StyledTextContent {
StyledTextContent content = new ContentImplementation();
Shell shell;
StyledText styledText;
-
+
@Before
public void setUp() {
if (SwtTestUtil.isBidi()) XINSET = 2;
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java
index 451b4ea4c5..5212ba7b7f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java
@@ -66,7 +66,7 @@ public void test_getSelectionCount() {
items[i] = new TableTreeItem(tableTree, SWT.NONE);
}
assertEquals("MULTI: After adding items, but before selecting any", 0, tableTree.getSelectionCount());
-
+
// getSelectionCount() is further tested in test_selectAll and test_setSelection$Lorg_eclipse_swt_custom_TableTreeItem
}
@@ -92,7 +92,7 @@ public void test_selectAll() {
}
selectAll_helper("selectAll()", items);
-
+
/* Now run the same tests on a single-select TableTree. */
singleSelect();
selectAll_helper("Empty table tree", new TableTreeItem[] {});
@@ -113,21 +113,21 @@ public void test_setSelection$Lorg_eclipse_swt_custom_TableTreeItem() {
try {
tableTree.setSelection((TableTreeItem[]) null);
fail("MULTI: No exception thrown for selecting null in empty table tree");
- }
+ }
catch (IllegalArgumentException e) {
}
-
+
int number = 8;
TableTreeItem[] items = new TableTreeItem[number];
for (int i = 0; i < number; i++) {
items[i] = new TableTreeItem(tableTree, 0);
}
-
+
setSelection_helper("Select no items in table tree with items", new TableTreeItem[] {}, new TableTreeItem[] {});
try {
tableTree.setSelection((TableTreeItem[]) null);
fail("MULTI: No exception thrown for selecting null in table tree with items");
- }
+ }
catch (IllegalArgumentException e) {
}
@@ -148,28 +148,28 @@ public void test_setSelection$Lorg_eclipse_swt_custom_TableTreeItem() {
setSelection_helper("Select same item multiple times", new TableTreeItem[] {items[4], items[4], items[4], items[4], items[4], items[4]}, new TableTreeItem[] {items[4]});
setSelection_helper("Select multiple items multiple times", new TableTreeItem[] {items[4], items[0], items[2], items[4], items[4], items[0], items[4], items[2]}, new TableTreeItem[] {items[0], items[2], items[4]});
-
+
/* Now run the same tests on a single-select TableTree. */
singleSelect();
-
+
setSelection_helper("Select no items in empty table tree", new TableTreeItem[] {}, new TableTreeItem[] {});
try {
tableTree.setSelection((TableTreeItem[]) null);
fail("SINGLE: No exception thrown for selecting null in empty table tree");
- }
+ }
catch (IllegalArgumentException e) {
}
-
+
items = new TableTreeItem[number];
for (int i = 0; i < number; i++) {
items[i] = new TableTreeItem(tableTree, 0);
}
-
+
setSelection_helper("Select no items in table tree with items", new TableTreeItem[] {}, new TableTreeItem[] {});
try {
tableTree.setSelection((TableTreeItem[]) null);
fail("SINGLE: No exception thrown for selecting null in table tree with items");
- }
+ }
catch (IllegalArgumentException e) {
}
@@ -224,7 +224,7 @@ private void setSelection_helper(String message, TableTreeItem[] itemsToSelect,
tableTree.setSelection(itemsToSelect);
message = (style == SWT.MULTI ? "MULTI" : "SINGLE") + ": " + message;
assertEquals(message, expectedSelection.length, tableTree.getSelectionCount());
- assertArrayEquals(message, expectedSelection, tableTree.getSelection());
+ assertArrayEquals(message, expectedSelection, tableTree.getSelection());
}
private void createTableTree(List<String> events, boolean traverse) {
@@ -295,7 +295,7 @@ public void test_consistency_DoubleClick () {
List<String> events = new ArrayList<>();
createTableTree(events, true);
consistencyPrePackShell();
- consistencyEvent(20, tableTree.getItemHeight()*2, 1, 0,
+ consistencyEvent(20, tableTree.getItemHeight()*2, 1, 0,
ConsistencyUtility.MOUSE_DOUBLECLICK, events);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java
index 5eb9d305f8..e033c98c4c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java
@@ -25,7 +25,7 @@ public class Test_org_eclipse_swt_custom_TableTreeItem extends Test_org_eclipse_
TableTree tableTree;
TableTreeItem tableTreeItem;
-
+
@Override
@Before
public void setUp() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
index 24c08081a5..39bdb14030 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
@@ -137,7 +137,7 @@ public void test_textChangedLorg_eclipse_swt_custom_TextChangedEvent() {
}
};
content.addTextChangeListener(listener);
-
+
boolean exceptionHandled = false;
verify = 0;
styledText.setText("testing");
@@ -192,7 +192,7 @@ public void test_textChangedLorg_eclipse_swt_custom_TextChangedEvent() {
verify = 0;
styledText.setText("L1\r\n");
verify = 10;
- try {styledText.replaceTextRange(3, 1, "");}
+ try {styledText.replaceTextRange(3, 1, "");}
catch (IllegalArgumentException ex) {
exceptionHandled = true;
}
@@ -387,7 +387,7 @@ public void test_textChangingLorg_eclipse_swt_custom_TextChangingEvent() {
};
content.addTextChangeListener(listener);
- boolean exceptionHandled = false;
+ boolean exceptionHandled = false;
verify = 1;
styledText.setText("testing");
styledText.replaceTextRange(0, 0, "\n");
@@ -431,7 +431,7 @@ public void test_textChangingLorg_eclipse_swt_custom_TextChangingEvent() {
verify = 10;
styledText.setText("L1\r\n");
- try {styledText.replaceTextRange(3, 1, "");}
+ try {styledText.replaceTextRange(3, 1, "");}
catch (IllegalArgumentException ex) {
exceptionHandled = true;
}
@@ -537,7 +537,7 @@ public void test_textSetLorg_eclipse_swt_custom_TextChangedEvent() {
}
};
content.addTextChangeListener(listener);
-
+
verify = 1;
styledText.setText("testing");
@@ -546,10 +546,10 @@ public void test_textSetLorg_eclipse_swt_custom_TextChangedEvent() {
verify = 3;
styledText.setText("a");
-
+
verify = 4;
try {styledText.setText(null);}
- catch (IllegalArgumentException ex) {assertTrue(":4:", true);}
+ catch (IllegalArgumentException ex) {assertTrue(":4:", true);}
content.removeTextChangeListener(listener);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java
index 3bd55983f5..02bf6995e9 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java
@@ -43,19 +43,19 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
// valid color (black)
Color color = new Color(display, 0, 0, 0);
color.dispose();
-
+
// valid color (black with alpha)
color = new Color(display, 0, 0, 0, 0);
color.dispose();
-
+
// valid color (white)
color = new Color(display, 255, 255, 255);
color.dispose();
-
+
// valid color (white with alpha)
color = new Color(display, 255, 255, 255, 0);
color.dispose();
-
+
// valid color (random grey)
color = new Color(display, 20, 20, 20);
color.dispose();
@@ -63,23 +63,23 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
// valid color (random grey with alpha)
color = new Color(display, 20, 20, 20, 0);
color.dispose();
-
+
// valid color (random)
color = new Color(display, 102, 255, 0);
color.dispose();
-
+
// valid color (random with alpha)
color = new Color(display, 102, 255, 0, 0);
color.dispose();
-
+
// device == null (valid)
color = new Color(null, 0, 0, 0);
color.dispose();
-
+
// device == null (valid with alpha)
color = new Color(null, 0, 0, 0, 0);
color.dispose();
-
+
// illegal argument, rgb < 0
try {
color = new Color(display, -10, -10, -10);
@@ -87,7 +87,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
fail("No exception thrown for rgb < 0");
} catch (IllegalArgumentException e) {
}
-
+
// illegal argument, alpha < 0
try {
color = new Color(display, 0, 0, 0, -10);
@@ -95,7 +95,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
fail("No exception thrown for rgba < 0");
} catch (IllegalArgumentException e) {
}
-
+
// illegal argument, rgb > 255
try {
color = new Color(display, 1000, 2000, 3000);
@@ -103,7 +103,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
fail("No exception thrown for rgb > 255");
} catch (IllegalArgumentException e) {
}
-
+
// illegal argument, rgba > 255
try {
color = new Color(display, 1000, 2000, 3000, 4000);
@@ -111,7 +111,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
fail("No exception thrown for rgba > 255");
} catch (IllegalArgumentException e) {
}
-
+
// illegal argument, blue > 255
try {
color = new Color(display, 10, 10, 256);
@@ -119,7 +119,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
fail("No exception thrown for blue > 255");
} catch (IllegalArgumentException e) {
}
-
+
// illegal argument, alpha > 255
try {
color = new Color(display, 10, 10, 10, 256);
@@ -133,47 +133,47 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceIII() {
public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_RGB() {
// Test new Color(Device device, RGB rgb)
// IllegalArgumentException if the red, green or blue argument is not between 0 and 255; or rgb is null
-
+
// valid color (black)
Color color = new Color(display, new RGB(0, 0, 0));
color.dispose();
-
+
// valid color (black with alpha)
color = new Color(display, new RGB(0, 0, 0), 0);
color.dispose();
-
+
// valid color (white)
color = new Color(display, new RGB(255, 255, 255));
color.dispose();
-
+
// valid color (white with alpha)
color = new Color(display, new RGB(255, 255, 255), 0);
color.dispose();
-
+
// valid color (random grey)
color = new Color(display, new RGB(10, 10, 10));
color.dispose();
-
+
// valid color (random grey with alpha)
color = new Color(display, new RGB(10, 10, 10), 0);
color.dispose();
-
+
// valid color (random)
color = new Color(display, new RGB(102, 255, 0));
color.dispose();
-
+
// valid color (random with alpha)
color = new Color(display, new RGB(102, 255, 0), 0);
color.dispose();
-
+
// device == null (valid)
color = new Color(null, new RGB(0, 0, 0));
color.dispose();
-
+
// device == null (valid with alpha)
color = new Color(null, new RGB(0, 0, 0), 0);
color.dispose();
-
+
// illegal argument, rgb < 0
try {
color = new Color(display, new RGB(-10, -10, -10));
@@ -236,47 +236,47 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_gra
public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_RGBA() {
// Test new Color(Device device, RGBA rgba)
// IllegalArgumentException if the red, green, blue or alpha argument is not between 0 and 255; or rgba is null
-
+
// valid color (black)
Color color = new Color(display, new RGBA(0, 0, 0, 255));
color.dispose();
-
+
// valid color (black with alpha)
color = new Color(display, new RGBA(0, 0, 0, 0));
color.dispose();
-
+
// valid color (white)
color = new Color(display, new RGBA(255, 255, 255, 255));
color.dispose();
-
+
// valid color (white with alpha)
color = new Color(display, new RGBA(255, 255, 255, 0));
color.dispose();
-
+
// valid color (random grey)
color = new Color(display, new RGBA(10, 10, 10, 10));
color.dispose();
-
+
// valid color (random grey with alpha)
color = new Color(display, new RGBA(10, 10, 10, 0));
color.dispose();
-
+
// valid color (random)
color = new Color(display, new RGBA(102, 255, 0, 255));
color.dispose();
-
+
// valid color (random with alpha)
color = new Color(display, new RGBA(102, 255, 0, 0));
color.dispose();
-
+
// device == null (valid)
color = new Color(null, new RGBA(0, 0, 0, 255));
color.dispose();
-
+
// device == null (valid with alpha)
color = new Color(null, new RGBA(0, 0, 0, 0));
color.dispose();
-
+
// illegal argument, rgba < 0
try {
color = new Color(display, new RGBA(-10, -10, -10, -10));
@@ -341,7 +341,7 @@ public void test_equalsLjava_lang_Object() {
sameColor2.dispose();
otherColor.dispose();
}
-
+
// With alpha
color = new Color(display, 1, 2, 3, 0);
sameColor = new Color(display, 1, 2, 3, 0);
@@ -374,7 +374,7 @@ public void test_getBlue() {
} finally {
color.dispose();
}
-
+
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
index 6a681ac0e3..9dea2b1fdd 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
@@ -41,9 +41,9 @@ public void setUp() {
@Test
public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_graphics_FontData() {
-
+
// null device argument
-
+
boolean exceptionThrown = false;
try {
FontData[] data = new FontData[1];
@@ -51,11 +51,11 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_gr
font.dispose();
} catch (IllegalArgumentException e) {
exceptionThrown = true;
- }
+ }
assertTrue(exceptionThrown);
-
+
// null data argument
-
+
exceptionThrown = false;
try {
FontData[] data = null;
@@ -63,11 +63,11 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_gr
font.dispose();
} catch (IllegalArgumentException e) {
exceptionThrown = true;
- }
+ }
assertTrue(exceptionThrown);
// zero length data array
-
+
exceptionThrown = false;
try {
FontData[] data = new FontData[0];
@@ -75,11 +75,11 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_gr
font.dispose();
} catch (IllegalArgumentException e) {
exceptionThrown = true;
- }
+ }
assertTrue(exceptionThrown);
-
+
// null data element
-
+
exceptionThrown = false;
try {
FontData[] data = {
@@ -90,7 +90,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_gr
font.dispose();
} catch (IllegalArgumentException e) {
exceptionThrown = true;
- }
+ }
assertTrue("null data element 0",exceptionThrown);
exceptionThrown = false;
@@ -103,8 +103,8 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_gr
font.dispose();
} catch (IllegalArgumentException e) {
exceptionThrown = true;
- }
- assertTrue("null data element 1",exceptionThrown);
+ }
+ assertTrue("null data element 1",exceptionThrown);
}
@Test
@@ -349,7 +349,7 @@ public void test_isDisposed() {
public void test_toString() {
Font font = new Font(display, SwtTestUtil.testFontName, 10, SWT.NORMAL);
assertNotNull(font.toString());
-
+
font.dispose();
assertNotNull(font.toString());
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java
index 8f68f5a3c3..076edcb800 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java
@@ -57,7 +57,7 @@ public void test_ConstructorLjava_lang_StringII() {
new FontData(SwtTestUtil.testFontName, 0, SWT.NORMAL);
// valid font data with 1000 height (pretty big, but apparently valid)
-
+
// valid normal 10-point font data
new FontData(SwtTestUtil.testFontName, 10, SWT.NORMAL);
@@ -108,28 +108,28 @@ public void test_hashCode() {
public void test_setHeightI() {
// Test Font.setHeight(int height)
// valid normal font data for various heights
- FontData fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.NORMAL);
+ FontData fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.NORMAL);
for (int height = 0; height < 1000; height++) {
fontData.setHeight(height);
assertEquals("Wrong height", fontData.getHeight(), height);
}
// valid bold font data for various heights
- fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.BOLD);
+ fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.BOLD);
for (int height = 0; height < 1000; height++) {
fontData.setHeight(height);
assertEquals("Wrong height", fontData.getHeight(), height);
}
// valid italic font data for various heights
- fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.ITALIC);
+ fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.ITALIC);
for (int height = 0; height < 1000; height++) {
fontData.setHeight(height);
assertEquals("Wrong height", fontData.getHeight(), height);
}
// valid bold italic font data for various heights
- fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.BOLD | SWT.ITALIC);
+ fontData = new FontData(SwtTestUtil.testFontName, 10, SWT.BOLD | SWT.ITALIC);
for (int height = 0; height < 1000; height++) {
fontData.setHeight(height);
assertEquals("Wrong height", fontData.getHeight(), height);
@@ -163,7 +163,7 @@ public void test_setNameLjava_lang_String() {
}
// valid name
- fontData.setName(SwtTestUtil.testFontName);
+ fontData.setName(SwtTestUtil.testFontName);
assertEquals("Wrong name", fontData.getName(), SwtTestUtil.testFontName);
// illegal argument, name == null
try {
@@ -178,7 +178,7 @@ public void test_setStyleI() {
// Test Font.setStyle(int style)
for (int height = 0; height < 1000; height++) {
// valid normal font data
- FontData fontData = new FontData(SwtTestUtil.testFontName, height, SWT.NORMAL);
+ FontData fontData = new FontData(SwtTestUtil.testFontName, height, SWT.NORMAL);
assertEquals("Wrong style", fontData.getStyle(), SWT.NORMAL);
// valid bold font data
@@ -188,7 +188,7 @@ public void test_setStyleI() {
// valid italic font data
fontData.setStyle(SWT.ITALIC);
assertEquals("Wrong style", fontData.getStyle(), SWT.ITALIC);
-
+
// valid bold italic font data
fontData.setStyle(SWT.ITALIC | SWT.BOLD);
assertEquals("Wrong style", fontData.getStyle(), SWT.BOLD | SWT.ITALIC);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
index 61c626a22d..e1c423d6cc 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
@@ -69,7 +69,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Drawable() {
} catch (IllegalArgumentException e) {
assertSWTProblem("Incorrect exception thrown for drawable == null", SWT.ERROR_NULL_ARGUMENT, e);
}
-
+
Image image = null;
GC gc1 = null, gc2 = null;
try {
@@ -137,8 +137,8 @@ public void test_copyAreaIIIIII() {
gc.copyArea(0, 0, width, height, destX, destY);
ImageData imageData = image.getImageData();
- PaletteData palette = imageData.palette;
-
+ PaletteData palette = imageData.palette;
+
if (DPIUtil.getDeviceZoom() != 100) {
//TODO Fix non integer scaling factors.
if (SwtTestUtil.verbose) {
@@ -146,13 +146,13 @@ public void test_copyAreaIIIIII() {
}
return;
}
-
+
int pixel = imageData.getPixel(destX + 4, destY);
assertEquals(":a:", whiteRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 6 , destY);
- assertEquals(":b:", blueRGB, palette.getRGB(pixel));
+ assertEquals(":b:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 10, destY);
- assertEquals(":c:", blueRGB, palette.getRGB(pixel));
+ assertEquals(":c:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 12, destY);
assertEquals(":d:", whiteRGB, palette.getRGB(pixel));
}
@@ -163,7 +163,7 @@ public void test_copyAreaLorg_eclipse_swt_graphics_ImageII() {
Color blue = display.getSystemColor(SWT.COLOR_BLUE);
RGB whiteRGB = getRealRGB(white);
RGB blueRGB = getRealRGB(blue);
-
+
gc.setBackground(white);
gc.fillRectangle(image.getBounds());
gc.setBackground(blue);
@@ -171,8 +171,8 @@ public void test_copyAreaLorg_eclipse_swt_graphics_ImageII() {
Image image = new Image(display, 12, 12);
gc.copyArea(image, 0, 0);
ImageData imageData = image.getImageData();
- PaletteData palette = imageData.palette;
-
+ PaletteData palette = imageData.palette;
+
if (DPIUtil.getDeviceZoom() != 100) {
//TODO Fix non integer scaling factors.
if (SwtTestUtil.verbose) {
@@ -181,13 +181,13 @@ public void test_copyAreaLorg_eclipse_swt_graphics_ImageII() {
image.dispose();
return;
}
-
+
int pixel = imageData.getPixel(4, 0);
assertEquals(":a:", whiteRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(5, 0);
assertEquals(":b:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(10, 0);
- assertEquals(":c:", blueRGB, palette.getRGB(pixel));
+ assertEquals(":c:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(11, 0);
assertEquals(":d:", whiteRGB, palette.getRGB(pixel));
image.dispose();
@@ -200,12 +200,12 @@ public void test_dispose() {
@Test
public void test_drawArcIIIIII() {
- gc.drawArc(10, 20, 50, 25, 90, 90);
+ gc.drawArc(10, 20, 50, 25, 90, 90);
}
@Test
public void test_drawFocusIIII() {
- gc.drawFocus(1, 1, 50, 25);
+ gc.drawFocus(1, 1, 50, 25);
}
@Test
@@ -213,7 +213,7 @@ public void test_drawImageLorg_eclipse_swt_graphics_ImageII() {
Color c1 = new Color(display, 255, 0, 0);
Color c2 = new Color(display, 0, 0, 0);
Color c3 = new Color(display, 255, 255, 0);
-
+
PaletteData paletteData = new PaletteData(c1.getRGB(), c2.getRGB(), c3.getRGB());
ImageData data = new ImageData(30,30, 8, paletteData);
for (int y = 0; y < data.height; y++) {
@@ -232,9 +232,9 @@ public void test_drawImageLorg_eclipse_swt_graphics_ImageII() {
for (int x = 0; x < data.width; x++) {
data.setAlpha(x, y, 127);
}
- }
+ }
Image imageAlpha = new Image(display, data);
-
+
gc.drawImage(image, 100, 100);
gc.drawImage(imageTransparent, 130, 100);
gc.drawImage(imageAlpha, 160, 100);
@@ -257,7 +257,7 @@ public void test_drawImageLorg_eclipse_swt_graphics_ImageIIIIIIII() {
Color c1 = new Color(display, 255, 0, 0);
Color c2 = new Color(display, 0, 0, 0);
Color c3 = new Color(display, 255, 255, 0);
-
+
PaletteData paletteData = new PaletteData(c1.getRGB(), c2.getRGB(), c3.getRGB());
ImageData data = new ImageData(30,30, 8, paletteData);
for (int y = 0; y < data.height; y++) {
@@ -276,9 +276,9 @@ public void test_drawImageLorg_eclipse_swt_graphics_ImageIIIIIIII() {
for (int x = 0; x < data.width; x++) {
data.setAlpha(x, y, 127);
}
- }
+ }
Image imageAlpha = new Image(display, data);
-
+
gc.drawImage(image, 10, 5, 20, 15, 100, 120, 50, 60);
gc.drawImage(imageTransparent, 10, 5, 20, 15, 100, 120, 10, 10);
gc.drawImage(imageAlpha, 10, 5, 20, 15, 100, 120, 20, 15);
@@ -303,7 +303,7 @@ public void test_drawLineIIII() {
@Test
public void test_drawOvalIIII() {
- gc.drawOval(10, 0, 20, 30);
+ gc.drawOval(10, 0, 20, 30);
}
@Test
@@ -313,63 +313,63 @@ public void test_drawPointII() {
@Test
public void test_drawPolygon$I() {
- gc.drawPolygon(new int[] {0,0, 5,10, 0,20});
- gc.drawPolygon(new int[] {0,0});
+ gc.drawPolygon(new int[] {0,0, 5,10, 0,20});
+ gc.drawPolygon(new int[] {0,0});
}
@Test
public void test_drawPolyline$I() {
- gc.drawPolyline(new int[] {0,0, 5,10, 0,20});
- gc.drawPolyline(new int[] {0,0});
+ gc.drawPolyline(new int[] {0,0, 5,10, 0,20});
+ gc.drawPolyline(new int[] {0,0});
}
@Test
public void test_drawRectangleIIII() {
- gc.drawRectangle(10, 0, 20, 30);
- gc.drawRectangle(0, 0, 0, 0);
+ gc.drawRectangle(10, 0, 20, 30);
+ gc.drawRectangle(0, 0, 0, 0);
}
@Test
public void test_drawRectangleLorg_eclipse_swt_graphics_Rectangle() {
- gc.drawRectangle(new Rectangle(10, 0, 20, 30));
- gc.drawRectangle(new Rectangle(0, 0, 0, 0));
+ gc.drawRectangle(new Rectangle(10, 0, 20, 30));
+ gc.drawRectangle(new Rectangle(0, 0, 0, 0));
}
@Test
public void test_drawRoundRectangleIIIIII() {
- gc.drawRoundRectangle(10, 0, 20, 30, 3, 3);
- gc.drawRoundRectangle(0, 0, 0, 0, 0, 0);
+ gc.drawRoundRectangle(10, 0, 20, 30, 3, 3);
+ gc.drawRoundRectangle(0, 0, 0, 0, 0, 0);
}
@Test
public void test_drawStringLjava_lang_StringII() {
- gc.drawString("test", 5, 5);
+ gc.drawString("test", 5, 5);
}
@Test
public void test_drawStringLjava_lang_StringIIZ() {
- gc.drawString("test", 5, 5, true);
- gc.drawString("test", 5, 5, false);
+ gc.drawString("test", 5, 5, true);
+ gc.drawString("test", 5, 5, false);
}
@Test
public void test_drawTextLjava_lang_StringII() {
- gc.drawText("test", 5, 5);
- gc.drawText("", 0, 0);
+ gc.drawText("test", 5, 5);
+ gc.drawText("", 0, 0);
}
@Test
-public void test_drawTextLjava_lang_StringIII() {
+public void test_drawTextLjava_lang_StringIII() {
gc.drawText("abc", 5, 5, 0);
gc.drawText("abc", 5, 5, SWT.DRAW_TRANSPARENT);
gc.drawText("abc", 5, 5, SWT.DRAW_DELIMITER);
gc.drawText("abc", 5, 5, SWT.DRAW_MNEMONIC);
gc.drawText("abc", 5, 5, SWT.DRAW_TAB);
gc.drawText("", 0, 0, 0);
- gc.drawText("", 0, 0, SWT.DRAW_TRANSPARENT);
- gc.drawText("", 0, 0, SWT.DRAW_DELIMITER);
- gc.drawText("", 0, 0, SWT.DRAW_MNEMONIC);
- gc.drawText("", 0, 0, SWT.DRAW_TAB);
+ gc.drawText("", 0, 0, SWT.DRAW_TRANSPARENT);
+ gc.drawText("", 0, 0, SWT.DRAW_DELIMITER);
+ gc.drawText("", 0, 0, SWT.DRAW_MNEMONIC);
+ gc.drawText("", 0, 0, SWT.DRAW_TAB);
gc.drawText("\t\r\na&bc&", 5, 5, 0);
gc.drawText("\t\r\na&bc&", 5, 5, SWT.DRAW_TRANSPARENT);
gc.drawText("\t\r\na&bc&", 5, 5, SWT.DRAW_DELIMITER);
@@ -383,10 +383,10 @@ public void test_drawTextLjava_lang_StringIII() {
@Test
public void test_drawTextLjava_lang_StringIIZ() {
- gc.drawText("abc", 5, 5, true);
- gc.drawText("abc", 5, 5, false);
- gc.drawText("", 0, 0, true);
- gc.drawText("", 0, 0, false);
+ gc.drawText("abc", 5, 5, true);
+ gc.drawText("abc", 5, 5, false);
+ gc.drawText("", 0, 0, true);
+ gc.drawText("", 0, 0, false);
}
@Test
@@ -400,49 +400,49 @@ public void test_equalsLjava_lang_Object() {
@Test
public void test_fillArcIIIIII() {
- gc.fillArc(10, 20, 50, 25, 90, 90);
- gc.fillArc(10, 20, 50, 25, -10, -10);
+ gc.fillArc(10, 20, 50, 25, 90, 90);
+ gc.fillArc(10, 20, 50, 25, -10, -10);
}
@Test
public void test_fillGradientRectangleIIIIZ() {
- gc.fillGradientRectangle(10, 0, 20, 30, true);
- gc.fillGradientRectangle(0, 0, 0, 0, true);
- gc.fillGradientRectangle(10, 0, 20, 30, false);
- gc.fillGradientRectangle(0, 0, 0, 0, false);
+ gc.fillGradientRectangle(10, 0, 20, 30, true);
+ gc.fillGradientRectangle(0, 0, 0, 0, true);
+ gc.fillGradientRectangle(10, 0, 20, 30, false);
+ gc.fillGradientRectangle(0, 0, 0, 0, false);
}
@Test
public void test_fillOvalIIII() {
- gc.fillOval(10, 0, 20, 30);
- gc.fillOval(-1, -1, -1, -1);
+ gc.fillOval(10, 0, 20, 30);
+ gc.fillOval(-1, -1, -1, -1);
}
@Test
public void test_fillPolygon$I() {
- gc.fillPolygon(new int[] {0,0, 5,10, 0,20});
- gc.fillPolygon(new int[] {0,0});
- gc.fillPolygon(new int[] {-1, -1});
+ gc.fillPolygon(new int[] {0,0, 5,10, 0,20});
+ gc.fillPolygon(new int[] {0,0});
+ gc.fillPolygon(new int[] {-1, -1});
}
@Test
public void test_fillRectangleIIII() {
- gc.fillRectangle(new Rectangle(10, 0, 20, 30));
- gc.fillRectangle(new Rectangle(0, 0, 0, 0));
- gc.fillRectangle(new Rectangle(-1, -1, -1, -1));
+ gc.fillRectangle(new Rectangle(10, 0, 20, 30));
+ gc.fillRectangle(new Rectangle(0, 0, 0, 0));
+ gc.fillRectangle(new Rectangle(-1, -1, -1, -1));
}
@Test
public void test_fillRectangleLorg_eclipse_swt_graphics_Rectangle() {
- gc.fillRectangle(10, 0, 20, 30);
- gc.fillRectangle(0, 0, 0, 0);
+ gc.fillRectangle(10, 0, 20, 30);
+ gc.fillRectangle(0, 0, 0, 0);
}
@Test
public void test_fillRoundRectangleIIIIII() {
- gc.fillRoundRectangle(10, 0, 20, 30, 3, 3);
- gc.fillRoundRectangle(0, 0, 0, 0, 0, 0);
- gc.fillRoundRectangle(10, 0, 20, 30, -10, -10);
+ gc.fillRoundRectangle(10, 0, 20, 30, 3, 3);
+ gc.fillRoundRectangle(0, 0, 0, 0, 0, 0);
+ gc.fillRoundRectangle(10, 0, 20, 30, -10, -10);
}
@Test
@@ -507,16 +507,16 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
Color color = new Color(shell.getDisplay(), 255, 0, 0);
gc.setBackground(color);
assertEquals(color, gc.getBackground());
- try {
+ try {
gc.setBackground(null);
- fail("No exception thrown for null color");
+ fail("No exception thrown for null color");
} catch (IllegalArgumentException e) {
}
assertEquals(gc.getBackground(),gc.getBackground());
color.dispose();
- try {
+ try {
gc.setBackground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -571,16 +571,16 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() {
Color color = new Color(shell.getDisplay(), 255, 0, 0);
gc.setForeground(color);
assertEquals(color, gc.getForeground());
- try {
+ try {
gc.setForeground(null);
- fail("No exception thrown for null color");
+ fail("No exception thrown for null color");
} catch (IllegalArgumentException e) {
}
assertEquals(gc.getForeground(),gc.getForeground());
color.dispose();
- try {
+ try {
gc.setForeground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -652,7 +652,7 @@ GC gc;
/**
* Return the actual RGB value used for rendering for the given Color.
- * This may be different from the Color's RGB value on lower-color displays
+ * This may be different from the Color's RGB value on lower-color displays
* (16bpp or less).
*/
RGB getRealRGB(Color color) {
@@ -661,7 +661,7 @@ RGB getRealRGB(Color color) {
ImageData imageData;
PaletteData palette;
int pixel;
-
+
imageGc.setBackground(color);
imageGc.setForeground(color);
imageGc.fillRectangle(0, 0, 10, 10);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java
index ae9cbed052..e3e3a51723 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java
@@ -39,7 +39,7 @@ import org.junit.Test;
* @see org.eclipse.swt.graphics.ImageData
*/
public class Test_org_eclipse_swt_graphics_ImageData {
-
+
@Before
public void setUp() {
imageData = new ImageData(IMAGE_DIMENSION, IMAGE_DIMENSION, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
@@ -70,7 +70,7 @@ public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteData() {
fail("No exception thrown for unsupported depth");
} catch (IllegalArgumentException e) {
}
-
+
int[] validDepths = {1, 2, 4, 8, 16, 24, 32};
for (int i = 0; i < validDepths.length; i++) {
new ImageData(1, 1, validDepths[i], new PaletteData(new RGB(0, 0, 0)));
@@ -80,7 +80,7 @@ public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteData() {
@Test
public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteDataI$B() {
byte[] validData = new byte[] {0, 0x4f, 0x4f, 0};
-
+
try {
new ImageData(-1, 1, 1, new PaletteData(new RGB(0, 0, 0)), 1, validData);
fail("No exception thrown for width < 0");
@@ -134,13 +134,13 @@ public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteDataI$B() {
fail("No exception thrown for unsupported depth");
} catch (IllegalArgumentException e) {
}
-
+
// verify all valid depths
int[] validDepths = {1, 2, 4, 8, 16, 24, 32};
for (int i = 0; i < validDepths.length; i++) {
new ImageData(1, 1, validDepths[i], new PaletteData(new RGB(0, 0, 0)), 1, validData);
}
-
+
// verify no divide by zero exception if scanlinePad == 0
try {
new ImageData(1, 1, 8, new PaletteData(new RGB(0, 0, 0)), 0, validData);
@@ -156,14 +156,14 @@ public void test_ConstructorLjava_io_InputStream() {
fail("No exception thrown for InputStream == null");
} catch (IllegalArgumentException|IOException e) {
}
-
-
+
+
try (InputStream stream = SwtTestUtil.class.getResourceAsStream("empty.txt")){
new ImageData(stream);
fail("No exception thrown for invalid InputStream");
} catch (SWTException|IOException e) {
}
-
+
int numFormats = SwtTestUtil.imageFormats.length;
String fileName = SwtTestUtil.imageFilenames[0];
for (int i=0; i<numFormats; i++) {
@@ -215,7 +215,7 @@ public void test_clone() {
@Test
public void test_getAlphaII() {
int value;
-
+
assertEquals(":a:", 255, imageData.getAlpha(0, 0));
value = 0xAA;
imageData.setAlpha(0, 0, value);
@@ -251,11 +251,11 @@ public void test_getAlphaII() {
@Test
public void test_getAlphasIII$BI() {
byte value;
- final int SIZE = 20;
+ final int SIZE = 20;
final int GET_WIDTH = 10;
final int OFFSET = 10;
byte[] alphaData = new byte[SIZE];
-
+
imageData.getAlphas(0, 1, GET_WIDTH, alphaData, OFFSET);
for (int i = 0; i < alphaData.length; i ++) {
if (i < OFFSET) {
@@ -273,12 +273,12 @@ public void test_getAlphasIII$BI() {
if (i < OFFSET) {
assertEquals(":c:", 0, alphaData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":d:", values[i-OFFSET], alphaData[i]);
+ assertEquals(":d:", values[i-OFFSET], alphaData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":e:", 0, alphaData[i]);
}
}
-
+
// exception cases
try {
imageData.getAlphas(0, 1, GET_WIDTH*GET_WIDTH, alphaData, OFFSET);
@@ -320,13 +320,13 @@ public void test_getAlphasIII$BI() {
fail("No exception thrown for getWidth < 0");
} catch (IllegalArgumentException e) {
assertSWTProblem("Incorrect exception thrown for getWidth < 0", SWT.ERROR_INVALID_ARGUMENT, e);
- }
+ }
}
@Test
public void test_getPixelII() {
int value;
-
+
assertEquals(":a:", 0, imageData.getPixel(0, 0));
value = 0xAA;
imageData.setPixel(0, 0, value);
@@ -361,7 +361,7 @@ public void test_getPixelII() {
int height = 3;
int depth = 4;
byte pixelValue = 1;
- byte[] data = {(byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4), (byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4), (byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4)};
+ byte[] data = {(byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4), (byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4), (byte) ((pixelValue << 4) + pixelValue), (byte) (pixelValue << 4)};
imageData = new ImageData(width, height, depth, new PaletteData(new RGB(0, 0, 255), new RGB(111, 111, 111)), 1, data);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
@@ -373,7 +373,7 @@ public void test_getPixelII() {
@Test
public void test_getPixelsIII$BI() {
- final int SIZE = 20;
+ final int SIZE = 20;
final int GET_WIDTH = 10;
final int OFFSET = 10;
byte[] pixelData = new byte[SIZE];
@@ -412,7 +412,7 @@ public void test_getPixelsIII$BI() {
if (i < OFFSET) {
assertEquals(":f:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":g:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":g:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":h:", 0, pixelData[i]);
}
@@ -432,7 +432,7 @@ public void test_getPixelsIII$BI() {
if (i < OFFSET) {
assertEquals(":j:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":k:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":k:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":l:", 0, pixelData[i]);
}
@@ -452,12 +452,12 @@ public void test_getPixelsIII$BI() {
if (i < OFFSET) {
assertEquals(":n:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":o:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":o:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":p:", 0, pixelData[i]);
}
}
-
+
// exception cases
try {
imageData.getPixels(0, 1, GET_WIDTH*GET_WIDTH, pixelData, OFFSET);
@@ -500,7 +500,7 @@ public void test_getPixelsIII$BI() {
} catch (IllegalArgumentException e) {
assertSWTProblem("Incorrect exception thrown for getWidth < 0", SWT.ERROR_INVALID_ARGUMENT, e);
}
- imageData = new ImageData(IMAGE_DIMENSION, IMAGE_DIMENSION, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
+ imageData = new ImageData(IMAGE_DIMENSION, IMAGE_DIMENSION, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
try {
imageData.getPixels(0, 1, GET_WIDTH, pixelData, OFFSET);
fail("No exception thrown for invalid depth");
@@ -511,7 +511,7 @@ public void test_getPixelsIII$BI() {
@Test
public void test_getPixelsIII$II() {
- final int SIZE = 20;
+ final int SIZE = 20;
final int GET_WIDTH = 10;
final int OFFSET = 10;
int[] pixelData = new int[SIZE];
@@ -550,7 +550,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":f:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":g:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":g:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":h:", 0, pixelData[i]);
}
@@ -570,7 +570,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":j:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":k:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":k:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":l:", 0, pixelData[i]);
}
@@ -590,7 +590,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":n:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":o:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":o:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":p:", 0, pixelData[i]);
}
@@ -610,7 +610,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":r:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":s:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":s:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":t:", 0, pixelData[i]);
}
@@ -630,7 +630,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":v:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":w:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":w:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":x:", 0, pixelData[i]);
}
@@ -650,7 +650,7 @@ public void test_getPixelsIII$II() {
if (i < OFFSET) {
assertEquals(":z:", 0, pixelData[i]);
} else if (i < OFFSET + values.length) {
- assertEquals(":aa:", values[i-OFFSET], pixelData[i]);
+ assertEquals(":aa:", values[i-OFFSET], pixelData[i]);
} else if (i < OFFSET+GET_WIDTH) {
assertEquals(":ab:", 0, pixelData[i]);
}
@@ -710,7 +710,7 @@ public void test_getRGBs() {
@Test
public void test_getTransparencyMask() {
-// Bug 71472 - transparency mask should be null
+// Bug 71472 - transparency mask should be null
// assertNull(":a:", imageData.getTransparencyMask());
try (InputStream stream = getClass().getResourceAsStream(SwtTestUtil.transparentImageFilenames[0])) {
@@ -721,12 +721,12 @@ public void test_getTransparencyMask() {
image.dispose();
} catch (IOException e) {}
-// Bug 71472 - transparency mask should be null
+// Bug 71472 - transparency mask should be null
/* image = new Image(Display.getDefault(), getClass().getResourceAsStream(imageFilenames[0] + '.' + imageFormats[imageFormats.length-1]));
imageData = image.getImageData();
maskData = imageData.getTransparencyMask();
assertNull(":c:", maskData);
-*/
+*/
}
@Test
@@ -739,7 +739,7 @@ public void test_getTransparencyType() {
assertFalse(":b:", SWT.TRANSPARENCY_NONE == imageData.getTransparencyType());
image.dispose();
} catch (IOException e) {}
-
+
try (InputStream stream = getClass().getResourceAsStream(SwtTestUtil.imageFilenames[0] + '.' + SwtTestUtil.imageFormats[SwtTestUtil.imageFormats.length-1])) {
Image image = new Image(Display.getDefault(), stream);
imageData = image.getImageData();
@@ -753,25 +753,25 @@ public void test_scaledToII() {
final int imageDimension = 8;
RGB[] rgbs = new RGB[]{new RGB(0, 0, 0), new RGB(255, 255, 255)};
byte[] pixelData = new byte[(imageDimension*imageDimension) / 8];
-
+
pixelData[0] = 0x4F;
imageData = new ImageData(imageDimension, imageDimension, 1, new PaletteData(rgbs), 1, pixelData);
ImageData scaledImageData = imageData.scaledTo(-imageDimension, -imageDimension);
byte[] scaledPixelData = new byte[imageDimension];
- scaledImageData.getPixels(0, imageDimension - 1, scaledPixelData.length, scaledPixelData, 0);
+ scaledImageData.getPixels(0, imageDimension - 1, scaledPixelData.length, scaledPixelData, 0);
byte[] expectedPixelData = new byte[] {0x1, 0x1, 0x1, 0x1, 0, 0, 0x1, 0};
assertArrayEquals(":a:", expectedPixelData, scaledPixelData);
scaledImageData = imageData.scaledTo(imageDimension * 10, imageDimension);
scaledPixelData = new byte[imageDimension * 10];
- scaledImageData.getPixels(0, 0, scaledPixelData.length, scaledPixelData, 0);
+ scaledImageData.getPixels(0, 0, scaledPixelData.length, scaledPixelData, 0);
assertEquals(":b:", 0, scaledPixelData[0]);
assertEquals(":c:", 0, scaledPixelData[1]);
scaledImageData = imageData.scaledTo(imageDimension, imageDimension * 10);
scaledPixelData = new byte[imageDimension];
- scaledImageData.getPixels(0, 0, scaledPixelData.length, scaledPixelData, 0);
+ scaledImageData.getPixels(0, 0, scaledPixelData.length, scaledPixelData, 0);
expectedPixelData = new byte[] {0, 0x1, 0, 0, 0x1, 0x1, 0x1, 0x1};
assertArrayEquals(":d:", expectedPixelData, scaledPixelData);
}
@@ -779,7 +779,7 @@ public void test_scaledToII() {
@Test
public void test_setAlphaIII() {
int value;
-
+
value = 0xAA;
imageData.setAlpha(0, 0, value);
assertEquals(":a:", value, imageData.getAlpha(0, 0));
@@ -814,10 +814,10 @@ public void test_setAlphaIII() {
@Test
public void test_setAlphasIII$BI() {
byte value;
- final int SIZE = 20;
+ final int SIZE = 20;
final int OFFSET = 1;
byte[] alphaData = new byte[SIZE];
-
+
value = (byte) 0xAA;
byte[] values = new byte[] {value, (byte) (value+1), (byte) (value+2), (byte) (value+3), (byte) (value+4)};
imageData.setAlphas(0, 1, values.length - OFFSET, values, OFFSET);
@@ -829,7 +829,7 @@ public void test_setAlphasIII$BI() {
assertEquals(":b:", 0, alphaData[i]);
}
}
-
+
// exception cases
try {
imageData.setAlphas(0, 1, IMAGE_DIMENSION*IMAGE_DIMENSION, alphaData, OFFSET);
@@ -871,13 +871,13 @@ public void test_setAlphasIII$BI() {
fail("No exception thrown for putWidth < 0");
} catch (IllegalArgumentException e) {
assertSWTProblem("Incorrect exception thrown for putWidth < 0", SWT.ERROR_INVALID_ARGUMENT, e);
- }
+ }
}
@Test
public void test_setPixelIII() {
int value;
-
+
value = 0xAA;
imageData.setPixel(0, 0, value);
assertEquals(":a:", value, imageData.getPixel(0, 0));
@@ -911,7 +911,7 @@ public void test_setPixelIII() {
@Test
public void test_setPixelsIII$BI() {
- final int SIZE = 20;
+ final int SIZE = 20;
final int OFFSET = 1;
byte[] pixelData = new byte[SIZE];
@@ -966,7 +966,7 @@ public void test_setPixelsIII$BI() {
assertEquals(":h:", 0, pixelData[i]);
}
}
-
+
// exception cases
try {
imageData.setPixels(0, 1, IMAGE_DIMENSION*IMAGE_DIMENSION, pixelData, OFFSET);
@@ -1009,7 +1009,7 @@ public void test_setPixelsIII$BI() {
} catch (IllegalArgumentException e) {
assertSWTProblem("Incorrect exception thrown for putWidth < 0", SWT.ERROR_INVALID_ARGUMENT, e);
}
- imageData = new ImageData(IMAGE_DIMENSION, IMAGE_DIMENSION, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
+ imageData = new ImageData(IMAGE_DIMENSION, IMAGE_DIMENSION, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
try {
imageData.setPixels(0, 1, IMAGE_DIMENSION, pixelData, OFFSET);
fail("No exception thrown for invalid depth");
@@ -1020,7 +1020,7 @@ public void test_setPixelsIII$BI() {
@Test
public void test_setPixelsIII$II() {
- final int SIZE = 20;
+ final int SIZE = 20;
final int OFFSET = 1;
int[] pixelData = new int[SIZE];
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java
index 799fca2c55..a71500ebcc 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java
@@ -34,7 +34,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_ImageLoaderLorg_eclipse_sw
fail("No exception thrown for ImageLoader source == null");
} catch (IllegalArgumentException e) {
}
-
+
new ImageLoaderEvent(new ImageLoader(), null, 0, true);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java
index 9ec90854f1..441d8893c2 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java
@@ -63,17 +63,17 @@ public void test_ConstructorIII() {
@Test
public void test_getPixelLorg_eclipse_swt_graphics_RGB() {
- // indexed palette tests
+ // indexed palette tests
RGB[] rgbs = {new RGB(0, 0, 0), new RGB(255, 255, 255), new RGB(50, 100, 150)};
PaletteData data = new PaletteData(rgbs);
-
+
try {
data.getPixel(null);
fail("No exception thrown for indexed palette with rgb == null");
}
catch (IllegalArgumentException e) {
}
-
+
try {
data.getPixel(new RGB(0, 0, 1));
fail("No exception thrown for rgb not found");
@@ -82,11 +82,11 @@ public void test_getPixelLorg_eclipse_swt_graphics_RGB() {
}
assertEquals(":a:", rgbs.length-1, data.getPixel(rgbs[rgbs.length-1]));
-
- // direct palette tests
+
+ // direct palette tests
RGB rgb =new RGB(0x32, 0x64, 0x96);
data = new PaletteData(0xff0000, 0x00ff00, 0x0000ff);
-
+
try {
data.getPixel(null);
fail("No exception thrown for direct palette with rgb == null");
@@ -99,7 +99,7 @@ public void test_getPixelLorg_eclipse_swt_graphics_RGB() {
@Test
public void test_getRGBI() {
- // indexed palette tests
+ // indexed palette tests
RGB[] rgbs = {new RGB(0, 0, 0), new RGB(255, 255, 255), new RGB(50, 100, 150)};
PaletteData data = new PaletteData(rgbs);
@@ -112,24 +112,24 @@ public void test_getRGBI() {
assertEquals(":a:", rgbs[rgbs.length-1], data.getRGB(rgbs.length-1));
- // direct palette tests
+ // direct palette tests
RGB rgb =new RGB(0x32, 0x64, 0x96);
data = new PaletteData(0xff0000, 0x00ff00, 0x0000ff);
-
+
assertEquals(":b:", rgb, data.getRGB(0x326496));
}
@Test
public void test_getRGBs() {
- // indexed palette tests
+ // indexed palette tests
RGB[] rgbs = {new RGB(0, 0, 0), new RGB(255, 255, 255)};
PaletteData data = new PaletteData(rgbs);
-
+
assertArrayEquals(":a:", rgbs, data.getRGBs());
-
- // direct palette tests
+
+ // direct palette tests
data = new PaletteData(0xff0000, 0x00ff00, 0x0000ff);
-
+
assertNull(":b:", data.getRGBs());
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
index f64f097f72..bb80794ed4 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
@@ -27,10 +27,10 @@ public class Test_org_eclipse_swt_graphics_RGB {
public void test_ConstructorIII() {
// Test RGB(int red, int green, int blue)
new RGB(20,100,200);
-
+
new RGB(0,0,0);
-
+
try {
new RGB(-1, 20, 50);
@@ -38,21 +38,21 @@ public void test_ConstructorIII() {
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(256, 20, 50);
fail("No exception thrown for red > 255");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(20, -1, 50);
fail("No exception thrown for green < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(20, 256, 50);
fail("No exception thrown for green > 255");
@@ -66,21 +66,21 @@ public void test_ConstructorIII() {
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(20, 50, 256);
fail("No exception thrown for blue > 255");
}
catch (IllegalArgumentException e) {
}
-
+
}
@Test
public void test_ConstructorFFF() {
new RGB(0f,0f,0f);
-
+
new RGB(0f,1f,0f);
new RGB(0f,0f,1f);
new RGB(0f,0.6f,0.4f);
@@ -174,42 +174,42 @@ public void test_ConstructorFFF() {
new RGB(360f,0f,1f);
new RGB(360f,1f,0f);
new RGB(360f,0.6f,0.4f);
-
+
try {
new RGB(400f, 0.5f, 0.5f);
fail("No exception thrown for hue > 360");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(-5f, 0.5f, 0.5f);
fail("No exception thrown for hue < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(200f, -0.5f, 0.5f);
fail("No exception thrown for saturation < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(200f, 300f, 0.5f);
fail("No exception thrown for saturation > 1");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(200f, 0.5f, -0.5f);
fail("No exception thrown for brightness < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGB(200f, 0.5f, 400f);
fail("No exception thrown for brightness > 1");
@@ -223,22 +223,22 @@ public void test_equalsLjava_lang_Object() {
int r = 0, g = 127, b = 254;
RGB rgb1 = new RGB(r, g, b);
RGB rgb2;
-
+
rgb2 = rgb1;
if (!rgb1.equals(rgb2)) {
fail("Two references to the same RGB instance not found equal");
}
-
+
rgb2 = new RGB(r, g, b);
if (!rgb1.equals(rgb2)) {
fail("References to two different RGB instances with same R G B parameters not found equal");
}
-
+
if (rgb1.equals(new RGB(r+1, g, b)) ||
rgb1.equals(new RGB(r, g+1, b)) ||
rgb1.equals(new RGB(r, g, b+1)) ||
rgb1.equals(new RGB(r+1, g+1, b+1))) {
- fail("Comparing two RGB instances with different combination of R G B parameters found equal");
+ fail("Comparing two RGB instances with different combination of R G B parameters found equal");
}
float hue = 220f, sat = 0.6f, bright = 0.7f;
@@ -247,17 +247,17 @@ public void test_equalsLjava_lang_Object() {
if (!rgb1.equals(rgb2)) {
fail("Two references to the same RGB instance not found equal");
}
-
+
rgb2 = new RGB(hue, sat, bright);
if (!rgb1.equals(rgb2)) {
fail("References to two different RGB instances with same H S B parameters not found equal");
}
-
+
if (rgb1.equals(new RGB(hue+1, sat, bright)) ||
rgb1.equals(new RGB(hue, sat+0.1f, bright)) ||
rgb1.equals(new RGB(hue, sat, bright+0.1f)) ||
rgb1.equals(new RGB(hue+1, sat+0.1f, bright+0.1f))) {
- fail("Comparing two RGB instances with different combination of H S B parameters found equal");
+ fail("Comparing two RGB instances with different combination of H S B parameters found equal");
}
}
@@ -375,14 +375,14 @@ public void test_hashCode() {
int r = 255, g = 100, b = 0;
RGB rgb1 = new RGB(r, g, b);
RGB rgb2 = new RGB(r, g, b);
-
+
int hash1 = rgb1.hashCode();
int hash2 = rgb2.hashCode();
-
+
if (hash1 != hash2) {
fail("Two RGB instances with same R G B parameters returned different hash codes");
}
-
+
if (rgb1.hashCode() == new RGB(g, b, r).hashCode() ||
rgb1.hashCode() == new RGB(b, r, g).hashCode()) {
fail("Two RGB instances with different R G B parameters returned the same hash code");
@@ -394,7 +394,7 @@ public void test_toString() {
RGB rgb = new RGB(0, 100, 200);
String s = rgb.toString();
-
+
if (s == null || s.length() == 0) {
fail("RGB.toString returns a null or empty String");
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
index d7ac7d5238..dc43675b5a 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
@@ -27,10 +27,10 @@ public class Test_org_eclipse_swt_graphics_RGBA {
public void test_ConstructorIIII() {
// Test RGBA(int red, int green, int blue, int alpha)
new RGBA(20,100,200,255);
-
+
new RGBA(0,0,0,0);
-
+
try {
new RGBA(-1, 20, 50, 255);
@@ -38,21 +38,21 @@ public void test_ConstructorIIII() {
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(256, 20, 50, 255);
fail("No exception thrown for red > 255");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(20, -1, 50, 0);
fail("No exception thrown for green < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(20, 256, 50, 0);
fail("No exception thrown for green > 255");
@@ -66,21 +66,21 @@ public void test_ConstructorIIII() {
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(20, 50, 256, 0);
fail("No exception thrown for blue > 255");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(20, 50, 10, -1);
fail("No exception thrown for alpha < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(20, 50, 10, 256);
fail("No exception thrown for alpha > 255");
@@ -93,7 +93,7 @@ public void test_ConstructorIIII() {
public void test_ConstructorFFFF() {
new RGBA(0f,0f,0f,0f);
-
+
new RGBA(0f,1f,0f,0f);
new RGBA(0f,0f,1f,1f);
new RGBA(0f,0.6f,0.4f,0.8f);
@@ -187,56 +187,56 @@ public void test_ConstructorFFFF() {
new RGBA(360f,0f,1f,1f);
new RGBA(360f,1f,0f,0f);
new RGBA(360f,0.6f,0.4f,0.8f);
-
+
try {
new RGBA(400f, 0.5f, 0.5f, 0.8f);
fail("No exception thrown for hue > 360");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(-5f, 0.5f, 0.5f, 0.8f);
fail("No exception thrown for hue < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, -0.5f, 0.5f, 0.8f);
fail("No exception thrown for saturation < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, 300f, 0.5f, 0.8f);
fail("No exception thrown for saturation > 1");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, 0.5f, -0.5f, 0.8f);
fail("No exception thrown for brightness < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, 0.5f, 400f, 0.8f);
fail("No exception thrown for brightness > 1");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, 0.5f, 0.5f, -0.5f);
fail("No exception thrown for alpha < 0");
}
catch (IllegalArgumentException e) {
}
-
+
try {
new RGBA(200f, 0.5f, 0.5f, 400f);
fail("No exception thrown for alpha > 1");
@@ -250,23 +250,23 @@ public void test_equalsLjava_lang_Object() {
int r = 0, g = 127, b = 254, a = 254;
RGBA rgba1 = new RGBA(r, g, b, a);
RGBA rgba2;
-
+
rgba2 = rgba1;
if (!rgba1.equals(rgba2)) {
fail("Two references to the same RGBA instance not found equal");
}
-
+
rgba2 = new RGBA(r, g, b, a);
if (!rgba1.equals(rgba2)) {
fail("References to two different RGBA instances with same R G B A parameters not found equal");
}
-
+
if (rgba1.equals(new RGBA(r+1, g, b, a)) ||
rgba1.equals(new RGBA(r, g+1, b, a)) ||
rgba1.equals(new RGBA(r, g, b+1, a)) ||
rgba1.equals(new RGBA(r, g, b, a+1)) ||
rgba1.equals(new RGBA(r+1, g+1, b+1, a+1))) {
- fail("Comparing two RGBA instances with different combination of R G B A parameters found equal");
+ fail("Comparing two RGBA instances with different combination of R G B A parameters found equal");
}
float hue = 220f, sat = 0.6f, bright = 0.7f, alpha = 0.5f;
@@ -275,18 +275,18 @@ public void test_equalsLjava_lang_Object() {
if (!rgba1.equals(rgba2)) {
fail("Two references to the same RGBA instance not found equal");
}
-
+
rgba2 = new RGBA(hue, sat, bright, alpha);
if (!rgba1.equals(rgba2)) {
fail("References to two different RGBA instances with same H S B A parameters not found equal");
}
-
+
if (rgba1.equals(new RGBA(hue+1, sat, bright, alpha)) ||
rgba1.equals(new RGBA(hue, sat+0.1f, bright, alpha)) ||
rgba1.equals(new RGBA(hue, sat, bright+0.1f, alpha)) ||
rgba1.equals(new RGBA(hue, sat, bright, alpha+1f)) ||
rgba1.equals(new RGBA(hue+1, sat+0.1f, bright+0.1f, alpha+1f))) {
- fail("Comparing two RGBA instances with different combination of H S B A parameters found equal");
+ fail("Comparing two RGBA instances with different combination of H S B A parameters found equal");
}
}
@@ -404,14 +404,14 @@ public void test_hashCode() {
int r = 255, g = 100, b = 0, a = 0, different = 150;
RGBA rgba1 = new RGBA(r, g, b, a);
RGBA rgba2 = new RGBA(r, g, b, a);
-
+
int hash1 = rgba1.hashCode();
int hash2 = rgba2.hashCode();
-
+
if (hash1 != hash2) {
fail("Two RGBA instances with same R G B A parameters returned different hash codes");
}
-
+
if (rgba1.hashCode() == new RGBA(g, b, r, a).hashCode() ||
rgba1.hashCode() == new RGBA(b, r, g, a).hashCode()) {
fail("Two RGB instances with different R G B A parameters returned the same hash code");
@@ -439,7 +439,7 @@ public void test_toString() {
RGBA rgba = new RGBA(0, 100, 200, 255);
String s = rgba.toString();
-
+
if (s == null || s.length() == 0) {
fail("RGBA.toString returns a null or empty String");
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
index 37895d893b..d0eaa794ce 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
@@ -69,7 +69,7 @@ public void test_addLorg_eclipse_swt_graphics_Rectangle() {
r1.add(r2);
assertEquals("Rectangle add incorrect", new Rectangle(1, 2, 4, 4), r1);
-
+
r1 = new Rectangle(1, 2, 3, 4);
r2 = new Rectangle(3, 3, 0, 0);
r1.add(r2);
@@ -177,7 +177,7 @@ public void test_hashCode() {
public void test_intersectLorg_eclipse_swt_graphics_Rectangle() {
Rectangle r1 = new Rectangle(1, 2, 3, 4);
Rectangle r2 = new Rectangle(3, 3, 2, 2);
-
+
r1.intersect(r2);
assertEquals("Rectangle intersect incorrect", new Rectangle(3, 3, 1, 2), r1);
@@ -229,7 +229,7 @@ public void test_intersectsIIII() {
r2 = new Rectangle(200, 300, 400, 500);
assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", !r1.intersects(200, 300, 400, 500));
assertTrue("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(1, 2, 3, 4));
-
+
r2 = new Rectangle(3, 3, 0, 0);
assertTrue("Rectangle(1, 2, 3, 4) should intersect Rectangle(3, 3, 0, 0)", r1.intersects(3, 3, 0, 0));
assertTrue("Rectangle(3, 3, 0, 0) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(1, 2, 3, 4));
@@ -256,7 +256,7 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() {
r2 = new Rectangle(200, 300, 400, 500);
assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", !r1.intersects(r2));
assertTrue("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(r1));
-
+
r2 = new Rectangle(3, 3, 0, 0);
assertTrue("Rectangle(1, 2, 3, 4) should intersect Rectangle(3, 3, 0, 0)", r1.intersects(r2));
assertTrue("Rectangle(3, 3, 0, 0) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(r1));
@@ -298,7 +298,7 @@ public void test_unionLorg_eclipse_swt_graphics_Rectangle() {
Rectangle r1 = new Rectangle(1, 2, 3, 4);
Rectangle r2 = new Rectangle(3, 3, 2, 2);
assertEquals("Rectangle union incorrect", new Rectangle(1, 2, 4, 4), r1.union(r2));
-
+
r2 = new Rectangle(3, 3, 0, 0);
assertEquals("Rectangle union incorrect", new Rectangle(1, 2, 3, 4), r1.union(r2));
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java
index d9da6435e6..2a581e3fb9 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java
@@ -61,7 +61,7 @@ public void test_add$I() {
fail("no exception thrown for adding a null rectangle");
}
catch (IllegalArgumentException e) {
- }
+ }
reg.dispose();
try {
reg.add(new int[]{});
@@ -71,7 +71,7 @@ public void test_add$I() {
catch (SWTException e) {
}
reg.dispose();
-
+
reg = new Region(display);
reg.add(new int[] {0,0, 50,0, 50,25, 0,25});
Rectangle box = reg.getBounds();
@@ -80,7 +80,7 @@ public void test_add$I() {
if (!box.equals(expected)) {
fail("add 1 failed - expected: "+expected+" actual: "+box);
}
-
+
reg = new Region(display);
reg.add(new int[] {0,0, 50,0, 50,25, 0,25});
reg.add(new int[] {0,25, 50,25, 50,40, 0,40});
@@ -90,7 +90,7 @@ public void test_add$I() {
if (!box.equals(expected)) {
fail("add 2 failed - expected: "+expected+" actual: "+box);
}
-
+
// reg = new Region(display);
// reg.add(new int[] {10,10, 40,30, 20,60, 5,55});
// box = reg.getBounds();
@@ -107,7 +107,7 @@ public void test_addLorg_eclipse_swt_graphics_Rectangle() {
// add a rectangle
reg.add(new Rectangle(0, 0, 100, 50));
// add a second rectangle
- reg.add(new Rectangle(200, 200, 10,10));
+ reg.add(new Rectangle(200, 200, 10,10));
try {
reg.add((Rectangle)null);
@@ -115,9 +115,9 @@ public void test_addLorg_eclipse_swt_graphics_Rectangle() {
}
catch (IllegalArgumentException e) {
}
-
+
reg.dispose();
-
+
try {
reg.add(new Rectangle(20,30,10,5));
fail("no exception thrown for adding a rectangle after Region got disposed");
@@ -151,9 +151,9 @@ public void test_addLorg_eclipse_swt_graphics_Region() {
}
catch (IllegalArgumentException e) {
}
-
+
reg1.dispose();
-
+
try {
reg2 = new Region(display);
reg2.add(new Rectangle(1,1,100,200));
@@ -173,7 +173,7 @@ public void test_containsII() {
Rectangle rect2 = new Rectangle(50,50,1000,1000);
Point pointInRect2 = new Point(1049,1009);
Point pointNotInRect12 = new Point(49,110);
-
+
Region reg = new Region(display);
reg.dispose();
try {
@@ -182,7 +182,7 @@ public void test_containsII() {
}
catch (Exception e) {
}
-
+
reg = new Region(display);
if (reg.contains(pointInRect1.x, pointInRect1.y)) {
reg.dispose();
@@ -202,7 +202,7 @@ public void test_containsII() {
if (reg.contains(pointNotInRect12.x, pointNotInRect12.y)) {
reg.dispose();
fail("Region should not contain point");
- }
+ }
reg.dispose();
}
@@ -213,7 +213,7 @@ public void test_containsLorg_eclipse_swt_graphics_Point() {
Rectangle rect2 = new Rectangle(50,50,1000,1000);
Point pointInRect2 = new Point(1049,1009);
Point pointNotInRect12 = new Point(49,110);
-
+
Region reg = new Region(display);
reg.dispose();
try {
@@ -222,7 +222,7 @@ public void test_containsLorg_eclipse_swt_graphics_Point() {
}
catch (Exception e) {
}
-
+
reg = new Region(display);
if (reg.contains(pointInRect1)) {
reg.dispose();
@@ -253,7 +253,7 @@ public void test_dispose() {
if (reg.isDisposed()) {
fail("Region should not be in the disposed state");
}
-
+
// dispose twice as this is allowed
for (int i = 0; i < 2; i++) {
reg.dispose();
@@ -267,21 +267,21 @@ public void test_dispose() {
public void test_equalsLjava_lang_Object() {
Rectangle rect1 = new Rectangle(25, 100, 200, 780);
Rectangle rect2 = new Rectangle(30, 105, 205, 785);
-
+
Region reg1 = new Region(display);
reg1.add(rect1);
Region reg2 = reg1;
-
+
if (!reg1.equals(reg2)) {
reg1.dispose();
reg2.dispose();
fail("references to the same instance of Region should be considered equal");
}
-
+
reg2 = new Region(display);
reg2.add(rect1);
-
+
// Currently, Regions are only "equal" if they have the same handle.
// This is so that identical objects are properly hashed.
// We are considering adding a new method that will compare Regions for the same area.
@@ -289,8 +289,8 @@ public void test_equalsLjava_lang_Object() {
// reg1.dispose();
// reg2.dispose();
// fail("two instances of Region representing the same area should be considered equal");
-// }
-
+// }
+
reg2.dispose();
reg2 = new Region(display);
if (reg1.equals(reg2)) {
@@ -298,14 +298,14 @@ public void test_equalsLjava_lang_Object() {
reg2.dispose();
fail("Non empty region considered equal to empty one");
}
-
+
reg2.add(rect2);
if (reg1.equals(reg2)) {
reg1.dispose();
reg2.dispose();
fail("two different regions considered equal");
}
-
+
reg1.dispose();
reg2.dispose();
}
@@ -314,7 +314,7 @@ public void test_equalsLjava_lang_Object() {
public void test_getBounds() {
Region reg = new Region(display);
reg.dispose();
-
+
try {
reg.getBounds();
fail("Region disposed should throw Exception");
@@ -326,24 +326,24 @@ public void test_getBounds() {
Rectangle rect2 = new Rectangle(100,100,10,10);
// the rectangle enclosing the two preceding rectangles
Rectangle rect12Bounds = new Rectangle(10,10,100,100);
-
+
reg = new Region(display);
reg.add(rect1);
Rectangle rect1Bis = reg.getBounds();
- if (rect1Bis.x != rect1.x || rect1Bis.y != rect1.y ||
+ if (rect1Bis.x != rect1.x || rect1Bis.y != rect1.y ||
rect1Bis.height != rect1.height || rect1Bis.width != rect1.width) {
reg.dispose();
fail("getBounds doesn't return the borders of the rectangle area which was set up");
}
-
+
reg.add(rect2);
Rectangle rect12 = reg.getBounds();
- if (rect12.x != rect12Bounds.x || rect12.y != rect12Bounds.y ||
+ if (rect12.x != rect12Bounds.x || rect12.y != rect12Bounds.y ||
rect12.height != rect12Bounds.height || rect12.width != rect12Bounds.width) {
reg.dispose();
fail("getBounds doesn't return the borders of the resulting rectangle area which was set up");
}
-
+
reg.dispose();
}
@@ -351,31 +351,31 @@ public void test_getBounds() {
public void test_hashCode() {
Region reg1 = new Region(display);
Region reg2 = new Region(display);
-
+
Rectangle rect1 = new Rectangle(25, 100, 200, 780);
Rectangle rect2 = new Rectangle(30, 105, 205, 785);
-
+
reg1.add(rect1);
reg2.add(rect2);
-
+
if (reg1.hashCode() == reg2.hashCode()) {
reg1.dispose();
reg2.dispose();
fail("two different regions should have different hashCode");
}
- reg2.dispose();
+ reg2.dispose();
reg2 = new Region(display);
reg2.add(rect1);
-// BUG: this should pass
+// BUG: this should pass
// if (reg1.hashCode() != reg2.hashCode()) {
// reg1.dispose();
// reg2.dispose();
// fail("two regions representing same area should have same hashCode");
// }
-
+
reg1.dispose();
reg2.dispose();
}
@@ -396,7 +396,7 @@ public void test_intersectLorg_eclipse_swt_graphics_Rectangle() {
}
catch (SWTException e) {
}
-
+
reg = new Region(display);
reg.intersect(rect1);
if (!reg.isEmpty()) {
@@ -456,7 +456,7 @@ public void test_intersectLorg_eclipse_swt_graphics_Region() {
}
catch (SWTException e) {
}
-
+
reg = new Region(display);
reg.intersect(reg1);
if (!reg.isEmpty()) {
@@ -464,7 +464,7 @@ public void test_intersectLorg_eclipse_swt_graphics_Region() {
reg1.dispose();
fail("intersect failed for empty region");
}
-
+
Region reg2 = new Region(display);
reg2.add(new Rectangle(0,0,48,24));
@@ -478,10 +478,10 @@ public void test_intersectLorg_eclipse_swt_graphics_Region() {
fail("intersect failed 1");
}
reg2.dispose();
-
+
Region reg3 = new Region(display);
reg3.add(new Rectangle(10,10,10,10));
-
+
reg.intersect(reg3);
box = reg.getBounds();
if (!box.equals(reg3.getBounds())) {
@@ -491,7 +491,7 @@ public void test_intersectLorg_eclipse_swt_graphics_Region() {
fail("intersect failed 2");
}
reg3.dispose();
-
+
Region reg4 = new Region(display);
reg4.add(new Rectangle(48,24,10,10));
@@ -502,10 +502,10 @@ public void test_intersectLorg_eclipse_swt_graphics_Region() {
reg4.dispose();
fail("intersect failed 3");
}
-
+
Region reg5 = new Region(display);
reg5.add(new Rectangle(24,20,24,10));
-
+
reg.add(reg1.getBounds().union(reg4.getBounds()));
reg.intersect(reg5);
box = reg.getBounds();
@@ -539,12 +539,12 @@ public void test_intersectsIIII() {
Rectangle rect1 = new Rectangle(10,20,50,30);
Rectangle rectInter1 = new Rectangle(59,49,10,20);
Rectangle rectNotInter1 = new Rectangle(0,5,10,15);
-
+
Rectangle rect2 = new Rectangle(30,40,10,100);
Rectangle rectInter2 = new Rectangle(39,139,1,5);
Rectangle rectNotInter12 = new Rectangle(40,50,5,15);
-
-
+
+
Region reg = new Region(display);
reg.dispose();
try {
@@ -553,7 +553,7 @@ public void test_intersectsIIII() {
}
catch (Exception e) {
}
-
+
reg = new Region(display);
if (reg.intersects(rect1.x, rect1.y, rect1.width, rect1.height)) {
reg.dispose();
@@ -572,7 +572,7 @@ public void test_intersectsIIII() {
reg.dispose();
fail("intersects return true on rectangle not intersecting with region");
}
-
+
reg.add(rect2);
if (!reg.intersects(rect2.x, rect2.y, rect2.width, rect2.height)) {
reg.dispose();
@@ -594,12 +594,12 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() {
Rectangle rect1 = new Rectangle(10,20,50,30);
Rectangle rectInter1 = new Rectangle(59,49,10,20);
Rectangle rectNotInter1 = new Rectangle(0,5,10,15);
-
+
Rectangle rect2 = new Rectangle(30,40,10,100);
Rectangle rectInter2 = new Rectangle(39,139,1,5);
Rectangle rectNotInter12 = new Rectangle(40,50,5,15);
-
-
+
+
Region reg = new Region(display);
reg.dispose();
try {
@@ -608,7 +608,7 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() {
}
catch (Exception e) {
}
-
+
reg = new Region(display);
if (reg.intersects(rect1)) {
reg.dispose();
@@ -627,7 +627,7 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() {
reg.dispose();
fail("intersects return true on rectangle not intersecting with region");
}
-
+
reg.add(rect2);
if (!reg.intersects(rect2)) {
reg.dispose();
@@ -650,12 +650,12 @@ public void test_isEmpty() {
Rectangle emptyRect1 = new Rectangle(10,20,0,200);
Rectangle emptyRect2 = new Rectangle(10,20,10,0);
Rectangle rect = new Rectangle(10,20,50,100);
-
+
if (!reg.isEmpty()) {
reg.dispose();
fail("isEmpty didn't return true on empty region");
}
-
+
reg.add(emptyRect1);
if (!reg.isEmpty()) {
reg.dispose();
@@ -673,8 +673,8 @@ public void test_isEmpty() {
reg.dispose();
fail("isEmpty returned true on non empty region");
}
-
- reg.dispose();
+
+ reg.dispose();
}
@Test
@@ -686,7 +686,7 @@ public void test_subtract$I() {
fail("no exception thrown for subtract a null array");
}
catch (IllegalArgumentException e) {
- }
+ }
reg.dispose();
try {
reg.subtract(new int[]{});
@@ -696,7 +696,7 @@ public void test_subtract$I() {
catch (SWTException e) {
}
reg.dispose();
-
+
reg = new Region(display);
reg.add(new int[] {0,0, 50,0, 50,25, 0,25});
reg.subtract(new int[] {0,0, 50,0, 50,20, 0,20});
@@ -706,8 +706,8 @@ public void test_subtract$I() {
if (!box.equals(expected)) {
fail("subtract 1 failed - expected: "+expected+" actual: "+box);
}
-
-
+
+
reg = new Region(display);
reg.add(new int[] {0,0, 50,0, 50,25, 0,25});
reg.add(new int[] {0,25, 50,25, 50,40, 0,40});
@@ -736,7 +736,7 @@ public void test_subtractLorg_eclipse_swt_graphics_Rectangle() {
}
catch (SWTException e) {
}
-
+
reg = new Region(display);
reg.subtract(rect1);
if (!reg.isEmpty()) {
@@ -797,7 +797,7 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
}
catch (SWTException e) {
}
-
+
reg = new Region(display);
reg.subtract(reg1);
if (!reg.isEmpty()) {
@@ -805,10 +805,10 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
reg1.dispose();
fail("subtract failed for empty region");
}
-
+
Region reg2 = new Region(display);
reg2.add(new Rectangle(0,0,50,25));
-
+
reg.add(reg1);
reg.subtract(reg2);
if (!reg.isEmpty()) {
@@ -818,10 +818,10 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
fail("subtract failed 1");
}
reg2.dispose();
-
+
Region reg3 = new Region(display);
reg3.add(new Rectangle(10,10,10,10));
-
+
reg.add(reg1);
reg.subtract(reg3);
Rectangle box = reg.getBounds();
@@ -832,10 +832,10 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
fail("subtract failed 2");
}
reg3.dispose();
-
+
Region reg4 = new Region(display);
reg4.add(new Rectangle(50,25,10,10));
-
+
reg.subtract(reg4);
box = reg.getBounds();
if (!box.equals(reg1.getBounds())) {
@@ -847,7 +847,7 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
Region reg5 = new Region(display);
reg5.add(new Rectangle(0,0,60,20));
-
+
reg.add(reg1.getBounds().union(reg4.getBounds()));
reg.subtract(reg5);
box = reg.getBounds();
@@ -881,26 +881,26 @@ public void test_subtractLorg_eclipse_swt_graphics_Region() {
@Test
public void test_toString() {
Region reg = new Region(display);
-
+
String s = reg.toString();
-
+
if (s == null || s.length() == 0) {
fail("toString returns null or empty string");
}
-
+
reg.add(new Rectangle(1,1,10,20));
s = reg.toString();
-
+
if (s == null || s.length() == 0) {
fail("toString returns null or empty string");
}
reg.dispose();
s = reg.toString();
-
+
if (s == null || s.length() == 0) {
fail("toString returns null or empty string");
- }
+ }
}
@Test
@@ -909,27 +909,27 @@ public void test_add_intArray() {
int[] points = new int[] {1};
reg.add(points);
reg.dispose();
-
+
Region reg2 = new Region(display);
points = new int[] {1,2};
reg2.add(points);
reg2.dispose();
-
+
Region reg3 = new Region(display);
points = new int[] {1,2,3};
reg3.add(points);
reg3.dispose();
-
+
Region reg4 = new Region(display);
points = new int[] {1,2,3,4};
reg4.add(points);
reg4.dispose();
-
+
Region reg5 = new Region(display);
points = new int[] {1,2,3,4,5};
reg5.add(points);
reg5.dispose();
-
+
Region reg6 = new Region(display);
points = new int[] {1,2,3,4,5,6};
reg6.add(points);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
index 193ca0787f..1913d0ca8a 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
@@ -28,7 +28,7 @@ import org.junit.Test;
public class Test_org_eclipse_swt_graphics_TextLayout {
Display display;
-
+
@Before
public void setUp() {
display = Display.getDefault();
@@ -44,17 +44,17 @@ public void test_getLevel() {
assertEquals(0, layout.getLevel(2));
// assertEquals(0, layout.getLevel(4)); //bug in windows (uniscribe)
assertEquals(1, layout.getLevel(5));
- assertEquals(1, layout.getLevel(6));
+ assertEquals(1, layout.getLevel(6));
assertEquals(2, layout.getLevel(7));
assertEquals(0, layout.getLevel(9));
try {
layout.getLevel(-1);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
try {
layout.getLevel(text.length() + 1);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
layout.dispose();
}
@@ -74,7 +74,7 @@ public void test_getSegments() {
assertEquals(m, 0, layout.getPreviousOffset(1, SWT.MOVEMENT_CLUSTER));
assertEquals(m, 0, layout.getPreviousOffset(0, SWT.MOVEMENT_CLUSTER));
}
-
+
// Bug 295513
layout.setText("Line");
layout.setAscent(20);
@@ -83,7 +83,7 @@ public void test_getSegments() {
layout.getBounds();
layout.dispose();
layout = new TextLayout(display);
-
+
// Bug 241482 comment 74
layout.setText("word word word");
layout.setSegments(new int[] {0, 5, 10});
@@ -115,11 +115,11 @@ public void test_getSegments() {
int[] expected = new int[] {0, 1, 3};
int[] offsets = layout.getLineOffsets();
for (int i = 0; i < offsets.length; i++) {
- assertEquals(" i = " + i, expected[i], offsets[i]);
+ assertEquals(" i = " + i, expected[i], offsets[i]);
}
layout.dispose();
layout = new TextLayout(display);
-
+
//Bug 241482 comment 80
layout.setText("MNMNMN");
layout.setSegments(new int[] {0,1,6});
@@ -129,7 +129,7 @@ public void test_getSegments() {
assertEquals(layout.getText().length() - 1, layout.getOffset(layout.getBounds().width, 0, null));
layout.dispose();
layout = new TextLayout(display);
-
+
//Bug 486600 comment 2
layout.setText("Abcdef\nGhij\nKl");
Rectangle bounds1 = layout.getBounds(0, 6 - 1);
@@ -139,7 +139,7 @@ public void test_getSegments() {
assertEquals(1, trailing[0]);
layout.dispose();
layout = new TextLayout(display);
-
+
layout.setText("AbcdefGhijKl");
layout.setSegments(new int[] {6, 10});
layout.setSegmentsChars(new char[] {'\n', '\n'});
@@ -150,7 +150,7 @@ public void test_getSegments() {
assertEquals(1, trailing[0]);
layout.dispose();
layout = new TextLayout(display);
-
+
//Lina's bug (bug 241482, comment 37)
boolean doit = false; //known to be broken
if (doit) {
@@ -173,28 +173,28 @@ public void test_getSegments() {
// String text = "AB";
// int textLength = text.length();
// layout.setText(text);
-// messages = new String [] {
-// "no segments",
+// messages = new String [] {
+// "no segments",
// "segments",
-// "segments (duplicate at 0)",
+// "segments (duplicate at 0)",
// "segments (duplicate at 1)",
// "segments (duplicate at 2)" };
-// segments = new int [][] {
-// null,
-// { 0, 1, 2 },
-// { 0, 0, 1, 2 },
+// segments = new int [][] {
+// null,
+// { 0, 1, 2 },
+// { 0, 0, 1, 2 },
// { 0, 1, 1, 2 },
// { 0, 1, 2, 2 } };
-// int[][] translatedOffsets = {
-// { 0, 1, 2 },
-// { 1, 3, 5 },
+// int[][] translatedOffsets = {
+// { 0, 1, 2 },
+// { 1, 3, 5 },
// { 2, 4, 6 },
-// { 1, 4, 6 },
+// { 1, 4, 6 },
// { 1, 3, 6 } };
-// int[][] untranslatedOffsets = {
-// { 0, 1, 2 },
+// int[][] untranslatedOffsets = {
+// { 0, 1, 2 },
// { 0, 0, 1, 1, 2, 2 },
-// { 0, 0, 0, 1, 1, 2, 2 },
+// { 0, 0, 0, 1, 1, 2, 2 },
// { 0, 0, 1, 1, 1, 2, 2 },
// { 0, 0, 1, 1, 2, 2, 2 } };
// for (int i = 0; i < segments.length; i++) {
@@ -226,35 +226,35 @@ public void test_getSegmentsChars() {
layout.setText(text);
String[] messages = {
- "no segments",
- "Embedding RTL dir test",
+ "no segments",
+ "Embedding RTL dir test",
"Embedding LTR dir test",
- "LRO test",
- "RLO test",
- "Traditional segments",
+ "LRO test",
+ "RLO test",
+ "Traditional segments",
"Traditional segments invalid"};
int[][] segments = {
- null,
- {0, 0, 4, 4, 5, 5, 8, 8},
+ null,
+ {0, 0, 4, 4, 5, 5, 8, 8},
{0, 0, 4, 4, 5, 5, 8, 8},
- {0, textLength},
- {0, textLength},
- {0, 4, 8},
+ {0, textLength},
+ {0, textLength},
+ {0, 4, 8},
{1}};
char[][] chars = {
- null,
+ null,
{'\u202a', '\u202b', '\u202c', '\u200e', '\u200e', '\u202b', '\u202c', '\u202c'},
{'\u202b', '\u202a', '\u202c', '\u200f', '\u200f', '\u202a', '\u202c', '\u202c'},
- {0x202d, 0x202c},
+ {0x202d, 0x202c},
{0x202e, 0x202c},
- null,
+ null,
null};
int[][] levels = {
- {0, 0, 1, 1, 1, 1, 0, 0},
- {4, 4, 3, 3, 2, 3, 4, 4},
+ {0, 0, 1, 1, 1, 1, 0, 0},
+ {4, 4, 3, 3, 2, 3, 4, 4},
{2, 2, 3, 3, 1, 3, 2, 2},
{2, 2, 2, 2, 2, 2, 2, 2}, //Fails on cocoa, where it returns {0, 0, 0, 0, 0, 0, 0, 0}
- {1, 1, 1, 1, 1, 1, 1, 1},
+ {1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 1, 1, 0, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 0, 0}};
int[] offsets = {0, textLength};
@@ -277,19 +277,19 @@ public void test_getLineOffsets() {
int[] offsets = layout.getLineOffsets();
int[] expected = new int [] {0, 8, 15, 15};
for (int i = 0; i < offsets.length; i++) {
- assertEquals(expected[i], offsets[i]);
+ assertEquals(expected[i], offsets[i]);
}
layout.setText("");
offsets = layout.getLineOffsets();
expected = new int [] {0, 0};
for (int i = 0; i < offsets.length; i++) {
- assertEquals(expected[i], offsets[i]);
+ assertEquals(expected[i], offsets[i]);
}
layout.setText("\n");
offsets = layout.getLineOffsets();
expected = new int [] {0, 1, 1};
for (int i = 0; i < offsets.length; i++) {
- assertEquals(expected[i], offsets[i]);
+ assertEquals(expected[i], offsets[i]);
}
layout.setText("WMWM");
int width = layout.getBounds().width;
@@ -297,15 +297,15 @@ public void test_getLineOffsets() {
offsets = layout.getLineOffsets();
expected = new int [] {0, 1, 2, 3, 4};
for (int i = 0; i < offsets.length; i++) {
- assertEquals(expected[i], offsets[i]);
+ assertEquals(expected[i], offsets[i]);
}
layout.setWidth(width / 2 + 1);
offsets = layout.getLineOffsets();
expected = new int [] {0, 2, 4};
for (int i = 0; i < offsets.length; i++) {
- assertEquals(expected[i], offsets[i]);
+ assertEquals(expected[i], offsets[i]);
}
-
+
layout.dispose();
}
@@ -332,11 +332,11 @@ public void test_getLineIndex() {
try {
layout.getLineIndex(-1);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
try {
layout.getLineIndex(text.length() + 1);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
layout.dispose();
}
@@ -355,8 +355,8 @@ public void test_getLineBounds() {
layout.setText(text);
Rectangle rect0 = layout.getLineBounds(0);
Rectangle rect1 = layout.getLineBounds(1);
- Rectangle rect2 = layout.getLineBounds(2);
-
+ Rectangle rect2 = layout.getLineBounds(2);
+
assertTrue(rect0.width > rect1.width);
assertEquals(0, rect2.width);
assertEquals(0, rect0.x);
@@ -374,15 +374,15 @@ public void test_getLineBounds() {
newRect1 = layout.getLineBounds(0);
assertEquals(100, newRect1.x);
assertEquals(bounds.height, rect0.height + rect1.height + rect2.height);
-
+
try {
layout.getLineBounds(-1);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
try {
layout.getLineBounds(3);
fail("invalid range expection expected");
- } catch (Exception e) {}
+ } catch (Exception e) {}
layout.dispose();
}
@@ -394,7 +394,7 @@ public void test_setStyle() {
s2 = new TextStyle (null, null, null);
s3 = new TextStyle (null, null, null);
s4 = new TextStyle (null, null, null);
-
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 2, 3);
@@ -403,9 +403,9 @@ public void test_setStyle() {
assertEquals(s1, layout.getStyle(2));
assertEquals(s1, layout.getStyle(3));
assertEquals(null, layout.getStyle(4));
- assertEquals(null, layout.getStyle(5));
+ assertEquals(null, layout.getStyle(5));
layout.dispose();
-
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -416,9 +416,9 @@ public void test_setStyle() {
assertEquals(s2, layout.getStyle(2));
assertEquals(s2, layout.getStyle(3));
assertEquals(s3, layout.getStyle(4));
- assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(s3, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -430,9 +430,9 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(2));
assertEquals(s2, layout.getStyle(3));
assertEquals(s3, layout.getStyle(4));
- assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(s3, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -444,22 +444,22 @@ public void test_setStyle() {
assertEquals(s2, layout.getStyle(2));
assertEquals(s4, layout.getStyle(3));
assertEquals(s4, layout.getStyle(4));
- assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(s3, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
layout.setStyle (s2, 2, 3);
layout.setStyle (s3, 4, 5);
- layout.setStyle (s4, 1, 4);
+ layout.setStyle (s4, 1, 4);
assertEquals(s1, layout.getStyle(0));
assertEquals(s4, layout.getStyle(1));
assertEquals(s4, layout.getStyle(2));
assertEquals(s4, layout.getStyle(3));
assertEquals(s4, layout.getStyle(4));
- assertEquals(s3, layout.getStyle(5));
- layout.dispose();
+ assertEquals(s3, layout.getStyle(5));
+ layout.dispose();
layout = new TextLayout (display);
layout.setText("aabbcc");
@@ -473,8 +473,8 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(3));
assertEquals(s2, layout.getStyle(4));
assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -486,9 +486,9 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(2));
assertEquals(s4, layout.getStyle(3));
assertEquals(s3, layout.getStyle(4));
- assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(s3, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 0);
@@ -501,8 +501,8 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(3));
assertEquals(s4, layout.getStyle(4));
assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 0);
@@ -515,8 +515,8 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(3));
assertEquals(s2, layout.getStyle(4));
assertEquals(s3, layout.getStyle(5));
- layout.dispose();
-
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -528,9 +528,9 @@ public void test_setStyle() {
assertEquals(null, layout.getStyle(2));
assertEquals(null, layout.getStyle(3));
assertEquals(null, layout.getStyle(4));
- assertEquals(null, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(null, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 0, 1);
@@ -542,9 +542,9 @@ public void test_setStyle() {
assertEquals(s4, layout.getStyle(2));
assertEquals(s4, layout.getStyle(3));
assertEquals(s4, layout.getStyle(4));
- assertEquals(s4, layout.getStyle(5));
- layout.dispose();
-
+ assertEquals(s4, layout.getStyle(5));
+ layout.dispose();
+
layout = new TextLayout (display);
layout.setText("aabbcc");
layout.setStyle (s1, 2, 2);
@@ -555,8 +555,8 @@ public void test_setStyle() {
assertEquals(s2, layout.getStyle(2));
assertEquals(null, layout.getStyle(3));
assertEquals(null, layout.getStyle(4));
- assertEquals(null, layout.getStyle(5));
- layout.dispose();
+ assertEquals(null, layout.getStyle(5));
+ layout.dispose();
}
@Test
@@ -568,13 +568,13 @@ public void test_getAlignment() {
assertEquals(SWT.CENTER, layout.getAlignment());
layout.setAlignment(SWT.RIGHT);
assertEquals(SWT.RIGHT, layout.getAlignment());
-
+
layout.setAlignment(SWT.PUSH);
assertEquals(SWT.RIGHT, layout.getAlignment());
layout.setAlignment(SWT.CENTER| SWT.PUSH);
assertEquals(SWT.CENTER, layout.getAlignment());
-
+
layout.setAlignment(SWT.CENTER| SWT.LEFT | SWT.RIGHT);
assertEquals(SWT.LEFT, layout.getAlignment());
@@ -588,13 +588,13 @@ public void test_getOrientation() {
assertEquals(SWT.LEFT_TO_RIGHT, layout.getOrientation());
layout.setOrientation(SWT.RIGHT_TO_LEFT);
assertEquals(SWT.RIGHT_TO_LEFT, layout.getOrientation());
-
+
layout.setOrientation(SWT.PUSH);
assertEquals(SWT.RIGHT_TO_LEFT, layout.getOrientation());
layout.setOrientation(SWT.LEFT_TO_RIGHT | SWT.PUSH);
assertEquals(SWT.LEFT_TO_RIGHT, layout.getOrientation());
-
+
layout.setOrientation(SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
assertEquals(SWT.LEFT_TO_RIGHT, layout.getOrientation());
@@ -627,7 +627,7 @@ public void test_getLocation() {
assertEquals(layout.getLocation(0, true).x, layout.getLocation(1, false).x);
assertEquals(layout.getLocation(2, false).x, layout.getLineBounds(0).width);
assertEquals(layout.getLocation(2, true).x, layout.getLocation(3, false).x);
- assertEquals(layout.getLocation(3, true).x, layout.getLocation(1, true).x);
+ assertEquals(layout.getLocation(3, true).x, layout.getLocation(1, true).x);
assertEquals(layout.getLocation(4, false).x, layout.getLineBounds(0).width);
assertEquals(layout.getLocation(4, true).x, layout.getLineBounds(0).width);
@@ -647,7 +647,7 @@ public void test_getNextOffset() {
TextLayout layout = new TextLayout(display);
String text;
int offset;
-
+
text = "word word word";
layout.setText(text);
offset = 0;
@@ -700,8 +700,8 @@ public void test_getNextOffset() {
assertEquals(0, layout.getPreviousOffset(5, SWT.MOVEMENT_WORD_START));
assertEquals(5, layout.getPreviousOffset(6, SWT.MOVEMENT_WORD_START));
-
-
+
+
text = "AB \u05E9\u05E0 CD\nHello";
layout.setText(text);
offset = 0;
@@ -718,30 +718,30 @@ public void test_getNextOffset() {
offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(0, offset);
offset = 7;
- offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
+ offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(8, offset);
- offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
+ offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(9, offset);
- offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
+ offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(text.length(), offset);
- offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_WORD_START);
+ offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(9, offset);
- offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_WORD_START);
+ offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_WORD_START);
assertEquals(8, offset);
- offset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
+ offset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
assertEquals(9, offset);
- offset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
+ offset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
assertEquals(10, offset);
- offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
+ offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
assertEquals(9, offset);
- offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
+ offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
assertEquals(8, offset);
- offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
+ offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
assertEquals(7, offset);
- for (int i = 0; i < text.length(); i++) {
+ for (int i = 0; i < text.length(); i++) {
assertEquals(i+1, layout.getNextOffset(i, SWT.MOVEMENT_CLUSTER));
}
- for (int i = text.length(); i > 0; i--) {
+ for (int i = text.length(); i > 0; i--) {
assertEquals(i-1, layout.getPreviousOffset(i, SWT.MOVEMENT_CLUSTER));
}
layout.dispose();
@@ -756,17 +756,17 @@ public void test_getNextOffset2() {
}
return;
}
- //Text thai cluster separate so it can be excluded
- //for gtk, testing machine (rhel4) is too old to
+ //Text thai cluster separate so it can be excluded
+ //for gtk, testing machine (rhel4) is too old to
//support thai.
-
+
TextLayout layout = new TextLayout(display);
layout.setText("A\u0E19\u0E49\u0E33B");
- String[] messages = {"no segments", "segments", "segments (duplicate at 0)", "segments (duplicate at 1)", "segments (duplicate at 2)",
+ String[] messages = {"no segments", "segments", "segments (duplicate at 0)", "segments (duplicate at 1)", "segments (duplicate at 2)",
"segments (duplicate at 3)", "segments (duplicate at 4)", "segments (duplicate at 5)"};
// int[][] segments = {null, {0, 1, 2, 3, 4, 5}, {0, 0, 1, 2, 3, 4, 5}, {0, 1, 1, 2, 3, 4, 5}, {0, 1, 2, 2, 3, 4, 5}, {0, 1, 2, 3, 3, 4, 5},
// {0, 1, 2, 3, 4, 4, 5}, {0, 1, 2, 3, 4, 5, 5}};
-
+
int[][] segments = {null};
for (int i = 0; i < segments.length; i++) {
@@ -794,8 +794,8 @@ public void test_getLineSpacing() {
try {
layout.setSpacing(-1);
fail("invalid range expection expected");
- } catch (Exception e) {}
- assertEquals(50, layout.getSpacing());
+ } catch (Exception e) {}
+ assertEquals(50, layout.getSpacing());
layout.setSpacing(0);
assertEquals(0, layout.getSpacing());
layout.dispose();
@@ -813,27 +813,27 @@ public void test_getOffset() {
}
TextLayout layout = new TextLayout(display);
String text = "AB \u05E9\u05E0 CD\nHello";
- layout.setText(text);
+ layout.setText(text);
int[] trailing = new int[1];
-
+
assertEquals(0, layout.getOffset(0, 0, trailing));
assertEquals(0, trailing[0]);
Point point = layout.getLocation(0, true);
- assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
- assertEquals(0, trailing[0]);
+ assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(0, trailing[0]);
point = layout.getLocation(1, false);
assertEquals(0, layout.getOffset(point.x - 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(2, true);
- assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(4, true);
- assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
- assertEquals(1, trailing[0]);
+ assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
+ assertEquals(1, trailing[0]);
point = layout.getLocation(4, false);
- assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
-
+
Rectangle bounds = layout.getBounds();
layout.setWidth(bounds.width + 100);
layout.setAlignment(SWT.CENTER);
@@ -841,19 +841,19 @@ public void test_getOffset() {
assertEquals(0, layout.getOffset(0, 0, trailing));
assertEquals(0, trailing[0]);
point = layout.getLocation(0, true);
- assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
- assertEquals(0, trailing[0]);
+ assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(0, trailing[0]);
point = layout.getLocation(1, false);
assertEquals(0, layout.getOffset(point.x - 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(2, true);
- assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(4, true);
- assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
- assertEquals(1, trailing[0]);
+ assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
+ assertEquals(1, trailing[0]);
point = layout.getLocation(4, false);
- assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
layout.setAlignment(SWT.RIGHT);
@@ -861,21 +861,21 @@ public void test_getOffset() {
assertEquals(0, layout.getOffset(0, 0, trailing));
assertEquals(0, trailing[0]);
point = layout.getLocation(0, true);
- assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
- assertEquals(0, trailing[0]);
+ assertEquals(1, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(0, trailing[0]);
point = layout.getLocation(1, false);
assertEquals(0, layout.getOffset(point.x - 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(2, true);
- assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(4, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
point = layout.getLocation(4, true);
- assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
- if (!isCocoa) assertEquals(1, trailing[0]);
+ assertEquals(2, layout.getOffset(point.x - 1, 0, trailing));
+ if (!isCocoa) assertEquals(1, trailing[0]);
point = layout.getLocation(4, false);
- assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
+ assertEquals(3, layout.getOffset(point.x + 1, 0, trailing));
assertEquals(1, trailing[0]);
-
+
text = "Text";
layout.setText(text);
int width = layout.getBounds().width;
@@ -889,7 +889,7 @@ public void test_getOffset() {
layout.setAlignment(SWT.RIGHT);
assertEquals(0, layout.getOffset(1+100, 0, null));
assertEquals(text.length()-1, layout.getOffset(width-1+100, 0, null));
-
+
layout.dispose();
}
@@ -901,7 +901,7 @@ public void test_getTabs() {
layout.setTabs(tabs);
int[] result = layout.getTabs();
assertEquals(tabs.length, result.length);
- for (int i = 0; i < result.length; i++) {
+ for (int i = 0; i < result.length; i++) {
assertEquals("pos: " + i, tabs[i], result[i]);
}
layout.setTabs(null);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java
index 0b41e3994a..20c7ba4405 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java
@@ -23,7 +23,7 @@ import org.junit.Test;
* @see org.eclipse.swt.printing.PrintDialog
*/
public class Test_org_eclipse_swt_printing_PrintDialog extends Test_org_eclipse_swt_widgets_Dialog {
-
+
@Override
@Before
public void setUp() {
@@ -35,7 +35,7 @@ public void setUp() {
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_Shell() {
new PrintDialog(shell);
-
+
try {
new PrintDialog(null);
fail("No exception thrown for parent == null");
@@ -47,7 +47,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_Shell() {
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_ShellI() {
new PrintDialog(shell, SWT.NONE);
-
+
try {
new PrintDialog(null, SWT.NONE);
fail("No exception thrown for parent == null");
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java
index 31fac4bf0b..07055a6afd 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java
@@ -156,8 +156,8 @@ public void test_getPrinterList() {
PrinterData list[] = Printer.getPrinterList();
if (list.length == 1) {
if (SWT.getPlatform().equals("gtk")) {
- /* Even though there is no default printer data,
- * on GTK it is still possible to have a print
+ /* Even though there is no default printer data,
+ * on GTK it is still possible to have a print
* to file backend
*/
assertTrue(list[0].driver.equals("GtkPrintBackendFile"));
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java
index b5fb454776..6da31d6162 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java
@@ -31,7 +31,7 @@ import org.junit.Test;
* @see org.eclipse.swt.program.Program
*/
public class Test_org_eclipse_swt_program_Program {
-
+
@Before
public void setUp() {
Display.getDefault();
@@ -53,10 +53,10 @@ public void test_equalsLjava_lang_Object() {
@Test
public void test_executeLjava_lang_String() {
-
+
// This test is incomplete because a true test of execute would open
// an application that cannot be programmatically closed.
-
+
try {
Program[] programs = Program.getPrograms();
if (programs != null && programs.length > 0) {
@@ -64,9 +64,9 @@ public void test_executeLjava_lang_String() {
// Cannot test empty string argument because it may launch something.
//boolean result = programs[0].execute("");
//assertFalse(result);
-
+
// test null argument
-
+
programs[0].execute(null);
fail("Failed to throw ERROR_NULL_ARGUMENT");
}
@@ -85,7 +85,7 @@ public void test_findProgramLjava_lang_String() {
// No assertion here because a null result is allowed.
}
}
-
+
try {
Program.findProgram(null);
fail("Failed to throw ERROR_NULL_ARGUMENT");
@@ -142,18 +142,18 @@ public void test_getName() {
@Test
public void test_getPrograms() {
Program[] programs = Program.getPrograms();
-
- // The result is not well-documented, but it should
+
+ // The result is not well-documented, but it should
// be non-null and contain no null entries.
-
+
assertNotNull(programs);
-
+
Map<Integer, Program> lookup = new HashMap<>();
for (int i=0; i<programs.length; i++) {
-
+
// test non-null entry
assertNotNull(programs[i]);
-
+
// test unique hash code
int hashCode = programs[i].hashCode();
Integer key = Integer.valueOf(hashCode);
@@ -171,11 +171,11 @@ public void test_launchLjava_lang_String() {
// This test is incomplete because a true test of launch would open
// an application that cannot be programmatically closed.
-
+
// Cannot test empty string argument because it may launch something.
-
+
// test null argument
-
+
try {
Program.launch(null);
fail("Failed to throw ERROR_NULL_ARGUMENT");
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
index 7c25f78a38..74e9ccfe29 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
@@ -78,17 +78,17 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
public void widgetDefaultSelected(SelectionEvent e) {
}
};
-
+
try {
button.addSelectionListener(null);
fail("No exception thrown for addSelectionListener with null argument");
} catch (IllegalArgumentException e) {
}
-
+
button.addSelectionListener(listener);
button.notifyListeners(SWT.Selection, new Event());
assertTrue(listenerCalled);
-
+
try {
button.removeSelectionListener(null);
fail("No exception thrown for removeSelectionListener with null argument");
@@ -270,7 +270,7 @@ public void test_consistency_MenuDetect () {
tearDown();
setUp(SWT.ARROW);
consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
-
+
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
index 125f28cd61..b35197de3e 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
@@ -118,7 +118,7 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
caret.setFont(font);
assertEquals(font, caret.getFont());
caret.setFont(null);
-
+
font = new Font(caret.getDisplay(), SwtTestUtil.testFontName, 10, SWT.NORMAL);
caret.setFont(font);
assertEquals(font, caret.getFont());
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java
index a05e10dd63..0b64076b7c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java
@@ -40,7 +40,7 @@ public void setUp() {
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_Shell() {
new ColorDialog(shell);
-
+
try {
new ColorDialog(null);
fail("No exception thrown for parent == null");
@@ -52,7 +52,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_Shell() {
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_ShellI() {
new ColorDialog(shell, SWT.NULL);
-
+
try {
new ColorDialog(null, SWT.NULL);
fail("No exception thrown for parent == null");
@@ -65,12 +65,12 @@ public void test_ConstructorLorg_eclipse_swt_widgets_ShellI() {
public void test_setRGBLorg_eclipse_swt_graphics_RGB() {
RGB rgb = new RGB(0, 0, 0);
- assertTrue(":a:", colorDialog.getRGB() == null);
-
+ assertTrue(":a:", colorDialog.getRGB() == null);
+
colorDialog.setRGB(rgb);
assertTrue(":b:", colorDialog.getRGB() == rgb);
colorDialog.setRGB(null);
- assertTrue(":c:", colorDialog.getRGB() == null);
+ assertTrue(":c:", colorDialog.getRGB() == null);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
index 86db82b8a4..bc498b70b5 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
@@ -140,7 +140,7 @@ public void test_consistency_ChevronMouseSelection() {
class CoolItemSelectionListener extends SelectionAdapter {
private Menu menu = null;
-
+
@Override
public void widgetSelected(SelectionEvent event) {
/**
@@ -158,7 +158,7 @@ class CoolItemSelectionListener extends SelectionAdapter {
menu = null;
return;
}
-
+
/* Get the cool item and convert its bounds to display coordinates. */
CoolItem coolItem = (CoolItem) event.widget;
Rectangle itemBounds = coolItem.getBounds ();
@@ -166,12 +166,12 @@ class CoolItemSelectionListener extends SelectionAdapter {
Point pt = coolBar.toDisplay(new Point (itemBounds.x, itemBounds.y));
itemBounds.x = pt.x;
itemBounds.y = pt.y;
-
+
/* Get the toolbar from the cool item. */
ToolBar toolBar = (ToolBar) coolItem.getControl ();
ToolItem[] tools = toolBar.getItems ();
int toolCount = tools.length;
-
+
/* Convert the bounds of each tool item to display coordinates,
* and determine which ones are past the bounds of the cool item.
*/
@@ -185,7 +185,7 @@ class CoolItemSelectionListener extends SelectionAdapter {
if (!intersection.equals (toolBounds)) break;
i++;
}
-
+
/* Create a pop-up menu with items for each of the hidden buttons. */
menu = new Menu (coolBar);
for (int j = i; j < toolCount; j++) {
@@ -194,7 +194,7 @@ class CoolItemSelectionListener extends SelectionAdapter {
MenuItem menuItem = new MenuItem (menu, SWT.NONE);
menuItem.setText(text);
}
-
+
/* Display the pop-up menu at the lower left corner of the arrow button.
* Dispose the menu when the user is done with it.
*/
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java
index 2389e37d40..c525de1f32 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java
@@ -46,10 +46,10 @@ public void setUp() {
public void test_ConstructorLorg_eclipse_swt_widgets_CoolBarI() {
CoolBar coolBar = new CoolBar(shell, 0);
new CoolItem(coolBar, 0);
-
+
try {
new CoolItem(null, 0);
- fail("No exception thrown for parent == null");
+ fail("No exception thrown for parent == null");
}
catch (IllegalArgumentException e) {
}
@@ -76,7 +76,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_CoolBarII() {
assertEquals(2, coolBar.getItemCount());
coolItem = new CoolItem(coolBar, 0, 0);
assertEquals(3, coolBar.getItemCount());
- assertEquals(coolItem, coolBar.getItem(0));
+ assertEquals(coolItem, coolBar.getItem(0));
}
@Test
@@ -108,12 +108,12 @@ public void test_getBounds() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foo");
coolItem.setControl(button);
-
+
Rectangle rect = coolItem.getBounds();
Point size = coolItem.getSize();
assertEquals(size.x, rect.width);
assertEquals(size.y, rect.height);
-
+
coolItem.setSize(25, 25);
rect = coolItem.getBounds();
coolItem.setSize(100, 25);
@@ -154,7 +154,7 @@ public void test_getPreferredSize() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foobar");
coolItem.setControl(button);
-
+
Point pref = coolItem.getPreferredSize();
coolItem.setPreferredSize(pref);
assertEquals(pref, coolItem.getPreferredSize());
@@ -167,7 +167,7 @@ public void test_getSize() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foo");
coolItem.setControl(button);
-
+
Point size = coolItem.getSize();
Rectangle rect = coolItem.getBounds();
assertEquals(rect.width, size.x);
@@ -179,21 +179,21 @@ public void test_setControlLorg_eclipse_swt_widgets_Control() {
CoolBar coolBar = new CoolBar(shell, 0);
CoolItem coolItem = new CoolItem(coolBar, 0);
coolItem.setControl(null);
-
+
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foobar");
-
+
Point size = coolItem.getSize();
coolItem.setControl(button);
Point size2 = coolItem.getSize();
assertTrue(size2.x > size.x);
-
+
if (!MINIMAL_CONFORMANCE) {
size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
size2 = coolItem.computeSize(size.x, size.y);
assertEquals(size2, coolItem.getSize());
}
-
+
button = new Button(coolBar, SWT.PUSH);
button.dispose();
try {
@@ -202,7 +202,7 @@ public void test_setControlLorg_eclipse_swt_widgets_Control() {
}
catch (IllegalArgumentException e) {
}
-
+
button = new Button(shell, SWT.PUSH);
try {
coolItem.setControl(button);
@@ -219,7 +219,7 @@ public void test_setPreferredSizeII() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foobar");
coolItem.setControl(button);
-
+
Point size = coolItem.getSize();
coolItem.setPreferredSize(size);
assertEquals(size.x, coolItem.getSize().x);
@@ -234,7 +234,7 @@ public void test_setPreferredSizeLorg_eclipse_swt_graphics_Point() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foobar");
coolItem.setControl(button);
-
+
Point size = new Point(50, 30);
coolItem.setPreferredSize(size);
Point size2 = coolItem.getPreferredSize();
@@ -257,7 +257,7 @@ public void test_setSizeII() {
Point smallest = coolItem.getSize();
coolItem.setSize(1, 1);
assertEquals(smallest, coolItem.getSize());
-
+
Rectangle rect = coolItem.getBounds();
Point size = coolItem.getSize();
coolItem.setSize(rect.width, rect.height);
@@ -271,7 +271,7 @@ public void test_setSizeLorg_eclipse_swt_graphics_Point() {
Button button = new Button(coolBar, SWT.PUSH);
button.setText("foo");
coolItem.setControl(button);
-
+
Point size = new Point(50, 50);
coolItem.setSize(size);
Point size2 = coolItem.getSize();
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
index bb9651aa7e..6aa27b436f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
@@ -39,7 +39,7 @@ public class Test_org_eclipse_swt_widgets_DateTime extends Test_org_eclipse_swt_
static final int JAN = 0, FEB = 1, AUG = 7, NOV = 10;
DateTime datetime;
int style = SWT.DATE;
-
+
@Parameters
public static Collection<Object[]> data() {
Object[][] data = new Object[][] { { SWT.DATE }, { SWT.TIME}, { SWT.CALENDAR }};
@@ -107,17 +107,17 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
public void widgetDefaultSelected(SelectionEvent e) {
}
};
-
+
try {
datetime.addSelectionListener(null);
fail("No exception thrown for addSelectionListener with null argument");
} catch (IllegalArgumentException e) {
}
-
+
datetime.addSelectionListener(listener);
datetime.notifyListeners(SWT.Selection, new Event());
assertTrue(listenerCalled);
-
+
try {
datetime.removeSelectionListener(null);
fail("No exception thrown for removeSelectionListener with null argument");
@@ -433,7 +433,7 @@ public void test_setYearI() {
datetime.setYear(-1947);
assertEquals(2005, datetime.getYear());
-
+
datetime.setDate(2008, FEB, 29);
datetime.setYear(2007);
assertEquals(2008, datetime.getYear());
@@ -461,7 +461,7 @@ public void test_consistency_MenuDetect () {
tearDown();
setUp(SWT.CALENDAR);
consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
-
+
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
index 8732ef4c73..06adb4d637 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
@@ -38,7 +38,7 @@ public class Test_org_eclipse_swt_widgets_Decorations extends Test_org_eclipse_s
@Override
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() {
- // do nothing, even though this is not an abstract class, it was never meant to
+ // do nothing, even though this is not an abstract class, it was never meant to
// be instantiated
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java
index 95922d0511..3a44fceb82 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java
@@ -41,7 +41,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_Shell() {
fail("No exception thrown for null parent");
}
catch (IllegalArgumentException e) {
- }
+ }
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
index 778be95f0b..9061c65253 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
@@ -46,14 +46,14 @@ public void setUp() {
@Test
public void test_addExpandListenerLorg_eclipse_swt_events_ExpandListener() {
final boolean[] listenerCalled = new boolean[] {false};
- ExpandListener expandListener = new ExpandListener() {
+ ExpandListener expandListener = new ExpandListener() {
@Override
public void itemCollapsed(ExpandEvent e) {
- listenerCalled[0] = true;
+ listenerCalled[0] = true;
}
@Override
public void itemExpanded(ExpandEvent e) {
- listenerCalled[0] = true;
+ listenerCalled[0] = true;
}
};
@@ -62,7 +62,7 @@ public void test_addExpandListenerLorg_eclipse_swt_events_ExpandListener() {
fail("No exception thrown for addExpandListener with null argument");
} catch (IllegalArgumentException e) {
}
-
+
expandBar.addExpandListener(expandListener);
expandBar.notifyListeners(SWT.Expand, new Event());
assertTrue(":a:", listenerCalled[0]);
@@ -70,13 +70,13 @@ public void test_addExpandListenerLorg_eclipse_swt_events_ExpandListener() {
listenerCalled[0] = false;
expandBar.notifyListeners(SWT.Collapse, new Event());
assertTrue(":b:", listenerCalled[0]);
-
+
try {
expandBar.removeExpandListener(null);
fail("No exception thrown for removeExpandListener with null argument");
} catch (IllegalArgumentException e) {
}
-
+
listenerCalled[0] = false;
expandBar.removeExpandListener(expandListener);
expandBar.notifyListeners(SWT.Expand, new Event());
@@ -136,7 +136,7 @@ public void test_getItems() {
items[i] = new ExpandItem(expandBar, 0);
}
assertArrayEquals(items, expandBar.getItems());
-
+
expandBar.getItems()[0].dispose();
assertArrayEquals(new ExpandItem[] {items[1], items[2], items[3], items[4]}, expandBar.getItems());
@@ -157,14 +157,14 @@ public void test_indexOfLorg_eclipse_swt_widgets_ExpandItem() {
for (int i = 0; i < number; i++) {
assertTrue(":a:" + i, expandBar.indexOf(items[i] ) == i);
}
-
+
items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
try {
- expandBar.indexOf(null);
+ expandBar.indexOf(null);
fail("No exception thrown for expandItem == null");
}
catch (IllegalArgumentException e) {
@@ -176,10 +176,10 @@ public void test_indexOfLorg_eclipse_swt_widgets_ExpandItem() {
public void test_setSpacingI() {
expandBar.setSpacing(0);
assertEquals(expandBar.getSpacing(), 0);
-
+
expandBar.setSpacing(3);
assertEquals(expandBar.getSpacing(), 3);
-
+
expandBar.setSpacing(-4);
assertEquals(expandBar.getSpacing(), 3);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandItem.java
index ce52841ce7..a3fe481758 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandItem.java
@@ -35,7 +35,7 @@ public class Test_org_eclipse_swt_widgets_ExpandItem extends Test_org_eclipse_sw
public void setUp() {
super.setUp();
expandBar = new ExpandBar(shell, 0);
- expandItem = new ExpandItem(expandBar, 0);
+ expandItem = new ExpandItem(expandBar, 0);
setWidget(expandItem);
}
@@ -75,16 +75,16 @@ public void test_getControl() {
}
@Test
-public void test_getParent() {
+public void test_getParent() {
assertEquals(expandItem.getParent(), expandBar);
}
@Test
public void test_setControlLorg_eclipse_swt_widgets_Control() {
- expandItem.setControl(null);
+ expandItem.setControl(null);
Button button = new Button(expandBar, SWT.PUSH);
expandItem.setControl(button);
-
+
button = new Button(expandBar, SWT.PUSH);
button.dispose();
try {
@@ -93,7 +93,7 @@ public void test_setControlLorg_eclipse_swt_widgets_Control() {
}
catch (IllegalArgumentException e) {
}
-
+
button = new Button(shell, SWT.PUSH);
try {
expandItem.setControl(button);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java
index 65d73970ce..cad5f35b03 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java
@@ -54,19 +54,19 @@ public void test_ConstructorLorg_eclipse_swt_widgets_ShellI() {
style &= ~SWT.LEFT_TO_RIGHT;
style &= ~SWT.RIGHT_TO_LEFT;
assertTrue(style==SWT.APPLICATION_MODAL);
-
+
fd = new FileDialog(shell, SWT.APPLICATION_MODAL);
style = fd.getStyle();
style &= ~SWT.LEFT_TO_RIGHT;
style &= ~SWT.RIGHT_TO_LEFT;
assertTrue(style==SWT.APPLICATION_MODAL);
-
+
fd = new FileDialog(shell, SWT.PRIMARY_MODAL);
style = fd.getStyle();
style &= ~SWT.LEFT_TO_RIGHT;
style &= ~SWT.RIGHT_TO_LEFT;
assertTrue(style==SWT.PRIMARY_MODAL);
-
+
fd = new FileDialog(shell, SWT.SYSTEM_MODAL);
style = fd.getStyle();
style &= ~SWT.LEFT_TO_RIGHT;
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java
index a2b14ca3aa..93b4540f99 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java
@@ -63,13 +63,13 @@ public void test_setFontDataLorg_eclipse_swt_graphics_FontData() {
FontData [] fontData = new FontData [1];
fontData [0] = new FontData ();
- assertNull(fontDialog.getFontList());
-
+ assertNull(fontDialog.getFontList());
+
fontDialog.setFontList(fontData);
assertArrayEquals(fontDialog.getFontList(), fontData);
fontDialog.setFontList(null);
- assertNull(fontDialog.getFontList());
+ assertNull(fontDialog.getFontList());
}
@Test
@@ -77,7 +77,7 @@ public void test_setRGBLorg_eclipse_swt_graphics_RGB() {
RGB rgb = new RGB(255, 0, 0);
fontDialog.setRGB(rgb);
RGB rgb2 = fontDialog.getRGB();
- assertEquals(rgb, rgb2);
+ assertEquals(rgb, rgb2);
}
/* custom */
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
index cac620828a..bd9d552792 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
@@ -64,7 +64,7 @@ public void test_getAlignment(){
{
label = new Label(shell, cases[i]);
assertEquals(label.getAlignment(), cases[i]);
- }
+ }
}
@Test
@@ -94,7 +94,7 @@ public void test_setAlignmentI(){
{
label.setAlignment(cases[i]);
assertEquals(label.getAlignment(), cases[i]);
- }
+ }
}
@Override
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java
index 4c2c9f6265..2a59dcf2cd 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java
@@ -72,17 +72,17 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
public void widgetDefaultSelected(SelectionEvent e) {
}
};
-
+
try {
link.addSelectionListener(null);
fail("No exception thrown for addSelectionListener with null argument");
} catch (IllegalArgumentException e) {
}
-
+
link.addSelectionListener(listener);
link.notifyListeners(SWT.Selection, new Event());
assertTrue(listenerCalled);
-
+
try {
link.removeSelectionListener(null);
fail("No exception thrown for removeSelectionListener with null argument");
@@ -140,9 +140,9 @@ public void test_setTextLjava_lang_String() {
"Te&&xt &text && <a>L&ink</a> h&i <a>fe&&lipe</a> &l &end&&",
"Text <a id=\"1\">Link</a> something <a href=\"bla bla2\" >Link2</a> somethingelse <a>Link3 large large</a>. some text to test this wrapping thing <A href=\"last\">this is suppose to be a very long link text the spraws over several lines in the text layout</a>.end",
"The SWT component is designed to provide <A>efficient</A>, <A>portable</A> <A>access to the user-interface facilities of the operating systems</A> on which it is implemented.",
- "some text",
- "ldkashdoehufweovcnhslvhregojebckreavbkuhxbiufvcyhbifuyewvbiureyd.,cmnesljliewjfchvbwoifivbeworixuieurvbiuvbohflksjeahfcliureafgyciabelitvyrwtlicuyrtliureybcliuyreuceyvbliureybct",
- "\n \n \b \t ",
+ "some text",
+ "ldkashdoehufweovcnhslvhregojebckreavbkuhxbiufvcyhbifuyewvbiureyd.,cmnesljliewjfchvbwoifivbeworixuieurvbiuvbohflksjeahfcliureafgyciabelitvyrwtlicuyrtliureybcliuyreuceyvbliureybct",
+ "\n \n \b \t ",
"\0"};
for (int i=0; i<cases.length; i++){
link.setText(cases[i]);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
index 159cf8a3ef..2234108082 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
@@ -76,7 +76,7 @@ public void test_addLjava_lang_String() {
assertArrayEquals(":b:", new String[] {"", "some \n text"}, list.getItems());
list.add("some text");
assertArrayEquals(":c:", new String[] {"", "some \n text", "some text"}, list.getItems());
-
+
// test single-selection list
setSingleList();
@@ -86,7 +86,7 @@ public void test_addLjava_lang_String() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
list.add("");
assertArrayEquals(":a:", new String[] {""}, list.getItems());
list.add("some \n text");
@@ -110,7 +110,7 @@ public void test_addLjava_lang_StringI() {
assertArrayEquals(":b:", new String[] {"", "some \n text"}, list.getItems());
list.add("some text", 0);
assertArrayEquals(":c:", new String[] {"some text", "", "some \n text" }, list.getItems());
-
+
try {
list.add(null, 0);
fail("No exception thrown string == null");
@@ -122,7 +122,7 @@ public void test_addLjava_lang_StringI() {
fail("No exception thrown index < 0");
} catch (IllegalArgumentException e) {
}
-
+
// test single-selection list
setSingleList();
@@ -134,14 +134,14 @@ public void test_addLjava_lang_StringI() {
}
assertEquals(0, list.getItemCount());
-
+
list.add("", 0);
assertArrayEquals(":a:", new String[] {""}, list.getItems());
list.add("some \n text", 1);
assertArrayEquals(":b:", new String[] {"", "some \n text"}, list.getItems());
list.add("some text", 0);
assertArrayEquals(":c:", new String[] {"some text", "", "some \n text" }, list.getItems());
-
+
try {
list.add(null, 0);
fail("No exception thrown string == null");
@@ -175,7 +175,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = true;
}
assertTrue("Expected exception not thrown for listener == null", exceptionThrown);
-
+
list.addSelectionListener(listener);
list.select(0);
assertTrue(":a:", listenerCalled == false);
@@ -188,11 +188,11 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = true;
}
assertTrue("Expected exception not thrown for listener == null", exceptionThrown);
-
+
// test single-selection list
setSingleList();
-
+
listenerCalled = false;
exceptionThrown = false;
try {
@@ -202,7 +202,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = true;
}
assertTrue("Expected exception not thrown for listener == null", exceptionThrown);
-
+
list.addSelectionListener(listener);
list.select(0);
assertTrue(":a:", listenerCalled == false);
@@ -215,7 +215,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = true;
}
assertTrue("Expected exception not thrown for listener == null", exceptionThrown);
-
+
}
@Override
@@ -249,7 +249,7 @@ public void test_deselect$I() {
assert(":ddd:", list.isSelected(1));
assert(":ddd:", list.isSelected(1));*/
-
+
setSingleList();
list.setItems(items);
list.setSelection(new String[] { "item3" });
@@ -285,7 +285,7 @@ public void test_deselectAll() {
list.deselectAll();
assertArrayEquals(empty, list.getSelection());
-
+
setSingleList();
list.setItems(items);
@@ -315,7 +315,7 @@ public void test_deselectI() {
list.deselect(1);
assertEquals(false, list.isSelected(1));
-
+
setSingleList();
list.setItems(items2);
list.setSelection(new String[] { "item3" });
@@ -380,12 +380,12 @@ public void test_deselectII() {
":ddddd:",
list.getSelectionIndices(), new int[] { 0, 1, 2, 3 });
-
+
setSingleList();
-
+
list.setItems(items2);
list.deselectAll();
-
+
list.select(0);
list.deselect(-3, -2);
@@ -397,7 +397,7 @@ public void test_deselectII() {
list.deselect(-1, -1);
assertArrayEquals(":e:", list.getSelectionIndices(), new int[] { 0 });
-
+
list.setSelection(new String[] { "item3" });
assertArrayEquals(list.getSelection(), new String[] { "item3" });
@@ -445,7 +445,7 @@ public void test_getItemCount() {
list.removeAll();
assertEquals(0, list.getItemCount());
-
+
setSingleList();
assertEquals(0, list.getItemCount());
list.setItems(items);
@@ -469,7 +469,7 @@ public void test_getItemHeight() {
FontData fontData = list.getFont().getFontData()[0];
int lineHeight;
Font font;
-
+
font = new Font(list.getDisplay(), fontData.getName(), 8, fontData.getStyle());
list.setFont(font);
lineHeight = list.getItemHeight();
@@ -498,10 +498,10 @@ public void test_getItemI() {
fail("No exception thrown for index < 0");
} catch (IllegalArgumentException e) {
}
-
+
assertEquals(list.getItem(3), "item3");
-
+
setSingleList();
list.setItems(items);
try {
@@ -509,13 +509,13 @@ public void test_getItemI() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
try {
list.getItem(-1);
fail("No exception thrown for index < 0");
} catch (IllegalArgumentException e) {
}
-
+
//assert(":a:", list.getItem(5)==null);
assertEquals("item3", list.getItem(3));
@@ -572,7 +572,7 @@ public void test_getSelection() {
assertEquals(list.getSelection().length, 2);
selItems = new String[] {items[0], items[1]};
assertArrayEquals(list.getSelection(), selItems);
-
+
list.setSelection(1, 1);
assertEquals(list.getSelection().length, 1);
assertEquals(list.getSelection()[0], items[1]);
@@ -586,7 +586,7 @@ public void test_getSelection() {
list.setSelection(bogus_items);
assertArrayEquals(empty, list.getSelection());
- // test single-selection lists
+ // test single-selection lists
setSingleList();
@@ -632,7 +632,7 @@ public void test_getSelectionCount() {
}
assertEquals(list.getSelectionCount(), 0);
-
+
setSingleList();
list.setItems(items);
@@ -649,7 +649,7 @@ public void test_getSelectionIndex() {
list.setSelection(items);
assertEquals(0, list.getSelectionIndex());
-
+
setSingleList();
list.setItems(items);
@@ -708,7 +708,7 @@ public void test_getSelectionIndices() {
list.setSelection(sel);
assertArrayEquals(new int[] { 1, 2 }, list.getSelectionIndices());
-
+
setSingleList();
list.setItems(items);
@@ -742,7 +742,7 @@ public void test_getTopIndex() {
list.setTopIndex(5);
assertEquals(5, list.getTopIndex());
-
+
setSingleList();
list.setItems(items);
@@ -769,26 +769,26 @@ public void test_indexOfLjava_lang_String() {
list.setItems(items2);
assertEquals(list.indexOf("text2"), 1);
-
+
setSingleList();
list.setItems(items);
assertEquals(-1, list.indexOf("text3", 4));
-
+
assertEquals(2, list.indexOf("text3"));
-
+
assertEquals(-1, list.indexOf("text4"));
-
+
try {
list.indexOf(null);
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
assertEquals(1, list.indexOf("text2"));
}
@@ -812,7 +812,7 @@ public void test_indexOfLjava_lang_StringI() {
fail("No exception thrown for string == null");
} catch (IllegalArgumentException e) {
}
-
+
setSingleList();
list.setItems(items2);
@@ -839,7 +839,7 @@ public void test_isSelectedI() {
assertTrue(list.isSelected(2));
assertEquals(false, list.isSelected(3));
-
+
setSingleList();
list.setItems(items);
@@ -860,7 +860,7 @@ public void test_remove$I() {
fail("No exception thrown for indices == null");
} catch (IllegalArgumentException e) {
}
-
+
String[] items = { "text0", "text1", "text2", "text3" };
list.setItems(items);
@@ -918,7 +918,7 @@ public void test_remove$I() {
list.remove(new int[] { 1, 3 });
assertArrayEquals(":e:", list.getItems(), new String[] { "text0", "text2" });
-
+
setSingleList();
try {
@@ -927,21 +927,21 @@ public void test_remove$I() {
fail("No exception thrown for indices == null");
} catch (IllegalArgumentException e) {
}
-
+
list.setItems(items);
assertEquals(4, list.getItemCount());
list.remove(new int[] { 1, 3 });
assertArrayEquals(":f:", list.getItems(), new String[] { "text0", "text2" });
-
+
list.setItems(items);
assertEquals(4, list.getItemCount());
list.remove(new int[] { 3, 1 });
assertArrayEquals(":g:", list.getItems(), new String[] { "text0", "text2" });
-
+
list.setItems(items);
assertEquals(4, list.getItemCount());
@@ -950,17 +950,17 @@ public void test_remove$I() {
list.remove(new int[] { 4, 1});
fail("No exception thrown");
} catch (IllegalArgumentException e) {
- }
+ }
assertArrayEquals(":h:", list.getItems(), items);
try {
list.remove(new int[] { 3, 1, -1 });
fail("No exception thrown");
} catch (IllegalArgumentException e) {
- }
+ }
assertArrayEquals(":h:", list.getItems(), items);
-
+
list.setItems(items);
assertEquals(4, list.getItemCount());
@@ -972,7 +972,7 @@ public void test_remove$I() {
assertArrayEquals(":i:", items, list.getItems());
-
+
assertEquals(4, list.getItemCount());
list.remove(new int[] { 1, 1, 1 });
@@ -993,7 +993,7 @@ public void test_removeAll() {
list.removeAll();
assertEquals(list.getItemCount(), 0);
-
+
setSingleList();
list.setItems(items);
assertEquals(4, list.getItemCount());
@@ -1001,7 +1001,7 @@ public void test_removeAll() {
list.removeAll();
assertEquals(0, list.getItemCount());
-
+
setSingleList();
assertEquals(0, list.getItemCount());
list.removeAll();
@@ -1060,13 +1060,13 @@ public void test_removeI() {
assertEquals(list.getItem(0), "text3");
list.remove(0);
assertEquals(list.getItemCount(), 0);
-
+
list.setItems(items);
list.remove(1, 2);
assertEquals(list.getItemCount(), 1);
assertEquals(list.getItem(0), "text1");
-
+
setSingleList();
list.setItems(items);
assertEquals(3, list.getItemCount());
@@ -1074,7 +1074,7 @@ public void test_removeI() {
list.remove(3);
fail("No exception thrown");
} catch (IllegalArgumentException e) {
- }
+ }
assertEquals(3, list.getItemCount());
/////////////////////////////////////////////////
try {
@@ -1082,7 +1082,7 @@ public void test_removeI() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
assertEquals(3, list.getItemCount());
////////////////////////////////////////////////
list.remove(1);
@@ -1100,7 +1100,7 @@ public void test_removeI() {
assertEquals(list.getItem(0), "text3");
list.remove(0);
assertEquals(list.getItemCount(), 0);
-
+
}
@Test
@@ -1162,7 +1162,7 @@ public void test_removeII() {
list.remove(2, 0);
assertEquals(3, list.getItemCount());
-
+
setSingleList();
list.setItems(items);
@@ -1184,19 +1184,19 @@ public void test_removeII() {
assertEquals(3, list.getItemCount());
//////////////////////////////////////////////////////////////
-
+
try {
list.remove(-1, 1);
fail("No exception thrown for start index < 0");
} catch (IllegalArgumentException e) {
}
assertEquals(3, list.getItemCount());
-
+
list.remove(1, 2);
assertEquals(1, list.getItemCount());
assertEquals("text1", list.getItem(0));
-
+
list.setItems(items);
assertEquals(3, list.getItemCount());
@@ -1242,7 +1242,7 @@ public void test_removeLjava_lang_String() {
list.remove("text2");
assertEquals(list.getItemCount(), 2);
-
+
setSingleList();
list.setItems(items);
assertEquals(4, list.getItemCount());
@@ -1261,7 +1261,7 @@ public void test_removeLjava_lang_String() {
}
assertEquals(4, list.getItemCount());
-
+
assertEquals(4, list.getItemCount());
list.remove("text3");
@@ -1279,7 +1279,7 @@ public void test_select$I() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
String[] items = { "item0", "item1", "item2", "item3" };
list.setItems(items);
@@ -1324,12 +1324,12 @@ public void test_select$I() {
select$I_helper(-1, 3, new int[] { 0, 1, 2, 3 });
select$I_helper(-1, 30, new int[] { 0, 1, 2, 3, 4 });
-
+
/*--- Single-select ---*/
-
+
setSingleList();
list.setItems(items);
-
+
try {
list.select((int[]) null);
fail("No exception thrown");
@@ -1350,7 +1350,7 @@ public void test_select$I() {
list.select(new int[] { 3 });
assertArrayEquals(list.getSelectionIndices(), new int[] { 3 });
-
+
list.select(new int[] { 4 });
assertArrayEquals(list.getSelectionIndices(), new int[] { 4 });
@@ -1382,7 +1382,7 @@ public void test_selectAll() {
list.selectAll();
assertEquals(list.getSelectionCount(), 4);
-
+
setSingleList();
list.setItems(items);
@@ -1416,7 +1416,7 @@ public void test_selectI() {
list.deselectAll();
list.select(0);
assertArrayEquals("select(0):", list.getSelectionIndices(), new int[] { 0 });
-
+
list.deselectAll();
list.select(-1);
assertArrayEquals("select(-1):", list.getSelectionIndices(), new int[] {});
@@ -1447,7 +1447,7 @@ public void test_selectI() {
list.deselectAll();
list.select(0);
assertArrayEquals("select(0):", list.getSelectionIndices(), new int[] { 0 });
-
+
list.deselectAll();
list.select(-1);
assertArrayEquals("select(-1):", list.getSelectionIndices(), new int[] {});
@@ -1515,7 +1515,7 @@ public void test_selectII() {
list.select(3, 5);
assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2, 3, 4 });
-
+
setSingleList();
list.select(0, 0);
assertArrayEquals("empty list", list.getSelectionIndices(), new int[] {});
@@ -1534,10 +1534,10 @@ public void test_selectII() {
list.deselectAll();
assertEquals(0, list.getSelectionCount());
-
+
list.select(1000, 2000);
assertEquals(0, list.getSelectionCount());
-
+
list.deselectAll();
assertEquals(0, list.getSelectionCount());
@@ -1596,7 +1596,7 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
FontData fontData = list.getFont().getFontData()[0];
int lineHeight;
Font font;
-
+
font = new Font(list.getDisplay(), fontData.getName(), 8, fontData.getStyle());
list.setFont(font);
lineHeight = list.getItemHeight();
@@ -1613,7 +1613,7 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
@Test
public void test_setItemILjava_lang_String() {
String[] items = { "item0", "item1", "item2", "item3" };
-
+
assertEquals(list.getItemCount(), 0);
int[] cases = { -10, 0, 10 };
for (int i = 0; i < cases.length; i++) {
@@ -1647,7 +1647,7 @@ public void test_setItemILjava_lang_String() {
list.setItems(items);
list.setItem(1, "new1");
assertArrayEquals(new String[] { "item0", "new1", "item2", "item3" }, list.getItems());
-
+
setSingleList();
assertEquals(0, list.getItemCount());
for (int i = 0; i < cases.length; i++) {
@@ -1659,7 +1659,7 @@ public void test_setItemILjava_lang_String() {
}
-
+
setSingleList();
for (int i = 0; i < cases.length; i++) {
try {
@@ -1671,7 +1671,7 @@ public void test_setItemILjava_lang_String() {
assertEquals(0, list.getItemCount());
-
+
setSingleList();
for (int i = 0; i < cases2.length; i++) {
try {
@@ -1682,11 +1682,11 @@ public void test_setItemILjava_lang_String() {
assertEquals(0, list.getItemCount());
}
-
+
list.setItems(items);
list.setItem(1, "new1");
assertArrayEquals(new String[] { "item0", "new1", "item2", "item3" }, list.getItems());
-
+
}
@Test
@@ -1698,7 +1698,7 @@ public void test_setItems$Ljava_lang_String() {
}
// TODO An SWTError should never happen and should not
- // be part of the test case. List should throw an
+ // be part of the test case. List should throw an
// SWTException.
// String[][] cases = { { null }, {
// "dsada", null, "dsdasdasd" }
@@ -1728,14 +1728,14 @@ public void test_setItems$Ljava_lang_String() {
} catch (IllegalArgumentException e) {
}
-
+
setSingleList();
for (int i = 0; i < itemArr.length; i++) {
list.setItems(itemArr[i]);
assertArrayEquals("case:" + i, itemArr[i], list.getItems());
}
-
+
try {
list.setItems((String[])null);
fail("No exception thrown");
@@ -1757,14 +1757,14 @@ public void test_setSelection$I() {
fail("No exception thrown for MULTI: setSelection((int[]) null)");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new int [] {2});
assertArrayEquals("MULTI: setSelection(new int [] {2})", list.getSelectionIndices(), new int[] {2});
assertEquals("MULTI: setSelection(new int [] {2}) getFocusIndex()", list.getFocusIndex(), 2);
list.setSelection(new int [] {number});
assertArrayEquals("MULTI: setSelection(new int [] {number})", list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(new int [] {3, 1, 5, 2});
assertArrayEquals("MULTI: setSelection(new int [] {3, 1, 5, 2})", list.getSelectionIndices(), new int[] {1, 2, 3, 5});
@@ -1773,14 +1773,14 @@ public void test_setSelection$I() {
list.setSelection(new int [] {-1, number});
assertArrayEquals("MULTI: setSelection(new int [] {-1, number})", list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(new int [] {number - 1, number});
assertArrayEquals("MULTI: setSelection(new int [] {number - 1, number})", list.getSelectionIndices(), new int[] {number - 1});
assertEquals("MULTI: setSelection(new int [] {number - 1, number}) getFocusIndex()", list.getFocusIndex(), number - 1);
list.setSelection(new int [] {-1, 0});
assertArrayEquals("MULTI: setSelection(new int [] {-1, 0})", list.getSelectionIndices(), new int[] {0});
-
+
list.setSelection(new int [] {0, 1, 2, 3, 5});
assertArrayEquals("MULTI: setSelection(new int [] {0, 1, 2, 3, 5})", list.getSelectionIndices(), new int [] {0, 1, 2, 3, 5});
@@ -1790,22 +1790,22 @@ public void test_setSelection$I() {
}
list.setSelection(indices);
assertArrayEquals("MULTI: setSelection(indices)", indices, list.getSelectionIndices());
-
+
list.setSelection(new int [] {number, number});
assertArrayEquals("MULTI: setSelection(new int [] {number, number})", new int[0], list.getSelectionIndices());
-
+
list.setSelection(new int [] {number - 1, number - 1});
assertArrayEquals("MULTI: setSelection(new int [] {number - 1, number - 1})", list.getSelectionIndices(), new int[] {number - 1});
assertEquals("MULTI: setSelection(new int [] {number - 1, number - 1}) getFocusIndex()", list.getFocusIndex(), number - 1);
-
+
list.setSelection(new int [] {0, number, 1});
assertArrayEquals("MULTI: setSelection(new int [] {0, number, 1})", list.getSelectionIndices(), new int[] {0, 1});
-
+
list.setSelection(new int [] {number - 1, 0, number - 2});
assertArrayEquals("MULTI: setSelection(new int [] {number - 1, 0, number - 2})", list.getSelectionIndices(), new int[] {0, number - 2, number - 1});
-
+
list.removeAll();
-
+
list.setSelection(new int [0]);
assertArrayEquals("EMPTY MULTI: setSelection(new int [0])", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY MULTI: setSelection(new int [0]) getFocusIndex()", list.getFocusIndex(), -1);
@@ -1815,7 +1815,7 @@ public void test_setSelection$I() {
fail("No exception thrown for EMPTY MULTI: setSelection((int[]) null)");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new int [] {0});
assertArrayEquals("EMPTY MULTI: setSelection(new int [] {0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY MULTI: setSelection(new int [] {0}) getFocusIndex()", list.getFocusIndex(), -1);
@@ -1827,16 +1827,16 @@ public void test_setSelection$I() {
list.setSelection(new int [] {0, 0});
assertArrayEquals("EMPTY MULTI: setSelection(new int [] {0, 0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY MULTI: setSelection(new int [] {0, 0}) getFocusIndex()", list.getFocusIndex(), -1);
-
+
list.setSelection(new int [] {-1, 0});
assertArrayEquals("EMPTY MULTI: setSelection(new int [] {-1, 0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY MULTI: setSelection(new int [] {-1, 0}) getFocusIndex()", list.getFocusIndex(), -1);
-
+
list.setSelection(new int [] {0, -1});
assertArrayEquals("EMPTY MULTI: setSelection(new int [] {0, -1})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY MULTI: setSelection(new int [] {0, -1}) getFocusIndex()", list.getFocusIndex(), -1);
-
-
+
+
setSingleList();
for (int i = 0; i < number; i++)
list.add("fred" + i);
@@ -1849,14 +1849,14 @@ public void test_setSelection$I() {
fail("No exception thrown for SINGLE: setSelection((int[]) null)");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new int [] {2});
assertArrayEquals("SINGLE: setSelection(new int [] {2})", list.getSelectionIndices(), new int[] {2});
assertEquals("SINGLE: setSelection(new int [] {2}) getFocusIndex()", list.getFocusIndex(), 2);
list.setSelection(new int [] {number});
assertArrayEquals("SINGLE: setSelection(new int [] {number})", list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(new int [] {1, 0});
assertArrayEquals("SINGLE: setSelection(new int [] {1, 0})", list.getSelectionIndices(), new int[] {});
@@ -1865,34 +1865,34 @@ public void test_setSelection$I() {
list.setSelection(new int [] {-1, number});
assertArrayEquals("SINGLE: setSelection(new int [] {-1, number})", list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(new int [] {number - 1, number});
assertArrayEquals("SINGLE: setSelection(new int [] {number - 1, number})", list.getSelectionIndices(), new int[] {});
list.setSelection(new int [] {-1, 0});
assertArrayEquals("SINGLE: setSelection(new int [] {-1, 0})", list.getSelectionIndices(), new int[] {});
-
+
indices = new int [number];
for (int i = 0; i < number; i++) {
indices[i] = i;
}
list.setSelection(indices);
assertArrayEquals("SINGLE: setSelection(indices)", list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(new int [] {number, number});
assertArrayEquals("SINGLE: setSelection(new int [] {number, number})", list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(new int [] {number - 1, number - 1});
assertArrayEquals("SINGLE: setSelection(new int [] {number - 1, number - 1})", list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(new int [] {0, number, 1});
assertArrayEquals("SINGLE: setSelection(new int [] {0, number, 1})", list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(new int [] {number - 1, 0, number - 2});
assertArrayEquals("SINGLE: setSelection(new int [] {number - 1, 0, number - 2})", list.getSelectionIndices(), new int[] {});
-
+
list.removeAll();
-
+
list.setSelection(new int [0]);
assertArrayEquals("EMPTY SINGLE: setSelection(new int [0])", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY SINGLE: setSelection(new int [0]) getFocusIndex()", list.getFocusIndex(), -1);
@@ -1902,7 +1902,7 @@ public void test_setSelection$I() {
fail("No exception thrown for EMPTY SINGLE: setSelection((int[]) null)");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new int [] {0});
assertArrayEquals("EMPTY SINGLE: setSelection(new int [] {0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY SINGLE: setSelection(new int [] {0}) getFocusIndex()", list.getFocusIndex(), -1);
@@ -1914,11 +1914,11 @@ public void test_setSelection$I() {
list.setSelection(new int [] {0, 0});
assertArrayEquals("EMPTY SINGLE: setSelection(new int [] {0, 0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY SINGLE: setSelection(new int [] {0, 0}) getFocusIndex()", list.getFocusIndex(), -1);
-
+
list.setSelection(new int [] {-1, 0});
assertArrayEquals("EMPTY SINGLE: setSelection(new int [] {-1, 0})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY SINGLE: setSelection(new int [] {-1, 0}) getFocusIndex()", list.getFocusIndex(), -1);
-
+
list.setSelection(new int [] {0, -1});
assertArrayEquals("EMPTY SINGLE: setSelection(new int [] {0, -1})", list.getSelectionIndices(), new int[0]);
assertEquals("EMPTY SINGLE: setSelection(new int [] {0, -1}) getFocusIndex()", list.getFocusIndex(), -1);
@@ -1941,44 +1941,44 @@ public void test_setSelection$Ljava_lang_String() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new String [] {"fred 2"});
assertArrayEquals(list.getSelection(), new String [] {"fred 2"});
assertEquals(list.getFocusIndex(), 2);
list.setSelection(new String [] {"fred " + number});
assertArrayEquals(list.getSelection(), new String [0]);
-
+
list.setSelection(new String [] {"fred 1", "fred 0"});
assertArrayEquals(list.getSelection(), new String [] {"fred 0", "fred 1"});
list.setSelection(new String [] {"fred -1", "fred " + number});
assertArrayEquals(list.getSelection(), new String [0]);
-
+
list.setSelection(new String [] {"fred " + (number - 1), "fred " + number});
assertArrayEquals(list.getSelection(), new String [] {"fred " + (number - 1)});
list.setSelection(new String [] {"fred -1", "fred 0"});
assertArrayEquals(list.getSelection(), new String [] {"fred 0"});
-
+
String[] items = new String [number];
for (int i = 0; i < number; i++) {
items[i] = "fred " + i;
}
list.setSelection(items);
assertArrayEquals(list.getSelection(), items);
-
+
list.setSelection(new String [] {"fred " + number, "fred " + number});
assertArrayEquals(list.getSelection(), new String [0]);
-
+
list.setSelection(new String [] {"fred " + (number - 1), "fred " + (number - 1)});
assertArrayEquals(list.getSelection(), new String[] {"fred " + (number - 1)});
-
+
list.setSelection(new String [] {"fred 0", "fred " + number, "fred 1"});
assertArrayEquals(list.getSelection(), new String[] {"fred 0", "fred 1"});
-
+
list.removeAll();
-
+
list.setSelection(new String [0]);
assertArrayEquals(list.getSelection(), new String[0]);
assertEquals(list.getFocusIndex(), -1);
@@ -1988,7 +1988,7 @@ public void test_setSelection$Ljava_lang_String() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new String [] {"fred 0"});
assertArrayEquals(list.getSelection(), new String[0]);
assertEquals(list.getFocusIndex(), -1);
@@ -1997,7 +1997,7 @@ public void test_setSelection$Ljava_lang_String() {
assertArrayEquals(list.getSelection(), new String[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
setSingleList();
for (int i = 0; i < number; i++)
list.add("fred " + i);
@@ -2010,20 +2010,20 @@ public void test_setSelection$Ljava_lang_String() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new String [] {"fred 2"});
assertArrayEquals(list.getSelection(), new String[] {"fred 2"});
assertEquals(list.getFocusIndex(), 2);
list.setSelection(new String [] {"fred " + number});
assertArrayEquals(list.getSelection(), new String[0]);
-
+
list.setSelection(new String [] {"fred 1", "fred 0"});
assertArrayEquals(list.getSelection(), new String[] {});
list.setSelection(new String [] {"fred -1", "fred " + number});
assertArrayEquals(list.getSelection(), new String[0]);
-
+
list.setSelection(new String [] {"fred " + (number - 1)});
assertArrayEquals(list.getSelection(), new String[] {"fred " + (number - 1)});
@@ -2033,18 +2033,18 @@ public void test_setSelection$Ljava_lang_String() {
}
list.setSelection(items);
assertArrayEquals(list.getSelection(), new String[] {});
-
+
list.setSelection(new String [] {"fred " + number, "fred " + number});
assertArrayEquals(list.getSelection(), new String[0]);
-
+
list.setSelection(new String [] {"fred " + (number - 1), "fred " + (number - 1)});
assertArrayEquals(list.getSelection(), new String[] {});
-
+
list.setSelection(new String [] {"fred 0", "fred " + number, "fred 1"});
assertArrayEquals(list.getSelection(), new String[] {});
-
+
list.removeAll();
-
+
list.setSelection(new String [0]);
assertArrayEquals(list.getSelection(), new String[0]);
assertEquals(list.getFocusIndex(), -1);
@@ -2054,7 +2054,7 @@ public void test_setSelection$Ljava_lang_String() {
fail("No exception thrown");
} catch (IllegalArgumentException e) {
}
-
+
list.setSelection(new String [] {"fred 0"});
assertArrayEquals(list.getSelection(), new String[0]);
assertEquals(list.getFocusIndex(), -1);
@@ -2074,37 +2074,37 @@ public void test_setSelectionI() {
list.setSelection(2);
assertArrayEquals(list.getSelectionIndices(), new int[] {2});
assertEquals(list.getFocusIndex(), 2);
-
+
list.setSelection(-5);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(0);
assertArrayEquals(list.getSelectionIndices(), new int[] {0});
assertEquals(list.getFocusIndex(), 0);
-
+
list.setSelection(number);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
-
+
list.setSelection(-1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.removeAll();
-
+
list.setSelection(-2);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(0);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(-1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
setSingleList();
for (int i = 0; i < number; i++) {
@@ -2114,34 +2114,34 @@ public void test_setSelectionI() {
list.setSelection(2);
assertArrayEquals(list.getSelectionIndices(), new int[] {2});
assertEquals(list.getFocusIndex(), 2);
-
+
list.setSelection(-5);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(0);
assertArrayEquals(list.getSelectionIndices(), new int[] {0});
assertEquals(list.getFocusIndex(), 0);
-
+
list.setSelection(number);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
assertEquals(list.getFocusIndex(), number - 1);
-
+
list.setSelection(-1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.removeAll();
-
+
list.setSelection(0);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(-1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(-2);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
@@ -2155,42 +2155,42 @@ public void test_setSelectionII() {
items[i] = "fred" + i;
list.setItems(items);
-
+
list.setSelection(1, 2);
assertArrayEquals(list.getSelectionIndices(), new int[] {1, 2});
-
+
list.setSelection(-3, -2);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(0, 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {0, 1});
-
+
list.setSelection(-2, -1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(number - 2, number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 2, number - 1});
-
+
list.setSelection(number - 1, number);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
-
+
list.setSelection(-1, 0);
assertArrayEquals(list.getSelectionIndices(), new int[] {0});
-
+
list.setSelection(number, number + 1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(0, 0);
assertArrayEquals(list.getSelectionIndices(), new int[] {0});
assertEquals(list.getFocusIndex(), 0);
-
+
list.setSelection(2, 1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
-
+
list.setSelection(number - 1, number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
assertEquals(list.getFocusIndex(), number - 1);
-
+
list.setSelection(-1, -1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
@@ -2199,74 +2199,74 @@ public void test_setSelectionII() {
list.setSelection(-2, -1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(-1, 0);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(0, 1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(1, 0);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
list.setSelection(0, -1);
assertArrayEquals(list.getSelectionIndices(), new int[0]);
assertEquals(list.getFocusIndex(), -1);
-
+
setSingleList();
list.setItems(items);
-
+
list.setSelection(0, 0);
assertArrayEquals(list.getSelectionIndices(), new int[] {0});
assertEquals(list.getFocusIndex(), 0);
-
+
list.setSelection(1, 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {1});
assertEquals(list.getFocusIndex(), 1);
-
+
list.setSelection(4, 4);
assertArrayEquals(list.getSelectionIndices(), new int[] {4});
assertEquals(list.getFocusIndex(), 4);
-
+
list.setSelection(number - 1, number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
assertEquals(list.getFocusIndex(), number - 1);
-
+
list.setSelection(number, number);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(-3, -2);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(0, 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(-2, -1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(number - 2, number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(number - 1, number);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(-1, 0);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(number, number + 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(2, 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
-
+
list.setSelection(number - 1, number - 1);
assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1});
assertEquals(list.getFocusIndex(), number - 1);
-
+
list.setSelection(-1, -1);
assertArrayEquals(list.getSelectionIndices(), new int[] {});
}
@@ -2289,7 +2289,7 @@ public void test_setTopIndexI() {
assertEquals("MULTI: setTopIndex(i=" + i + ")", i, list.getTopIndex());
}
-
+
setSingleList();
list.setTopIndex(3);
assertEquals("SINGLE: setTopIndex(3) in empty list", 0, list.getTopIndex());
@@ -2309,7 +2309,7 @@ public void test_showSelection() {
list.setSelection(items);
list.showSelection();
-
+
setSingleList();
list.setItems(items);
@@ -2327,7 +2327,7 @@ protected void deselectII_helper(
int start,
int end,
int[] expectedIndices) {
-
+
list.setItems(items);
list.setSelection(items);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java
index 0c7a196f13..7527a14f12 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java
@@ -37,7 +37,7 @@ public void setUp() {
/**
* Possible exceptions:
- *
+ *
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
@@ -86,7 +86,7 @@ public void test_setMessageLjava_lang_String(){
try {
messageBox.setMessage(null);
fail("No exception thrown");
- }
+ }
catch (IllegalArgumentException e) {
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
index 2b16767e3e..d0d14d09f5 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
@@ -101,7 +101,7 @@ ProgressBar progressBar;
private void report(String call, int set, int minExpected, int maxExpected, int selectionExpected) {
// Uncomment these lines and comment out call to check() if you want the test to report all errors without
// stopping.
-
+
//if (progressBar.getMinimum() != minExpected)
//System.out.println(call + "(" + set + "): Minimum Expected: " + minExpected + " Actual: " + progressBar.getMinimum());
//if (progressBar.getMaximum() != maxExpected)
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
index 918b667aef..930bcd2154 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
@@ -106,7 +106,7 @@ Scale scale;
private void report(String call, int set, int minExpected, int maxExpected, int selectionExpected) {
//Uncomment these lines and comment out call to check() if you want the test to report all errors without
//stopping.
-
+
//if (trackBar.getMinimum() != minExpected)
//System.out.println(call + "(" + set + "): Minimum Expected: " + minExpected + " Actual: " + trackBar.getMinimum());
//if (trackBar.getMaximum() != maxExpected)
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java
index a744299b39..7bf6db3a49 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java
@@ -100,7 +100,7 @@ public void test_isEnabled() {
@Test
public void test_isVisible() {
scrollBar.setVisible(true);
- assertTrue(scrollBar.isVisible());
+ assertTrue(scrollBar.isVisible());
scrollBar.setVisible(false);
assertTrue(!scrollBar.isVisible());
}
@@ -121,7 +121,7 @@ public void test_setIncrementI() {
{
scrollBar.setIncrement(cases[i]);
assertEquals(cases[i], scrollBar.getIncrement());
- }
+ }
scrollBar.setIncrement(25);
scrollBar.setIncrement(0); // setting to 0 fails silently
@@ -161,7 +161,7 @@ public void test_setPageIncrementI(){
{
scrollBar.setPageIncrement(cases[i]);
assertEquals(scrollBar.getPageIncrement(), cases[i]);
- }
+ }
scrollBar.setPageIncrement(25);
scrollBar.setPageIncrement(0); // setting to 0 fails silently
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java
index 0128020b33..40ac08c816 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java
@@ -20,7 +20,7 @@ import org.junit.Test;
* @see org.eclipse.swt.widgets.Scrollable
*/
public class Test_org_eclipse_swt_widgets_Scrollable extends Test_org_eclipse_swt_widgets_Control {
-
+
@Override
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
index 21cf2296f0..3ad3c19aab 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
@@ -102,7 +102,7 @@ public void test_getIncrement() {
{
slider.setIncrement(cases[i]);
assertTrue("case: " + String.valueOf(i), slider.getIncrement()==cases[i]);
- }
+ }
}
@Test
@@ -140,14 +140,14 @@ public void test_getPageIncrement() {
{
slider.setPageIncrement(cases[i]);
assertTrue("case: " + String.valueOf(i), slider.getPageIncrement()==cases[i]);
- }
+ }
}
@Test
public void test_getSelection() {
slider.setSelection(10);
assertTrue(":a:", slider.getSelection()== 10);
-
+
}
@Override
@@ -529,7 +529,7 @@ return new int[][] {
{97, 97, 100, 97, 3},
{98, 98, 100, 98, 2},
{99, 99, 100, 99, 1},
-{100, 10, 100, 50, 10},
+{100, 10, 100, 50, 10},
{101, 10, 100, 50, 10},
{102, 10, 100, 50, 10},
{103, 10, 100, 50, 10},
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
index f39b61f22d..c38692ac8b 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
@@ -133,12 +133,12 @@ public void test_getItems() {
TabItem[] items = new TabItem[number];
assertEquals(0, tabFolder.getItems().length);
-
+
for (int i = 0; i<number ; i++){
items[i] = new TabItem(tabFolder, 0);
}
assertArrayEquals(items, tabFolder.getItems());
-
+
tabFolder.getItems()[0].dispose();
assertArrayEquals(new TabItem[]{items[1], items[2], items[3], items[4]}, tabFolder.getItems());
@@ -192,15 +192,15 @@ public void test_getSelectionIndex() {
TabItem[] items = new TabItem[number];
for (int i = 0; i < number; i++)
items[i] = new TabItem(tabFolder, 0);
-
+
assertTrue(":a:", tabFolder.getSelectionIndex()==0);
tabFolder.setSelection(new TabItem[]{items[2], items[number-1], items[10]});
assertTrue(":b:", tabFolder.getSelectionIndex()==2);
-
+
tabFolder.setSelection(items);
assertTrue(":c:", tabFolder.getSelectionIndex()==0);
-
+
tabFolder.setSelection(items[2]);
assertTrue(":d:", tabFolder.getSelectionIndex()==2);
}
@@ -218,7 +218,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_TabItem() {
//
makeCleanEnvironment();
-
+
for (int i = 0; i<number ; i++){
tis[i] = new TabItem(tabFolder, 0);
}
@@ -232,7 +232,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_TabItem() {
}
//
- makeCleanEnvironment();
+ makeCleanEnvironment();
number = 20;
TabItem[] items = new TabItem[number];
@@ -256,7 +256,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_TabItem() {
//
TabFolder tabFolder2 = new TabFolder(shell, SWT.NULL);
TabItem tabItem = new TabItem(tabFolder2, SWT.NULL);
-
+
assertTrue(":a:", tabFolder.indexOf(tabItem) == -1);
}
@@ -277,10 +277,10 @@ public void test_setSelectionEmpty() {
tabFolder.setSelection(i);
assertEquals(i, tabFolder.getSelectionIndex());
}
-
+
makeCleanEnvironment();
tabFolder.setSelection(-1);
- assertEquals(0, tabFolder.getSelection().length);
+ assertEquals(0, tabFolder.getSelection().length);
}
@Test
@@ -296,7 +296,7 @@ public void test_setSelectionI() {
//
makeCleanEnvironment();
-
+
for (int i = 0; i<number ; i++){
new TabItem(tabFolder, 0);
assertEquals("i=" + i, 0, tabFolder.getSelectionIndex());
@@ -304,7 +304,7 @@ public void test_setSelectionI() {
//
makeCleanEnvironment();
-
+
number = 5;
TabItem[] items = new TabItem[number];
for (int i = 0; i < number; i++)
@@ -318,7 +318,7 @@ public void test_setSelectionI() {
finally {
assertArrayEquals(new TabItem[]{items[0]}, tabFolder.getSelection());
}
-
+
try {
tabFolder.setSelection((TabItem[]) null);
fail("No exception thrown for selection == null");
@@ -331,7 +331,7 @@ public void test_setSelectionI() {
//
makeCleanEnvironment();
-
+
items = new TabItem[number];
for (int i = 0; i < number; i++)
items[i] = new TabItem(tabFolder, 0);
@@ -343,55 +343,55 @@ public void test_setSelectionI() {
assertArrayEquals(new TabItem[]{items[4]}, tabFolder.getSelection());
tabFolder.setSelection(2);
- assertArrayEquals(new TabItem[]{items[2]}, tabFolder.getSelection());
+ assertArrayEquals(new TabItem[]{items[2]}, tabFolder.getSelection());
tabFolder.setSelection(1);
assertArrayEquals(new TabItem[]{items[1]}, tabFolder.getSelection());
tabFolder.setSelection(number + 1);
- assertArrayEquals(new TabItem[]{items[1]}, tabFolder.getSelection());
+ assertArrayEquals(new TabItem[]{items[1]}, tabFolder.getSelection());
// tabFolder.setSelection(-1);
-// assertEquals(0, tabFolder.getSelection().length);
-
+// assertEquals(0, tabFolder.getSelection().length);
+
tabFolder.setSelection(3);
assertArrayEquals(new TabItem[]{items[3]}, tabFolder.getSelection());
// tabFolder.setSelection(-2);
-// assertEquals(0, tabFolder.getSelection().length);
+// assertEquals(0, tabFolder.getSelection().length);
//
makeCleanEnvironment();
-
+
for (int i = 0; i < number; i++)
items[i] = new TabItem(tabFolder, 0);
tabFolder.setSelection(items[0]);
assertArrayEquals(new TabItem[]{items[0]}, tabFolder.getSelection());
-
+
tabFolder.setSelection(new TabItem[] {items[0]});
assertArrayEquals(new TabItem[] {items[0]}, tabFolder.getSelection());
tabFolder.setSelection(new TabItem[] {items[3]});
- assertArrayEquals(new TabItem[] {items[3]}, tabFolder.getSelection());
+ assertArrayEquals(new TabItem[] {items[3]}, tabFolder.getSelection());
tabFolder.setSelection(new TabItem[] {items[4]});
assertArrayEquals(new TabItem[] {items[4]}, tabFolder.getSelection());
tabFolder.setSelection(new TabItem[] {items[2]});
- assertArrayEquals(new TabItem[] {items[2]}, tabFolder.getSelection());
+ assertArrayEquals(new TabItem[] {items[2]}, tabFolder.getSelection());
tabFolder.setSelection(new TabItem[] {items[1]});
- assertArrayEquals(new TabItem[] {items[1]}, tabFolder.getSelection());
+ assertArrayEquals(new TabItem[] {items[1]}, tabFolder.getSelection());
//
makeCleanEnvironment();
-
+
for (int i = 0; i < number; i++)
items[i] = new TabItem(tabFolder, 0);
try {
tabFolder.setSelection( new TabItem[]{items[0], null});
- tabFolder.setSelection( new TabItem[]{null});
+ tabFolder.setSelection( new TabItem[]{null});
fail("No exception thrown for selection == null");
}
catch (IllegalArgumentException e) {
@@ -421,7 +421,7 @@ private void createTabFolder(List<String> events) {
item.setControl(itemText);
hookExpectedEvents(item, getTestName(), events);
}
-
+
// tabFolder.setSelection(new TabItem[] {tabFolder.getItem(0)});
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java
index 8d2f2bc73e..4f8708a143 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java
@@ -51,23 +51,23 @@ public void test_ConstructorLorg_eclipse_swt_widgets_TabFolderI() {
@Test
public void test_ConstructorLorg_eclipse_swt_widgets_TabFolderII() {
TabItem tItem = new TabItem(tabFolder, SWT.NULL, 0);
-
+
assertTrue(":a:", tabFolder.getItems()[0] == tItem);
-
- tItem = new TabItem(tabFolder, SWT.NULL, 1);
+
+ tItem = new TabItem(tabFolder, SWT.NULL, 1);
assertTrue(":b:", tabFolder.getItems()[1] == tItem);
-
- tItem = new TabItem(tabFolder, SWT.NULL, 1);
+
+ tItem = new TabItem(tabFolder, SWT.NULL, 1);
assertTrue(":c:", tabFolder.getItems()[1] == tItem);
try {
- new TabItem(tabFolder, SWT.NULL, -1);
+ new TabItem(tabFolder, SWT.NULL, -1);
fail("No exception thrown");
}
catch (IllegalArgumentException e) {
}
finally {
- assertTrue(":d:", tabFolder.getItems()[1] == tItem);
+ assertTrue(":d:", tabFolder.getItems()[1] == tItem);
}
try {
new TabItem(tabFolder, SWT.NULL, tabFolder.getItemCount() + 1);
@@ -95,7 +95,7 @@ public void test_getParent() {
public void test_setControlLorg_eclipse_swt_widgets_Control() {
Control control = new Table(tabFolder, SWT.NULL);
- assertTrue(":a: ", tabItem.getControl() == null);
+ assertTrue(":a: ", tabItem.getControl() == null);
tabItem.setControl(control);
assertTrue(":b: ", tabItem.getControl() == control);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
index 838f635947..ecc84cac8f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
@@ -31,12 +31,12 @@ import org.junit.Test;
*/
public class Test_org_eclipse_swt_widgets_TableColumn extends Test_org_eclipse_swt_widgets_Item {
-@Override
+@Override
@Before
public void setUp() {
super.setUp();
- table = new Table(shell, SWT.SINGLE);
- tableColumn = new TableColumn(table, SWT.NULL);
+ table = new Table(shell, SWT.SINGLE);
+ tableColumn = new TableColumn(table, SWT.NULL);
setWidget(tableColumn);
}
@@ -77,7 +77,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_TableII() {
@Test
public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() {
try {
- tableColumn.addSelectionListener(null);
+ tableColumn.addSelectionListener(null);
fail("No exception thrown for selectionListener == null");
}
catch (IllegalArgumentException e) {
@@ -87,7 +87,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
@Test
public void test_getWidth() {
int testWidth = 42;
-
+
// try {
// tableColumn.setWidth(-1);
// assertTrue("No exception thrown", false);
@@ -115,11 +115,11 @@ public void test_removeSelectionListenerLorg_eclipse_swt_events_SelectionListene
@Override
public void widgetSelected(SelectionEvent e) {}};
- tableColumn.removeSelectionListener(listener);
- tableColumn.addSelectionListener(listener);
- tableColumn.removeSelectionListener(listener);
+ tableColumn.removeSelectionListener(listener);
+ tableColumn.addSelectionListener(listener);
+ tableColumn.removeSelectionListener(listener);
try {
- tableColumn.removeSelectionListener(null);
+ tableColumn.removeSelectionListener(null);
fail("No exception thrown for selectionListener == null");
}
catch (IllegalArgumentException e) {
@@ -129,7 +129,7 @@ public void test_removeSelectionListenerLorg_eclipse_swt_events_SelectionListene
@Test
public void test_setAlignmentI() {
TableColumn column2;
-
+
assertTrue(":a:", tableColumn.getAlignment() == SWT.LEFT);
tableColumn.setAlignment(-1);
@@ -137,18 +137,18 @@ public void test_setAlignmentI() {
tableColumn.setAlignment(SWT.RIGHT);
assertTrue(
- ":c: Should not be allowed to set alignment of the first column",
+ ":c: Should not be allowed to set alignment of the first column",
tableColumn.getAlignment() == SWT.LEFT);
column2 = new TableColumn(table, SWT.NULL);
column2.setAlignment(SWT.RIGHT);
assertTrue(":d:", column2.getAlignment() == SWT.RIGHT);
-
+
column2.setAlignment(SWT.CENTER);
- assertTrue(":e:", column2.getAlignment() == SWT.CENTER);
+ assertTrue(":e:", column2.getAlignment() == SWT.CENTER);
column2.setAlignment(SWT.LEFT);
- assertTrue(":f:", column2.getAlignment() == SWT.LEFT);
+ assertTrue(":f:", column2.getAlignment() == SWT.LEFT);
}
@Override
@@ -168,7 +168,7 @@ public void test_setMoveableZ() {
tableColumn.setMoveable(false);
assertTrue(":d:", tableColumn.getMoveable() == false);
-
+
TableColumn tableColumn2 = new TableColumn(tableColumn.getParent(), SWT.NONE);
tableColumn2.dispose();
try {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
index 9cff810e6e..b6eb4872f6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
@@ -49,12 +49,12 @@ public void test_ConstructorLorg_eclipse_swt_widgets_TableI() {
}
catch (IllegalArgumentException e) {
}
-
+
for (int i=0; i<10; i++) {
- new TableItem(table, SWT.NONE);
+ new TableItem(table, SWT.NONE);
}
assertEquals(11, table.getItemCount());
- new TableItem(table, SWT.NONE, 5);
+ new TableItem(table, SWT.NONE, 5);
assertEquals(12, table.getItemCount());
}
@@ -80,15 +80,15 @@ public void test_getBoundsI() {
Image image = images[0];
Rectangle bounds;
Rectangle bounds2;
-
+
// no columns
bounds = tableItem.getBounds(0);
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
bounds = tableItem.getBounds(-1);
- assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = tableItem.getBounds(1);
assertTrue(":1c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
-
+
tableItem.setText("hello");
bounds = tableItem.getBounds(0);
assertTrue(":1d:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0);
@@ -96,10 +96,10 @@ public void test_getBoundsI() {
bounds2 = tableItem.getBounds(0);
assertTrue(":1e:", bounds2.x > 0 && bounds2.height > 0);
//assertTrue(":1f:", bounds2.width < bounds.width); // TODO doesn't shrink?
-
+
//
makeCleanEnvironment();
-
+
tableItem.setImage(image);
bounds = tableItem.getBounds(0);
assertTrue(":1g:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0);
@@ -107,28 +107,28 @@ public void test_getBoundsI() {
bounds2 = tableItem.getBounds(0);
assertTrue(":1h:", bounds2.x > 0 && bounds2.height > 0);
// assertTrue(":1i:", bounds2.width > bounds.width); // TODO once an image is added the space for it is always there
-
+
//
makeCleanEnvironment();
-
+
tableItem.setText("hello");
bounds = tableItem.getBounds(0);
tableItem.setImage(image);
bounds2 = tableItem.getBounds(0);
assertTrue(":1j:", bounds2.x > 0 && bounds2.height > 0);
assertTrue(":1k:", bounds2.width > bounds.width);
-
+
// no columns and CHECK style
Table table2 = new Table(shell, SWT.CHECK);
TableItem tableItem2 = new TableItem(table2, SWT.NONE);
-
+
bounds = tableItem2.getBounds(0);
assertTrue(":2a:", bounds.x > 0 && bounds.height > 0);
bounds = tableItem2.getBounds(-1);
- assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = tableItem2.getBounds(1);
assertTrue(":2c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
-
+
tableItem2.setText("hello");
bounds = tableItem2.getBounds(0);
assertTrue(":2d:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0);
@@ -136,11 +136,11 @@ public void test_getBoundsI() {
bounds2 = tableItem2.getBounds(0);
assertTrue(":2e:", bounds2.x > 0 && bounds2.height > 0);
//assertTrue(":2f:", bounds2.width < bounds.width); // TODO doesn't shrink?
-
+
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
tableItem2 = new TableItem(table2, SWT.NONE);
-
+
tableItem2.setImage(image);
bounds = tableItem2.getBounds(0);
assertTrue(":2g:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0);
@@ -148,47 +148,47 @@ public void test_getBoundsI() {
bounds2 = tableItem2.getBounds(0);
assertTrue(":2h:", bounds2.x > 0 && bounds2.height > 0);
//assertTrue(":2i:", bounds2.width < bounds.width); // TODO once an image is added the space for it is always there
-
+
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
tableItem2 = new TableItem(table2, SWT.NONE);
-
+
tableItem2.setText("hello");
bounds = tableItem2.getBounds(0);
tableItem2.setImage(image);
bounds2 = tableItem2.getBounds(0);
assertTrue(":2j:", bounds2.x > 0 && bounds2.height > 0);
assertTrue(":2k:", bounds2.width > bounds.width);
-
+
//
makeCleanEnvironment();
// with columns
-
+
TableColumn column0 = new TableColumn(table, SWT.LEFT);
TableColumn column1 = new TableColumn(table, SWT.CENTER);
-
+
bounds = tableItem.getBounds(0);
assertTrue(":3a:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0);
bounds = tableItem.getBounds(1);
assertTrue(":3b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = tableItem.getBounds(-1);
- assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = tableItem.getBounds(2);
assertTrue(":3d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
-
+
column0.setWidth(100);
bounds = tableItem.getBounds(0);
assertTrue(":3e:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3f:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 0);
-
+
column1.setWidth(200);
bounds = tableItem.getBounds(0);
assertTrue(":3g:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3h:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
tableItem.setText(new String[] {"hello", "world"});
bounds = tableItem.getBounds(0);
assertTrue(":3i:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
@@ -199,14 +199,14 @@ public void test_getBoundsI() {
assertTrue(":3k:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3l:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
makeCleanEnvironment();
column0 = new TableColumn(table, SWT.LEFT);
column1 = new TableColumn(table, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
tableItem.setImage(new Image[] {image, image});
bounds = tableItem.getBounds(0);
assertTrue(":3m:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
@@ -217,57 +217,57 @@ public void test_getBoundsI() {
assertTrue(":3o:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3p:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
makeCleanEnvironment();
column0 = new TableColumn(table, SWT.LEFT);
column1 = new TableColumn(table, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
tableItem.setText(new String[] {"hello", "world"});
tableItem.setImage(new Image[] {null, null});
bounds = tableItem.getBounds(0);
assertTrue(":3q:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3r:", bounds.x > 0 && bounds.height > 0 && bounds.width == 200);
-
+
//
makeCleanEnvironment();
-
+
tableItem.setText("hello");
new TableColumn(table, SWT.RIGHT);
bounds = tableItem.getBounds(0);
assertTrue(":3s:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0);
-
+
// with columns and CHECK style
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
tableItem2 = new TableItem(table2, SWT.NONE);
column0 = new TableColumn(table2, SWT.LEFT);
column1 = new TableColumn(table2, SWT.CENTER);
-
+
bounds = tableItem2.getBounds(0);
assertTrue(":4a:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0);
bounds = tableItem2.getBounds(1);
assertTrue(":4b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = tableItem2.getBounds(-1);
- assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = tableItem2.getBounds(2);
assertTrue(":4d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
-
+
column0.setWidth(100);
bounds = tableItem2.getBounds(0);
assertTrue(":4e:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4f:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 0);
-
+
column1.setWidth(200);
bounds = tableItem2.getBounds(0);
assertTrue(":4g:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4h:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
tableItem2.setText(new String[] {"hello", "world"});
bounds = tableItem2.getBounds(0);
assertTrue(":4i:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
@@ -278,7 +278,7 @@ public void test_getBoundsI() {
assertTrue(":4k:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4l:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
@@ -287,7 +287,7 @@ public void test_getBoundsI() {
column1 = new TableColumn(table2, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
tableItem2.setImage(new Image[] {image, image});
bounds = tableItem2.getBounds(0);
assertTrue(":4m:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
@@ -298,7 +298,7 @@ public void test_getBoundsI() {
assertTrue(":4o:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4p:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
@@ -307,19 +307,19 @@ public void test_getBoundsI() {
column1 = new TableColumn(table2, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
tableItem2.setText(new String[] {"hello", "world"});
tableItem2.setImage(new Image[] {null, null});
bounds = tableItem2.getBounds(0);
assertTrue(":4q:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4r:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
tableItem2 = new TableItem(table2, SWT.NONE);
-
+
tableItem2.setText("hello");
new TableColumn(table2, SWT.RIGHT);
bounds = tableItem2.getBounds(0);
@@ -334,39 +334,39 @@ public void test_getImageBoundsI() {
Rectangle bounds;
Table table2 = new Table(shell, SWT.CHECK);
TableItem tableItem2 = new TableItem(table2, SWT.NULL);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), tableItem.getImageBounds(-1));
-
+
bounds = tableItem.getImageBounds(0);
assertTrue(":b:", bounds.width == 0);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), tableItem.getImageBounds(1));
-
+
assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(-1));
-
+
bounds = tableItem2.getImageBounds(0);
assertTrue(":e:", bounds.width == 0);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
//
makeCleanEnvironment();
-
- Image image = images[0];
+
+ Image image = images[0];
// int imageWidth = image.getBounds().width;
// int imageHeight;
-
+
tableItem.setImage(0, image);
// imageHeight = table.getItemHeight() - table.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), tableItem.getImageBounds(-1));
-
+
bounds = tableItem.getImageBounds(0);
-// assertTrue(":b:", bounds.x > 0 && bounds.width == imageWidth && bounds.height == imageHeight);
-// assertEquals(new Rectangle(0, 0, 0, 0), tableItem.getImageBounds(1));
+// assertTrue(":b:", bounds.x > 0 && bounds.width == imageWidth && bounds.height == imageHeight);
+// assertEquals(new Rectangle(0, 0, 0, 0), tableItem.getImageBounds(1));
//
- makeCleanEnvironment();
-
+ makeCleanEnvironment();
+
table2.dispose();
table2 = new Table(shell, SWT.CHECK);
tableItem2.dispose();
@@ -375,10 +375,10 @@ public void test_getImageBoundsI() {
// imageWidth = imageBounds.width; tableItem2.setImage(0, image);
// imageHeight = table2.getItemHeight() - table2.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(-1));
-
+
bounds = tableItem2.getImageBounds(0); // bounds.width should be check box width if they are wider than image
// assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight);
-// assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
+// assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
//
@@ -409,25 +409,25 @@ public void test_setBackgroundILorg_eclipse_swt_graphics_Color() {
Display display = tableItem.getDisplay();
Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);
-
+
// no columns
assertEquals(table.getBackground(), tableItem.getBackground(0));
assertEquals(tableItem.getBackground(), tableItem.getBackground(0));
tableItem.setBackground(0, red);
assertEquals(red, tableItem.getBackground(0));
-
+
// index beyond range - no error
tableItem.setBackground(10, red);
assertEquals(tableItem.getBackground(), tableItem.getBackground(10));
-
+
// with columns
new TableColumn(table, SWT.LEFT);
new TableColumn(table, SWT.LEFT);
-
+
// index beyond range - no error
tableItem.setBackground(10, red);
assertEquals(tableItem.getBackground(), tableItem.getBackground(10));
-
+
tableItem.setBackground(0, red);
assertEquals(red, tableItem.getBackground(0));
tableItem.setBackground(0, null);
@@ -436,18 +436,18 @@ public void test_setBackgroundILorg_eclipse_swt_graphics_Color() {
tableItem.setBackground(0, blue);
tableItem.setBackground(red);
assertEquals(blue, tableItem.getBackground(0));
-
+
tableItem.setBackground(0, null);
assertEquals(red, tableItem.getBackground(0));
-
+
tableItem.setBackground(null);
assertEquals(table.getBackground(),tableItem.getBackground(0));
-
- try {
+
+ try {
Color color = new Color(display, 255, 0, 0);
color.dispose();
tableItem.setBackground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -460,9 +460,9 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
tableItem.setBackground(null);
assertEquals(table.getBackground(),tableItem.getBackground());
color.dispose();
- try {
+ try {
tableItem.setBackground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -470,14 +470,14 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
@Test
public void test_setCheckedZ() {
assertEquals(false, tableItem.getChecked());
-
+
tableItem.setChecked(true);
assertEquals(false, tableItem.getChecked());
Table t = new Table(shell, SWT.CHECK);
TableItem ti = new TableItem(t, SWT.NULL);
ti.setChecked(true);
assertTrue(ti.getChecked());
-
+
ti.setChecked(false);
assertEquals(false, ti.getChecked());
t.dispose();
@@ -489,14 +489,14 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
Font font = tableItem.getFont();
tableItem.setFont(font);
assertTrue(font.equals(tableItem.getFont()));
-
+
font = new Font(display, SwtTestUtil.testFontName, 10, SWT.NORMAL);
tableItem.setFont(font);
assertTrue(font.equals( tableItem.getFont()));
tableItem.setFont(null);
assertTrue(table.getFont().equals(tableItem.getFont()));
-
+
font.dispose();
try {
tableItem.setFont(font);
@@ -510,45 +510,45 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
public void test_setFontILorg_eclipse_swt_graphics_Font() {
Display display = tableItem.getDisplay();
Font font = new Font(display, SwtTestUtil.testFontName, 10, SWT.NORMAL);
-
+
// no columns
assertTrue(table.getFont().equals(tableItem.getFont(0)));
assertTrue(tableItem.getFont().equals(tableItem.getFont(0)));
tableItem.setFont(0, font);
assertTrue(font.equals(tableItem.getFont(0)));
-
+
// index beyond range - no error
tableItem.setFont(10, font);
assertTrue(tableItem.getFont().equals(tableItem.getFont(10)));
-
+
// with columns
new TableColumn(table, SWT.LEFT);
new TableColumn(table, SWT.LEFT);
-
+
// index beyond range - no error
tableItem.setFont(10, font);
assertTrue(tableItem.getFont().equals(tableItem.getFont(10)));
-
+
tableItem.setFont(0, font);
assertTrue(font.equals(tableItem.getFont(0)));
tableItem.setFont(0, null);
assertTrue(table.getFont().equals(tableItem.getFont(0)));
-
+
Font font2 = new Font(display, SwtTestUtil.testFontName, 20, SWT.NORMAL);
-
+
tableItem.setFont(0, font);
tableItem.setFont(font2);
assertTrue(font.equals(tableItem.getFont(0)));
-
+
tableItem.setFont(0, null);
assertTrue(font2.equals(tableItem.getFont(0)));
-
+
tableItem.setFont(null);
assertTrue(table.getFont().equals(tableItem.getFont(0)));
-
+
font.dispose();
font2.dispose();
-
+
try {
tableItem.setFont(0, font);
tableItem.setFont(0, null);
@@ -562,25 +562,25 @@ public void test_setForegroundILorg_eclipse_swt_graphics_Color() {
Display display = tableItem.getDisplay();
Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);
-
+
// no columns
assertEquals(table.getForeground(), tableItem.getForeground(0));
assertEquals(tableItem.getForeground(), tableItem.getForeground(0));
tableItem.setForeground(0, red);
assertEquals(red, tableItem.getForeground(0));
-
+
// index beyond range - no error
tableItem.setForeground(10, red);
assertEquals(tableItem.getForeground(), tableItem.getForeground(10));
-
+
// with columns
new TableColumn(table, SWT.LEFT);
new TableColumn(table, SWT.LEFT);
-
+
// index beyond range - no error
tableItem.setForeground(10, red);
assertEquals(tableItem.getForeground(), tableItem.getForeground(10));
-
+
tableItem.setForeground(0, red);
assertEquals(red, tableItem.getForeground(0));
tableItem.setForeground(0, null);
@@ -589,18 +589,18 @@ public void test_setForegroundILorg_eclipse_swt_graphics_Color() {
tableItem.setForeground(0, blue);
tableItem.setForeground(red);
assertEquals(blue, tableItem.getForeground(0));
-
+
tableItem.setForeground(0, null);
assertEquals(red, tableItem.getForeground(0));
-
+
tableItem.setForeground(null);
assertEquals(table.getForeground(),tableItem.getForeground(0));
-
- try {
+
+ try {
Color color = new Color(display, 255, 0, 0);
color.dispose();
tableItem.setForeground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -613,7 +613,7 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() {
tableItem.setForeground(null);
assertEquals(table.getForeground(),tableItem.getForeground());
color.dispose();
- try {
+ try {
tableItem.setForeground(color);
fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
@@ -634,17 +634,17 @@ public void test_setGrayedZ() {
@Test
public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
- assertNull(tableItem.getImage(1));
- tableItem.setImage(-1, null);
- assertNull(tableItem.getImage(-1));
-
+ assertNull(tableItem.getImage(1));
+ tableItem.setImage(-1, null);
+ assertNull(tableItem.getImage(-1));
+
tableItem.setImage(0, images[0]);
- assertEquals(images[0], tableItem.getImage(0));
+ assertEquals(images[0], tableItem.getImage(0));
String texts[] = new String[images.length];
for (int i = 0; i < texts.length; i++) {
texts[i] = String.valueOf(i);
}
-
+
//table.setText(texts); // create enough columns for TableItem.setImage(Image[]) to work
int columnCount = table.getColumnCount();
if (columnCount < texts.length) {
@@ -657,7 +657,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
columns[i].setText(texts[i]);
}
tableItem.setImage(1, images[1]);
- assertEquals(images[1], tableItem.getImage(1));
+ assertEquals(images[1], tableItem.getImage(1));
tableItem.setImage(images);
for (int i = 0; i < images.length; i++) {
assertEquals(images[i], tableItem.getImage(i));
@@ -676,32 +676,32 @@ public void test_setImageILorg_eclipse_swt_graphics_Image() {
assertEquals(null, tableItem.getImage(0));
tableItem.setImage(0, images[0]);
assertEquals(images[0], tableItem.getImage(0));
-
+
// index beyond range - no error
tableItem.setImage(10, images[0]);
assertEquals(null, tableItem.getImage(10));
-
+
// with columns
new TableColumn(table, SWT.LEFT);
new TableColumn(table, SWT.LEFT);
-
+
// index beyond range - no error
tableItem.setImage(10, images[0]);
assertEquals(null, tableItem.getImage(10));
-
+
tableItem.setImage(0, images[0]);
assertEquals(images[0], tableItem.getImage(0));
tableItem.setImage(0, null);
assertEquals(null, tableItem.getImage(0));
-
+
tableItem.setImage(0, images[0]);
tableItem.setImage(images[1]);
assertEquals(images[1], tableItem.getImage(0));
-
+
tableItem.setImage(images[1]);
tableItem.setImage(0, images[0]);
assertEquals(images[0], tableItem.getImage(0));
-
+
images[0].dispose();
try {
tableItem.setImage(0, images[0]);
@@ -717,7 +717,7 @@ public void test_setImageIndentI() {
if (SwtTestUtil.isCocoa || SwtTestUtil.isGTK) {
//setImageIndent not implemented on Carbon
tableItem.setImageIndent(1);
- return;
+ return;
}
assertEquals(0, tableItem.getImageIndent());
tableItem.setImageIndent(1);
@@ -730,33 +730,33 @@ public void test_setImageIndentI() {
public void test_setText$Ljava_lang_String() {
final String TestString = "test";
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
-
+
try {
tableItem.setText((String []) null);
fail("No exception thrown for strings == null");
}
catch (IllegalArgumentException e) {
}
-
+
/*
- * Test the getText/setText API with a Table that has only
+ * Test the getText/setText API with a Table that has only
* the default column.
*/
-
+
assertEquals(0, tableItem.getText(1).length());
-
+
tableItem.setText(TestStrings);
assertEquals(TestStrings[0], tableItem.getText(0));
for (int i = 1; i < TestStrings.length; i++) {
assertEquals(0, tableItem.getText(i).length());
}
-
-
+
+
/*
- * Test the getText/setText API with a Table that enough
+ * Test the getText/setText API with a Table that enough
* columns to fit all test item texts.
*/
-
+
int columnCount = table.getColumnCount();
if (columnCount < images.length) {
for (int i = columnCount; i < images.length; i++){
@@ -777,27 +777,27 @@ public void test_setTextILjava_lang_String(){
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
/*
- * Test the getText/setText API with a Table that has only
+ * Test the getText/setText API with a Table that has only
* the default column.
*/
-
- assertEquals(0, tableItem.getText(1).length());
+
+ assertEquals(0, tableItem.getText(1).length());
tableItem.setText(1, TestString);
- assertEquals(0, tableItem.getText(1).length());
+ assertEquals(0, tableItem.getText(1).length());
assertEquals(0, tableItem.getText(0).length());
-
+
tableItem.setText(0, TestString);
assertEquals(TestString, tableItem.getText(0));
tableItem.setText(-1, TestStrings[1]);
- assertEquals(0, tableItem.getText(-1).length());
+ assertEquals(0, tableItem.getText(-1).length());
/*
- * Test the getText/setText API with a Table that enough
+ * Test the getText/setText API with a Table that enough
* columns to fit all test item texts.
*/
makeCleanEnvironment();
-
+
//table.setText(TestStrings); // create anough columns for TableItem.setText(String[]) to work
int columnCount = table.getColumnCount();
if (columnCount < images.length) {
@@ -809,34 +809,34 @@ public void test_setTextILjava_lang_String(){
for (int i = 0; i < TestStrings.length; i++) {
columns[i].setText(TestStrings[i]);
}
- assertEquals(0, tableItem.getText(1).length());
+ assertEquals(0, tableItem.getText(1).length());
tableItem.setText(1, TestString);
- assertEquals(TestString, tableItem.getText(1));
+ assertEquals(TestString, tableItem.getText(1));
assertEquals(0, tableItem.getText(0).length());
-
+
tableItem.setText(0, TestString);
assertEquals(TestString, tableItem.getText(0));
tableItem.setText(-1, TestStrings[1]);
- assertEquals(0, tableItem.getText(-1).length());
+ assertEquals(0, tableItem.getText(-1).length());
try {
- tableItem.setText(-1, null);
+ tableItem.setText(-1, null);
fail("No exception thrown for string == null");
}
catch (IllegalArgumentException e) {
}
-
+
try {
- tableItem.setText(0, null);
+ tableItem.setText(0, null);
fail("No exception thrown for string == null");
}
catch (IllegalArgumentException e) {
- }
+ }
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
index 061e8e0365..f207bea013 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
@@ -101,7 +101,7 @@ public void test_getItems() {
items[i] = new ToolItem(toolBar, 0);
}
assertArrayEquals(items, toolBar.getItems());
-
+
toolBar.getItems()[0].dispose();
assertArrayEquals(new ToolItem[]{items[1], items[2], items[3], items[4]}, toolBar.getItems());
@@ -156,7 +156,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_ToolItem() {
}
for (int i = 0; i<number ; i++){
try {
- toolBar.indexOf(null);
+ toolBar.indexOf(null);
fail("No exception thrown for toolItem == null");
}
catch (IllegalArgumentException e) {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java
index 0ef1e0d739..d58a2adfd8 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java
@@ -32,7 +32,7 @@ public class Test_org_eclipse_swt_widgets_ToolItem extends Test_org_eclipse_swt_
public void setUp() {
super.setUp();
toolBar = new ToolBar(shell, 0);
- toolItem = new ToolItem(toolBar, 0);
+ toolItem = new ToolItem(toolBar, 0);
setWidget(toolItem);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java
index f22a5996de..deee55688f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java
@@ -19,7 +19,7 @@ import org.junit.Before;
* @see org.eclipse.swt.widgets.Tracker
*/
public class Test_org_eclipse_swt_widgets_Tracker extends Test_org_eclipse_swt_widgets_Widget {
-
+
@Override
@Before
public void setUp() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
index a0c006ceb4..363448c623 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
@@ -34,8 +34,8 @@ public class Test_org_eclipse_swt_widgets_TreeColumn extends Test_org_eclipse_sw
@Before
public void setUp() {
super.setUp();
- tree = new Tree(shell, SWT.SINGLE);
- treeColumn = new TreeColumn(tree, SWT.NULL);
+ tree = new Tree(shell, SWT.SINGLE);
+ treeColumn = new TreeColumn(tree, SWT.NULL);
setWidget(treeColumn);
}
@@ -76,7 +76,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_TreeII() {
@Test
public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() {
try {
- treeColumn.addSelectionListener(null);
+ treeColumn.addSelectionListener(null);
fail("No exception thrown for selectionListener == null");
}
catch (IllegalArgumentException e) {
@@ -86,7 +86,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
@Test
public void test_getWidth() {
int testWidth = 42;
-
+
// try {
// treeColumn.setWidth(-1);
// assertTrue("No exception thrown", false);
@@ -114,11 +114,11 @@ public void test_removeSelectionListenerLorg_eclipse_swt_events_SelectionListene
@Override
public void widgetSelected(SelectionEvent e) {}};
- treeColumn.removeSelectionListener(listener);
- treeColumn.addSelectionListener(listener);
- treeColumn.removeSelectionListener(listener);
+ treeColumn.removeSelectionListener(listener);
+ treeColumn.addSelectionListener(listener);
+ treeColumn.removeSelectionListener(listener);
try {
- treeColumn.removeSelectionListener(null);
+ treeColumn.removeSelectionListener(null);
fail("No exception thrown for selectionListener == null");
}
catch (IllegalArgumentException e) {
@@ -128,7 +128,7 @@ public void test_removeSelectionListenerLorg_eclipse_swt_events_SelectionListene
@Test
public void test_setAlignmentI() {
TreeColumn column2;
-
+
assertTrue(":a:", treeColumn.getAlignment() == SWT.LEFT);
treeColumn.setAlignment(-1);
@@ -136,18 +136,18 @@ public void test_setAlignmentI() {
treeColumn.setAlignment(SWT.RIGHT);
assertTrue(
- ":c: Should not be allowed to set alignment of the first column",
+ ":c: Should not be allowed to set alignment of the first column",
treeColumn.getAlignment() == SWT.LEFT);
column2 = new TreeColumn(tree, SWT.NULL);
column2.setAlignment(SWT.RIGHT);
assertTrue(":d:", column2.getAlignment() == SWT.RIGHT);
-
+
column2.setAlignment(SWT.CENTER);
- assertTrue(":e:", column2.getAlignment() == SWT.CENTER);
+ assertTrue(":e:", column2.getAlignment() == SWT.CENTER);
column2.setAlignment(SWT.LEFT);
- assertTrue(":f:", column2.getAlignment() == SWT.LEFT);
+ assertTrue(":f:", column2.getAlignment() == SWT.LEFT);
}
@Override
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
index b08eaa93ee..39df376e68 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
@@ -54,10 +54,10 @@ public void test_ConstructorLorg_eclipse_swt_widgets_TreeI() {
}
for (int i=0; i<10; i++) {
- new TreeItem(tree, SWT.NONE);
+ new TreeItem(tree, SWT.NONE);
}
assertEquals(11, tree.getItemCount());
- new TreeItem(tree, SWT.NONE, 5);
+ new TreeItem(tree, SWT.NONE, 5);
assertEquals(12, tree.getItemCount());
}
@@ -104,31 +104,31 @@ public void test_getBounds() {
Rectangle bounds;
Rectangle bounds2;
String string = "hello";
-
+
// no columns
bounds = treeItem.getBounds();
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
-
+
treeItem.setText(string);
GC gc = new GC(tree);
Point extent = gc.stringExtent(string);
gc.dispose();
bounds = treeItem.getBounds();
assertTrue(":1b:", bounds.x > 0 && bounds.height > extent.y && bounds.width > extent.x);
-
+
//
makeCleanEnvironment();
-
+
Rectangle rect = image.getBounds();
treeItem.setImage(image);
bounds = treeItem.getBounds();
assertTrue(":1c:", bounds.x > 0 && bounds.height >= rect.height);
bounds2 = treeItem.getImageBounds(0);
assertTrue(":1d:", bounds.x >= bounds2.x + bounds2.width);
-
+
//
makeCleanEnvironment();
-
+
TreeItem subItem = new TreeItem(treeItem, SWT.NONE);
bounds = subItem.getBounds();
assertTrue(":1e:", bounds.equals(new Rectangle(0, 0, 0, 0)));
@@ -139,13 +139,13 @@ public void test_getBounds() {
treeItem.setExpanded(false);
bounds = subItem.getBounds();
assertTrue(":1g:", bounds.equals(new Rectangle(0, 0, 0, 0)));
-
+
treeItem.setExpanded(true);
subItem.setText(string);
bounds = subItem.getBounds();
bounds2 = treeItem.getBounds();
assertTrue(":1h:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > extent.y && bounds.width > extent.x);
-
+
//
makeCleanEnvironment();
subItem = new TreeItem(treeItem, SWT.NONE);
@@ -155,12 +155,12 @@ public void test_getBounds() {
assertTrue(":1i:", bounds.x > 0 && bounds.height >= rect.height);
bounds2 = subItem.getImageBounds(0);
assertTrue(":1j:", bounds.x >= bounds2.x + bounds2.width);
-
+
// TODO no columns and CHECK style
// TODO with columns
// TODO with columns and CHECK style
}
-void getBoundsIA() {
+void getBoundsIA() {
// no columns - plain style
Image image = images[0];
Rectangle imageBounds = image.getBounds();
@@ -168,17 +168,17 @@ void getBoundsIA() {
GC gc = new GC(tree);
Point stringExtent = gc.stringExtent(string);
gc.dispose();
-
+
Rectangle bounds;
Rectangle bounds2;
-
+
//
makeCleanEnvironment();
-
+
bounds = treeItem.getBounds(0);
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
bounds = treeItem.getBounds(-1);
- assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = treeItem.getBounds(1);
assertTrue(":1c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
@@ -195,8 +195,8 @@ void getBoundsIA() {
subItem.setText(string);
bounds = subItem.getBounds(0);
bounds2 = treeItem.getBounds(0);
- assertTrue(":1g:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent.y && bounds.width > stringExtent.x);
-
+ assertTrue(":1g:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent.y && bounds.width > stringExtent.x);
+
treeItem.setText(string);
bounds = treeItem.getBounds(0);
assertTrue(":1h:", bounds.x > 0 && bounds.height > stringExtent.y && bounds.width > stringExtent.x);
@@ -206,10 +206,10 @@ void getBoundsIA() {
bounds2 = treeItem.getBounds(0);
assertTrue(":1i:", bounds2.x > 0 && bounds2.height > 0);
assertTrue(":1j:", bounds2.width < bounds.width);
-
+
//
makeCleanEnvironment();
-
+
treeItem.setImage(image);
bounds = treeItem.getBounds(0);
assertTrue(":1k:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width >= imageBounds.width);
@@ -217,10 +217,10 @@ void getBoundsIA() {
bounds2 = treeItem.getBounds(0);
assertTrue(":1l:", bounds2.x > 0 && bounds2.height > 0);
// assertTrue(":1m:", bounds2.width > bounds.width); // once an image is added the space for it is always there
-
+
//
makeCleanEnvironment();
-
+
treeItem.setText(string);
bounds = treeItem.getBounds(0);
treeItem.setImage(image);
@@ -237,17 +237,17 @@ void getBoundsIB() {
GC gc = new GC(tree);
Point stringExtent = gc.stringExtent(string);
gc.dispose();
-
+
Rectangle bounds;
Rectangle bounds2;
-
+
Tree tree2 = new Tree(shell, SWT.CHECK);
TreeItem treeItem2 = new TreeItem(tree2, SWT.NONE);
-
+
bounds = treeItem2.getBounds(0);
assertTrue(":2a:", bounds.x > 0 && bounds.height > 0);
bounds = treeItem2.getBounds(-1);
- assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = treeItem2.getBounds(1);
assertTrue(":2c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
@@ -264,7 +264,7 @@ void getBoundsIB() {
subItem2.setText(string);
bounds = subItem2.getBounds(0);
bounds2 = treeItem2.getBounds(0);
- assertTrue(":2g:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent.y && bounds.width > stringExtent.x);
+ assertTrue(":2g:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent.y && bounds.width > stringExtent.x);
treeItem2.setText(string);
bounds = treeItem2.getBounds(0);
@@ -275,11 +275,11 @@ void getBoundsIB() {
bounds2 = treeItem2.getBounds(0);
assertTrue(":2i:", bounds2.x > 0 && bounds2.height > 0);
assertTrue(":2j:", bounds2.width < bounds.width);
-
+
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
treeItem2 = new TreeItem(tree2, SWT.NONE);
-
+
treeItem2.setImage(image);
bounds = treeItem2.getBounds(0);
assertTrue(":2k:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width >= imageBounds.width);
@@ -287,11 +287,11 @@ void getBoundsIB() {
bounds2 = treeItem2.getBounds(0);
assertTrue(":2l:", bounds2.x > 0 && bounds2.height > 0);
//assertTrue(":2m:", bounds2.width < bounds.width); // once an image is added the space for it is always there
-
+
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
treeItem2 = new TreeItem(tree2, SWT.NONE);
-
+
treeItem2.setText(string);
bounds = treeItem2.getBounds(0);
treeItem2.setImage(image);
@@ -302,7 +302,7 @@ void getBoundsIB() {
}
void getBoundsIC() {
// with columns
-
+
Image image = images[0];
Rectangle imageBounds = image.getBounds();
String string1 = "hello";
@@ -311,22 +311,22 @@ void getBoundsIC() {
Point stringExtent1 = gc.stringExtent(string1);
//Point stringExtent2 = gc.stringExtent(string2);
gc.dispose();
-
+
Rectangle bounds;
Rectangle bounds2;
-
+
//
makeCleanEnvironment();
TreeColumn column0 = new TreeColumn(tree, SWT.LEFT);
TreeColumn column1 = new TreeColumn(tree, SWT.CENTER);
-
+
bounds = treeItem.getBounds(0);
assertTrue(":3a:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0);
bounds = treeItem.getBounds(1);
assertTrue(":3b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = treeItem.getBounds(-1);
- assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = treeItem.getBounds(2);
assertTrue(":3d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
@@ -343,7 +343,7 @@ void getBoundsIC() {
subItem.setText(new String[] {string1, string2});
bounds = subItem.getBounds(0);
bounds2 = treeItem.getBounds(0);
- assertTrue(":3h:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width == 0);
+ assertTrue(":3h:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width == 0);
column0.setWidth(100);
bounds = treeItem.getBounds(0);
@@ -352,14 +352,14 @@ void getBoundsIC() {
assertTrue(":3j:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 0);
bounds = subItem.getBounds(0);
bounds2 = treeItem.getBounds(0);
- assertTrue(":3k:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
+ assertTrue(":3k:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
column1.setWidth(200);
bounds = treeItem.getBounds(0);
assertTrue(":3l:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
assertTrue(":3m:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
treeItem.setText(new String[] {string1, string2});
bounds = treeItem.getBounds(0);
assertTrue(":3n:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
@@ -370,14 +370,14 @@ void getBoundsIC() {
assertTrue(":3p:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
assertTrue(":3q:", bounds.x >= 100 && bounds.height > stringExtent1.y && bounds.width == 200);
-
+
//
makeCleanEnvironment();
column0 = new TreeColumn(tree, SWT.LEFT);
column1 = new TreeColumn(tree, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
treeItem.setImage(new Image[] {image, image});
bounds = treeItem.getBounds(0);
assertTrue(":3r:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
@@ -388,24 +388,24 @@ void getBoundsIC() {
assertTrue(":3t:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
assertTrue(":3u:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
makeCleanEnvironment();
column0 = new TreeColumn(tree, SWT.LEFT);
column1 = new TreeColumn(tree, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
treeItem.setText(new String[] {string1, string2});
treeItem.setImage(new Image[] {image, image});
bounds = treeItem.getBounds(0);
assertTrue(":3v:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
assertTrue(":3w:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.height >= imageBounds.height && bounds.width == 200);
-
+
//
makeCleanEnvironment();
-
+
treeItem.setText(string1);
new TreeColumn(tree, SWT.RIGHT);
bounds = treeItem.getBounds(0);
@@ -422,21 +422,21 @@ void getBoundsID() {
Point stringExtent1 = gc.stringExtent(string1);
//Point stringExtent2 = gc.stringExtent(string2);
gc.dispose();
-
+
Rectangle bounds;
Rectangle bounds2;
-
+
Tree tree2 = new Tree(shell, SWT.CHECK);
TreeItem treeItem2 = new TreeItem(tree2, SWT.NONE);
TreeColumn column0 = new TreeColumn(tree2, SWT.LEFT);
TreeColumn column1 = new TreeColumn(tree2, SWT.CENTER);
-
+
bounds = treeItem2.getBounds(0);
assertTrue(":4a:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0);
bounds = treeItem2.getBounds(1);
assertTrue(":4b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = treeItem2.getBounds(-1);
- assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
+ assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
bounds = treeItem2.getBounds(2);
assertTrue(":4d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
@@ -453,8 +453,8 @@ void getBoundsID() {
subItem2.setText(new String[] {string1, string2});
bounds = subItem2.getBounds(0);
bounds2 = treeItem2.getBounds(0);
- assertTrue(":4h:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width == 0);
-
+ assertTrue(":4h:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width == 0);
+
column0.setWidth(100);
bounds = treeItem2.getBounds(0);
assertTrue(":4i:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
@@ -462,15 +462,15 @@ void getBoundsID() {
assertTrue(":4j:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 0);
bounds = subItem2.getBounds(0);
bounds2 = treeItem2.getBounds(0);
- assertTrue(":4k:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
+ assertTrue(":4k:", bounds.x > bounds2.x && bounds.y >= bounds2.y + bounds2.height && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
+
-
column1.setWidth(200);
bounds = treeItem2.getBounds(0);
assertTrue(":4l:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
assertTrue(":4m:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
treeItem2.setText(new String[] {string1, string2});
bounds = treeItem2.getBounds(0);
assertTrue(":4n:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
@@ -481,7 +481,7 @@ void getBoundsID() {
assertTrue(":4p:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
assertTrue(":4q:", bounds.x >= 100 && bounds.height > stringExtent1.y && bounds.width == 200);
-
+
//
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
@@ -490,7 +490,7 @@ void getBoundsID() {
column1 = new TreeColumn(tree2, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
treeItem2.setImage(new Image[] {image, image});
bounds = treeItem2.getBounds(0);
assertTrue(":4r:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
@@ -501,7 +501,7 @@ void getBoundsID() {
assertTrue(":4t:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
assertTrue(":4u:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
-
+
//
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
@@ -510,19 +510,19 @@ void getBoundsID() {
column1 = new TreeColumn(tree2, SWT.CENTER);
column0.setWidth(100);
column1.setWidth(200);
-
+
treeItem2.setText(new String[] {string1, string2});
treeItem2.setImage(new Image[] {image, image});
bounds = treeItem2.getBounds(0);
assertTrue(":4v:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
assertTrue(":4w:", bounds.x >= 100 && bounds.height > stringExtent1.y && bounds.height >= imageBounds.height && bounds.width == 200);
-
+
//
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
treeItem2 = new TreeItem(tree2, SWT.NONE);
-
+
treeItem2.setText(string1);
new TreeColumn(tree2, SWT.RIGHT);
bounds = treeItem2.getBounds(0);
@@ -563,41 +563,41 @@ public void test_getImageBoundsI() {
Rectangle bounds;
Tree tree2 = new Tree(shell, SWT.CHECK);
TreeItem treeItem2 = new TreeItem(tree2, SWT.NULL);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(-1));
-
+
// TODO - should this width be 0 or a value?
bounds = treeItem.getImageBounds(0);
assertTrue(":b:", bounds.width == 0);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(1));
-
+
assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1));
-
+
// TODO - should this width be 0 or a value?
//bounds = treeItem2.getImageBounds(0);
//assertTrue(":e:", bounds.width == 0);
-
+
assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
//
makeCleanEnvironment();
-
- Image image = images[0];
+
+ Image image = images[0];
// int imageWidth = image.getBounds().width;
// int imageHeight;
-
+
treeItem.setImage(0, image);
// imageHeight = tree.getItemHeight() - tree.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(-1));
-
+
bounds = treeItem.getImageBounds(0);
-// assertTrue(":b:", bounds.x > 0 && bounds.width == imageWidth && bounds.height == imageHeight);
-// assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(1));
+// assertTrue(":b:", bounds.x > 0 && bounds.width == imageWidth && bounds.height == imageHeight);
+// assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(1));
//
- makeCleanEnvironment();
-
+ makeCleanEnvironment();
+
tree2.dispose();
tree2 = new Tree(shell, SWT.CHECK);
treeItem2.dispose();
@@ -606,10 +606,10 @@ public void test_getImageBoundsI() {
// imageWidth = imageBounds.width; treeItem2.setImage(0, image);
// imageHeight = tree2.getItemHeight() - tree2.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1));
-
+
bounds = treeItem2.getImageBounds(0); // bounds.width should be check box width if they are wider than image
// assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight);
-// assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
+// assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
//
@@ -645,14 +645,14 @@ public void test_getItemI() {
}
catch (IllegalArgumentException e) {
}
-
+
try {
treeItem.getItem(number+1);
fail("No exception thrown for illegal index argument");
}
catch (IllegalArgumentException e) {
}
-
+
try {
treeItem.getItem(-1);
fail("No exception thrown for illegal index argument");
@@ -706,25 +706,25 @@ public void test_setBackgroundILorg_eclipse_swt_graphics_Color() {
Display display = treeItem.getDisplay();
Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);
-
+
// no columns
assertEquals(tree.getBackground(), treeItem.getBackground(0));
assertEquals(treeItem.getBackground(), treeItem.getBackground(0));
treeItem.setBackground(0, red);
assertEquals(red, treeItem.getBackground(0));
-
+
// index beyond range - no error
treeItem.setBackground(10, red);
assertEquals(treeItem.getBackground(), treeItem.getBackground(10));
-
+
// with columns
new TreeColumn(tree, SWT.LEFT);
new TreeColumn(tree, SWT.LEFT);
-
+
// index beyond range - no error
treeItem.setBackground(10, red);
assertEquals(treeItem.getBackground(), treeItem.getBackground(10));
-
+
treeItem.setBackground(0, red);
assertEquals(red, treeItem.getBackground(0));
treeItem.setBackground(0, null);
@@ -733,18 +733,18 @@ public void test_setBackgroundILorg_eclipse_swt_graphics_Color() {
treeItem.setBackground(0, blue);
treeItem.setBackground(red);
assertEquals(blue, treeItem.getBackground(0));
-
+
treeItem.setBackground(0, null);
assertEquals(red, treeItem.getBackground(0));
-
+
treeItem.setBackground(null);
assertEquals(tree.getBackground(),treeItem.getBackground(0));
-
- try {
+
+ try {
Color color = new Color(display, 255, 0, 0);
color.dispose();
treeItem.setBackground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -757,9 +757,9 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
treeItem.setBackground(null);
assertEquals(tree.getBackground(),treeItem.getBackground());
color.dispose();
- try {
+ try {
treeItem.setBackground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -767,7 +767,7 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
@Test
public void test_setCheckedZ() {
assertEquals(false, treeItem.getChecked());
-
+
treeItem.setChecked(true);
assertEquals(false, treeItem.getChecked());
@@ -775,7 +775,7 @@ public void test_setCheckedZ() {
TreeItem ti = new TreeItem(t, SWT.NULL);
ti.setChecked(true);
assertTrue(ti.getChecked());
-
+
ti.setChecked(false);
assertEquals(false, ti.getChecked());
t.dispose();
@@ -784,7 +784,7 @@ public void test_setCheckedZ() {
@Test
public void test_setExpandedZ() {
assertEquals(false, treeItem.getExpanded());
-
+
// there must be at least one subitem before you can set the treeitem expanded
treeItem.setExpanded(true);
assertEquals(false, treeItem.getExpanded());
@@ -795,7 +795,7 @@ public void test_setExpandedZ() {
assertTrue(treeItem.getExpanded());
treeItem.setExpanded(false);
assertEquals(false, treeItem.getExpanded());
-
+
TreeItem ti = new TreeItem(treeItem, SWT.NULL);
ti.setExpanded(true);
treeItem.setExpanded(false);
@@ -807,14 +807,14 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
Font font = treeItem.getFont();
treeItem.setFont(font);
assertTrue(font.equals(treeItem.getFont()));
-
+
font = new Font(treeItem.getDisplay(), SwtTestUtil.testFontName, 10, SWT.NORMAL);
treeItem.setFont(font);
assertTrue(font.equals(treeItem.getFont()));
treeItem.setFont(null);
assertTrue(tree.getFont().equals( treeItem.getFont()));
-
+
font.dispose();
try {
treeItem.setFont(font);
@@ -828,45 +828,45 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
public void test_setFontILorg_eclipse_swt_graphics_Font() {
Display display = treeItem.getDisplay();
Font font = new Font(display, SwtTestUtil.testFontName, 10, SWT.NORMAL);
-
+
// no columns
assertTrue(tree.getFont().equals( treeItem.getFont(0)));
assertTrue(treeItem.getFont().equals(treeItem.getFont(0)));
treeItem.setFont(0, font);
assertTrue(font.equals(treeItem.getFont(0)));
-
+
// index beyond range - no error
treeItem.setFont(10, font);
assertTrue(treeItem.getFont().equals(treeItem.getFont(10)));
-
+
// with columns
new TreeColumn(tree, SWT.LEFT);
new TreeColumn(tree, SWT.LEFT);
-
+
// index beyond range - no error
treeItem.setFont(10, font);
assertTrue(treeItem.getFont().equals(treeItem.getFont(10)));
-
+
treeItem.setFont(0, font);
assertTrue(font.equals(treeItem.getFont(0)));
treeItem.setFont(0, null);
assertTrue(tree.getFont().equals(treeItem.getFont(0)));
-
+
Font font2 = new Font(display, SwtTestUtil.testFontName, 20, SWT.NORMAL);
-
+
treeItem.setFont(0, font);
treeItem.setFont(font2);
assertTrue(font.equals(treeItem.getFont(0)));
-
+
treeItem.setFont(0, null);
assertTrue(font2.equals(treeItem.getFont(0)));
-
+
treeItem.setFont(null);
assertTrue(tree.getFont().equals(treeItem.getFont(0)));
-
+
font.dispose();
font2.dispose();
-
+
try {
treeItem.setFont(0, font);
treeItem.setFont(0, null);
@@ -880,25 +880,25 @@ public void test_setForegroundILorg_eclipse_swt_graphics_Color() {
Display display = treeItem.getDisplay();
Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);
-
+
// no columns
assertEquals(tree.getForeground(), treeItem.getForeground(0));
assertEquals(treeItem.getForeground(), treeItem.getForeground(0));
treeItem.setForeground(0, red);
assertEquals(red, treeItem.getForeground(0));
-
+
// index beyond range - no error
treeItem.setForeground(10, red);
assertEquals(treeItem.getForeground(), treeItem.getForeground(10));
-
+
// with columns
new TreeColumn(tree, SWT.LEFT);
new TreeColumn(tree, SWT.LEFT);
-
+
// index beyond range - no error
treeItem.setForeground(10, red);
assertEquals(treeItem.getForeground(), treeItem.getForeground(10));
-
+
treeItem.setForeground(0, red);
assertEquals(red, treeItem.getForeground(0));
treeItem.setForeground(0, null);
@@ -907,18 +907,18 @@ public void test_setForegroundILorg_eclipse_swt_graphics_Color() {
treeItem.setForeground(0, blue);
treeItem.setForeground(red);
assertEquals(blue, treeItem.getForeground(0));
-
+
treeItem.setForeground(0, null);
assertEquals(red, treeItem.getForeground(0));
-
+
treeItem.setForeground(null);
assertEquals(tree.getForeground(),treeItem.getForeground(0));
-
- try {
+
+ try {
Color color = new Color(display, 255, 0, 0);
color.dispose();
treeItem.setForeground(color);
- fail("No exception thrown for color disposed");
+ fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
}
}
@@ -931,7 +931,7 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() {
treeItem.setForeground(null);
assertEquals(tree.getForeground(),treeItem.getForeground());
color.dispose();
- try {
+ try {
treeItem.setForeground(color);
fail("No exception thrown for color disposed");
} catch (IllegalArgumentException e) {
@@ -952,17 +952,17 @@ public void test_setGrayedZ() {
@Test
public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
- assertNull(treeItem.getImage(1));
- treeItem.setImage(-1, null);
- assertNull(treeItem.getImage(-1));
-
+ assertNull(treeItem.getImage(1));
+ treeItem.setImage(-1, null);
+ assertNull(treeItem.getImage(-1));
+
treeItem.setImage(0, images[0]);
- assertEquals(images[0], treeItem.getImage(0));
+ assertEquals(images[0], treeItem.getImage(0));
String texts[] = new String[images.length];
for (int i = 0; i < texts.length; i++) {
texts[i] = String.valueOf(i);
}
-
+
//tree.setText(texts); // create enough columns for TreeItem.setImage(Image[]) to work
int columnCount = tree.getColumnCount();
if (columnCount < texts.length) {
@@ -975,7 +975,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
columns[i].setText(texts[i]);
}
treeItem.setImage(1, images[1]);
- assertEquals(images[1], treeItem.getImage(1));
+ assertEquals(images[1], treeItem.getImage(1));
treeItem.setImage(images);
for (int i = 0; i < images.length; i++) {
assertEquals(images[i], treeItem.getImage(i));
@@ -994,32 +994,32 @@ public void test_setImageILorg_eclipse_swt_graphics_Image() {
assertEquals(null, treeItem.getImage(0));
treeItem.setImage(0, images[0]);
assertEquals(images[0], treeItem.getImage(0));
-
+
// index beyond range - no error
treeItem.setImage(10, images[0]);
assertEquals(null, treeItem.getImage(10));
-
+
// with columns
new TreeColumn(tree, SWT.LEFT);
new TreeColumn(tree, SWT.LEFT);
-
+
// index beyond range - no error
treeItem.setImage(10, images[0]);
assertEquals(null, treeItem.getImage(10));
-
+
treeItem.setImage(0, images[0]);
assertEquals(images[0], treeItem.getImage(0));
treeItem.setImage(0, null);
assertEquals(null, treeItem.getImage(0));
-
+
treeItem.setImage(0, images[0]);
treeItem.setImage(images[1]);
assertEquals(images[1], treeItem.getImage(0));
-
+
treeItem.setImage(images[1]);
treeItem.setImage(0, images[0]);
assertEquals(images[0], treeItem.getImage(0));
-
+
images[0].dispose();
try {
treeItem.setImage(0, images[0]);
@@ -1033,33 +1033,33 @@ public void test_setImageILorg_eclipse_swt_graphics_Image() {
public void test_setText$Ljava_lang_String() {
final String TestString = "test";
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
-
+
try {
treeItem.setText((String []) null);
fail("No exception thrown for strings == null");
}
catch (IllegalArgumentException e) {
}
-
+
/*
- * Test the getText/setText API with a Tree that has only
+ * Test the getText/setText API with a Tree that has only
* the default column.
*/
-
+
assertEquals(0, treeItem.getText(1).length());
-
+
treeItem.setText(TestStrings);
assertEquals(TestStrings[0], treeItem.getText(0));
for (int i = 1; i < TestStrings.length; i++) {
assertEquals(0, treeItem.getText(i).length());
}
-
-
+
+
/*
- * Test the getText/setText API with a Tree that enough
+ * Test the getText/setText API with a Tree that enough
* columns to fit all test item texts.
*/
-
+
int columnCount = tree.getColumnCount();
if (columnCount < images.length) {
for (int i = columnCount; i < images.length; i++){
@@ -1080,27 +1080,27 @@ public void test_setTextILjava_lang_String(){
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
/*
- * Test the getText/setText API with a Tree that has only
+ * Test the getText/setText API with a Tree that has only
* the default column.
*/
-
- assertEquals(0, treeItem.getText(1).length());
+
+ assertEquals(0, treeItem.getText(1).length());
treeItem.setText(1, TestString);
- assertEquals(0, treeItem.getText(1).length());
+ assertEquals(0, treeItem.getText(1).length());
assertEquals(0, treeItem.getText(0).length());
-
+
treeItem.setText(0, TestString);
assertEquals(TestString, treeItem.getText(0));
treeItem.setText(-1, TestStrings[1]);
- assertEquals(0, treeItem.getText(-1).length());
+ assertEquals(0, treeItem.getText(-1).length());
/*
- * Test the getText/setText API with a Tree that enough
+ * Test the getText/setText API with a Tree that enough
* columns to fit all test item texts.
*/
makeCleanEnvironment();
-
+
//tree.setText(TestStrings); // create anough columns for TreeItem.setText(String[]) to work
int columnCount = tree.getColumnCount();
if (columnCount < images.length) {
@@ -1112,34 +1112,34 @@ public void test_setTextILjava_lang_String(){
for (int i = 0; i < TestStrings.length; i++) {
columns[i].setText(TestStrings[i]);
}
- assertEquals(0, treeItem.getText(1).length());
+ assertEquals(0, treeItem.getText(1).length());
treeItem.setText(1, TestString);
- assertEquals(TestString, treeItem.getText(1));
+ assertEquals(TestString, treeItem.getText(1));
assertEquals(0, treeItem.getText(0).length());
-
+
treeItem.setText(0, TestString);
assertEquals(TestString, treeItem.getText(0));
treeItem.setText(-1, TestStrings[1]);
- assertEquals(0, treeItem.getText(-1).length());
+ assertEquals(0, treeItem.getText(-1).length());
try {
- treeItem.setText(-1, null);
+ treeItem.setText(-1, null);
fail("No exception thrown for string == null");
}
catch (IllegalArgumentException e) {
}
-
+
try {
- treeItem.setText(0, null);
+ treeItem.setText(0, null);
fail("No exception thrown for string == null");
}
catch (IllegalArgumentException e) {
- }
+ }
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/SwtPerformanceTestCase.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/SwtPerformanceTestCase.java
index cadcbba466..f3fd4fc378 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/SwtPerformanceTestCase.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/SwtPerformanceTestCase.java
@@ -23,19 +23,19 @@ import org.eclipse.test.performance.PerformanceMeter;
public class SwtPerformanceTestCase extends TestCase {
- // used to specify verbose mode, if true unimplemented warning messages will
+ // used to specify verbose mode, if true unimplemented warning messages will
// be written to System.out
public static boolean verbose = false;
public final static boolean isGTK = SWT.getPlatform().equals("gtk");
public final static boolean isWindows = SWT.getPlatform().startsWith("win32");
-
+
// allow specific image formats to be tested
public static String[] imageFormats = new String[] {"bmp", "jpg", "gif", "png"};
public static String[] imageFilenames = new String[] {"folder", "folderOpen", "target"};
public static String[] transparentImageFilenames = new String[] {"transparent.png"};
-
+
public SwtPerformanceTestCase(String name) {
super(name);
}
@@ -66,7 +66,7 @@ protected void disposeMeter(PerformanceMeter meter) {
protected String getPath(String fileName) {
String urlPath;
-
+
String pluginPath = System.getProperty("PLUGIN_PATH");
if (verbose) {
System.out.println("PLUGIN_PATH <"+pluginPath+">");
@@ -80,11 +80,11 @@ protected String getPath(String fileName) {
} else {
urlPath = pluginPath + "/data/" + fileName;
}
-
- if (File.separatorChar != '/') urlPath = urlPath.replace('/', File.separatorChar);
+
+ if (File.separatorChar != '/') urlPath = urlPath.replace('/', File.separatorChar);
if (isWindows && urlPath.indexOf(File.separatorChar) == 0) urlPath = urlPath.substring(1);
- urlPath = urlPath.replaceAll("%20", " ");
-
+ urlPath = urlPath.replaceAll("%20", " ");
+
if (verbose) {
System.out.println("Resolved file name for " + fileName + " = " + urlPath);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
index e67bc5ddbd..b169c2b7bf 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
@@ -65,7 +65,7 @@ protected void setUp() throws Exception {
/**
* Situations:
- *
+ *
* - Widget creation
* - syncExec/asyncExec performance
* - Image creation
@@ -82,7 +82,7 @@ public void test_createComposites() {
int samples;
Performance.getDefault();
-
+
// Warm up.
for(samples = 0; samples < 2; samples++) {
Shell shell = new Shell(display);
@@ -108,7 +108,7 @@ public void test_createComposites() {
meter.stop();
shell.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
@@ -137,14 +137,14 @@ public void test_createWidgets() {
new Tree(c, SWT.NONE);
new Table(c, SWT.NONE);
new TabFolder(c, SWT.NONE);
- new Group(c, SWT.BORDER);
+ new Group(c, SWT.BORDER);
new Composite(c, SWT.NONE);
}
}
meter.stop();
shell.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
@@ -159,7 +159,7 @@ public void test_layout() {
Label changedLabel;
Composite parent = shell;
GridData data;
-
+
for(int i = 0; i < 10; i++) {
Composite c = new Composite(parent, SWT.BORDER);
data = new GridData();
@@ -167,28 +167,28 @@ public void test_layout() {
data.verticalAlignment = GridData.FILL;
c.setLayoutData(data);
c.setLayout(new GridLayout(2, false));
-
+
Composite c1 = new Composite(c, SWT.BORDER);
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
data.widthHint = data.heightHint = 2;
c1.setLayoutData(data);
-
+
Composite c2 = new Composite(c, SWT.BORDER);
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
data.widthHint = data.heightHint = 2;
c2.setLayoutData(data);
-
+
Composite c3 = new Composite(c, SWT.BORDER);
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
data.widthHint = data.heightHint = 2;
c3.setLayoutData(data);
-
+
Composite c4 = new Composite(c, SWT.BORDER);
data = new GridData();
data.horizontalAlignment = GridData.FILL;
@@ -204,7 +204,7 @@ public void test_layout() {
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
changedLabel.setLayoutData(data);
-
+
shell.open();
while(display.readAndDispatch()){/*empty*/}
try { Thread.sleep(2000); } catch (Exception e) {}
@@ -219,14 +219,14 @@ public void test_layout() {
meter.stop();
shell.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
public void test_imageDrawing() {
PerformanceMeter meter = createMeter("Draw on an image");
int samples;
-
+
for(samples = 0; samples < 10; samples++) {
int width = 640;
int height = 480;
@@ -253,19 +253,19 @@ public void test_imageDrawing() {
color1.dispose();
color2.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
public void test_windowDrawing() {
PerformanceMeter meter = createMeter("Draw on a window");
Performance performance= Performance.getDefault();
- performance.setComment(meter,
- Performance.EXPLAINS_DEGRADATION_COMMENT,
+ performance.setComment(meter,
+ Performance.EXPLAINS_DEGRADATION_COMMENT,
"Regression due to a issue on the Releng test machine");
-
+
int samples;
-
+
for(samples = 0; samples < 10; samples++) {
int width = 640;
int height = 480;
@@ -303,14 +303,14 @@ public void test_windowDrawing() {
color1.dispose();
color2.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
public void test_stringDrawing() {
PerformanceMeter meter = createMeterWithoutSummary("Draw strings using GC.drawText");
int samples;
-
+
for(samples = 0; samples < 10; samples++) {
int width = 640;
int height = 480;
@@ -351,7 +351,7 @@ public void test_stringDrawing() {
font1.dispose();
font2.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}
@@ -398,7 +398,7 @@ public void test_fastStringDrawing() {
font1.dispose();
font2.dispose();
while(display.readAndDispatch()){/*empty*/}
- }
+ }
disposeMeter(meter);
}

Back to the top