Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRolf Theunissen2018-03-10 20:33:20 +0000
committerAlexander Kurtakov2018-03-23 08:23:52 +0000
commit7ff1827cdc8b28d83309c71b9acc5929c7997319 (patch)
treece7130fca9dcc54659b67b50d3cac94e6a4fa267 /tests
parent58067bc4c245ac2c94c49e9f780677c932382e96 (diff)
downloadeclipse.platform.swt-7ff1827cdc8b28d83309c71b9acc5929c7997319.tar.gz
eclipse.platform.swt-7ff1827cdc8b28d83309c71b9acc5929c7997319.tar.xz
eclipse.platform.swt-7ff1827cdc8b28d83309c71b9acc5929c7997319.zip
Bug 488431 - Provide SWT/GTK3 port on Windows
Test for windows style newlines (os=windows) instead of windows platform (platform=win32) Change-Id: I97d96c4b24c6b7ff9152c715ada973acfeb01075 Signed-off-by: Rolf Theunissen <rolf.theunissen@altran.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java16
2 files changed, 10 insertions, 8 deletions
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 44bfcdebc7..2a3d254f9c 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
@@ -61,9 +61,11 @@ public class SwtTestUtil {
public static String[] reparentablePlatforms = new String[] {"win32", "gtk", "cocoa"};
public static final String testFontName;
+ // isWindows refers to windows platform, i.e. win32 windowing system; see also isWindowsOS
public final static boolean isWindows = SWT.getPlatform().startsWith("win32");
public final static boolean isCocoa = SWT.getPlatform().startsWith("cocoa");
public final static boolean isGTK = SWT.getPlatform().equals("gtk");
+ public final static boolean isWindowsOS = System.getProperty("os.name").startsWith("Windows");
public final static boolean isLinux = System.getProperty("os.name").equals("Linux");
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");
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index 7ed2c0c66c..470204641b 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -753,7 +753,7 @@ public void test_copy() {
text.setSelectionRange(0, text.getCharCount());
text.copy();
clipboardText = (String) clipboard.getContents(transfer);
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "\r\nLine1\r\nLine2\r\nLine3\r\n\r\nLine4\r\n";
}
else {
@@ -766,7 +766,7 @@ public void test_copy() {
text.setSelectionRange(0, text.getCharCount());
text.copy();
clipboardText = (String) clipboard.getContents(transfer);
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "Line1\r\nLine2";
}
else {
@@ -821,7 +821,7 @@ public void test_cut() {
text.setSelectionRange(0, text.getCharCount());
text.cut();
clipboardText = (String) clipboard.getContents(transfer);
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "\r\nLine1\r\nLine2\r\nLine3\r\n\r\nLine4\r\n";
}
else {
@@ -834,7 +834,7 @@ public void test_cut() {
text.setSelectionRange(0, text.getCharCount());
text.cut();
clipboardText = (String) clipboard.getContents(transfer);
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "Line1\r\nLine2";
}
else {
@@ -2349,7 +2349,7 @@ public void test_paste(){
// test line delimiter conversion
clipboard.setContents(new String[]{"\rLine1\nLine2\r\nLine3\n\rLine4\n"}, new Transfer[]{transfer});
text.paste();
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "\r\nLine1\r\nLine2\r\nLine3\r\n\r\nLine4\r\n";
}
else {
@@ -2361,7 +2361,7 @@ public void test_paste(){
// test line delimiter conversion
clipboard.setContents(new String[]{"Line1\r\nLine2"}, new Transfer[]{transfer});
text.paste();
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "Line1\r\nLine2";
}
else {
@@ -2373,7 +2373,7 @@ public void test_paste(){
// test line delimiter conversion
clipboard.setContents(new String[]{"Line1\rLine2"}, new Transfer[]{transfer});
text.paste();
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "Line1\r\nLine2";
}
else {
@@ -2386,7 +2386,7 @@ public void test_paste(){
// test line delimiter conversion
clipboard.setContents(new String[]{"Line1\nLine2"}, new Transfer[]{transfer});
text.paste();
- if (SwtTestUtil.isWindows) {
+ if (SwtTestUtil.isWindowsOS) {
convertedText = "Line1\r\nLine2";
}
else {

Back to the top