Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-09-18 09:18:21 +0000
committerAlexander Kurtakov2018-09-18 09:18:21 +0000
commita298f2e9fe281ada3751fd3c1dc342a94dd5987a (patch)
treeb92467ba8619b8c85cd46809c4f005392beb7c09
parent653f7fea9a0550548b37d31306401252c3915cfe (diff)
downloadeclipse.platform.swt-a298f2e9fe281ada3751fd3c1dc342a94dd5987a.tar.gz
eclipse.platform.swt-a298f2e9fe281ada3751fd3c1dc342a94dd5987a.tar.xz
eclipse.platform.swt-a298f2e9fe281ada3751fd3c1dc342a94dd5987a.zip
Remove Gtk3 check in tests.
SWT now requires Gtk 3.4+ so this check is of no use. Change-Id: I256c5aba82ebd173d1aa737c7af18c0fd38ceedb Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java14
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java8
5 files changed, 11 insertions, 25 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 6f1456914e..5fabf71e22 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
@@ -112,20 +112,6 @@ protected static boolean isReparentablePlatform() {
return false;
}
-/*
- * Checks if the GTK version is 2 or 3.
- * Only works if OS.java has been initialized.
- */
-public static boolean isGTK3 () {
- String gtkVersion = System.getProperty("org.eclipse.swt.internal.gtk.version");
- if (gtkVersion != null) {
- return Integer.parseInt(gtkVersion.substring(0,1)) == 3 ? true : false;
- } else if (isGTK && gtkVersion == null) {
- throw new IllegalStateException ("OS.java has not yet been initialized");
- }
- return false;
-}
-
public static boolean isBidi() {
return true;
}
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 88dd75f22a..54f0e2bb35 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -301,7 +301,7 @@ public void test_setForegroundCheckButton() {
public void test_setForegroundAlphaCheckButton() {
Button checkButton = new Button(shell, SWT.CHECK);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (checkButton.getDisplay(), 255, 0, 0, 0);
checkButton.setForeground(color);
assertEquals(color, checkButton.getForeground());
@@ -339,7 +339,7 @@ public void test_setForegroundRadioButton() {
public void test_setForegroundAlphaRadiokButton() {
Button radioButton = new Button(shell, SWT.RADIO);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (radioButton.getDisplay(), 255, 0, 0, 0);
radioButton.setForeground(color);
assertEquals(color, radioButton.getForeground());
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
index c058a6ca21..e6fe80e3a1 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -874,7 +874,7 @@ public void test_setForegroundDropDownCombo() {
public void test_setForegroundAlphaDropDownCombo() {
Combo dropDown = new Combo(shell, SWT.DROP_DOWN);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (dropDown.getDisplay(), 255, 0, 0, 0);
dropDown.setForeground(color);
assertEquals(color, dropDown.getForeground());
@@ -912,7 +912,7 @@ public void test_setForegroundSimpleCombo() {
public void test_setForegroundAlphaSimpleCombo() {
Combo simple = new Combo(shell, SWT.SIMPLE);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (simple.getDisplay(), 255, 0, 0, 0);
simple.setForeground(color);
assertEquals(color, simple.getForeground());
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
index 25173bd139..1c9064983f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
@@ -745,7 +745,7 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() {
@Test
public void test_setForegroundAlphaLorg_eclipse_swt_graphics_Color() {
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (control.getDisplay(), 255, 0, 0, 0);
control.setForeground(color);
assertEquals(color, control.getForeground());
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 2539c362a6..4abb2586c6 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -439,7 +439,7 @@ public void test_setForegroundCalendarDateTime() {
public void test_setForegroundAlphaCalendarDateTime() {
DateTime calendar = new DateTime(shell, SWT.CALENDAR);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (calendar.getDisplay(), 255, 0, 0, 0);
calendar.setForeground(color);
assertEquals(color, calendar.getForeground());
@@ -477,7 +477,7 @@ public void test_setForegroundTimeDateTime() {
public void test_setForegroundAlphaTimeDateTime() {
DateTime time = new DateTime(shell, SWT.TIME);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (time.getDisplay(), 255, 0, 0, 0);
time.setForeground(color);
assertEquals(color, time.getForeground());
@@ -515,7 +515,7 @@ public void test_setForegroundDateDateTime() {
public void test_setForegroundAlphaDateDateTime() {
DateTime date = new DateTime(shell, SWT.DATE);
assumeTrue("Alpha support for foreground colors does not exist on GTK2 or Win32",
- SwtTestUtil.isCocoa || SwtTestUtil.isGTK3());
+ SwtTestUtil.isCocoa || SwtTestUtil.isGTK);
Color color = new Color (date.getDisplay(), 255, 0, 0, 0);
date.setForeground(color);
assertEquals(color, date.getForeground());

Back to the top