Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 485681 - [GTK3] Error in Test_org_eclipse_swt_widgets_Text.test_getTopIndex
Summary: [GTK3] Error in Test_org_eclipse_swt_widgets_Text.test_getTopIndex
Status: CLOSED DUPLICATE of bug 487467
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-12 11:09 EST by Lars Vogel CLA
Modified: 2016-04-21 08:47 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2016-01-12 11:09:13 EST
Test_org_eclipse_swt_widgets_Control#test_setForegroundLorg_eclipse_swt_graphics_Color
Test_org_eclipse_swt_widgets_Text#test_getTopIndex

are failing if I run the SWT tests on an unmodified Ubuntu 15.10 with org.eclipse.swt.internal.gtk.version=3.16.7
Comment 1 Lars Vogel CLA 2016-01-12 11:10:41 EST
I'm running AllTests.java from org.eclipse.swt.tests
Comment 2 Eric Williams CLA 2016-01-12 14:27:52 EST
Yes, this is a GTK3.16 issue and is fixed on GTK3.18+. It's been fixed in bug 481122. 

I am also working on bug 483097 which will move SWT foreground colors to CSS for GTK3.16+. This will eliminate any further errors due to the deprecated GTK call gtk_widget_override_color().
Comment 3 Lars Vogel CLA 2016-01-13 04:46:14 EST
(In reply to Eric Williams from comment #2)
> Yes, this is a GTK3.16 issue and is fixed on GTK3.18+. It's been fixed in
> bug 481122. 

Sorry, but I do not understand this. It has been fixed? Why do I still gets this error?
Comment 4 Eric Williams CLA 2016-01-13 09:31:50 EST
(In reply to Lars Vogel from comment #3)
> Sorry, but I do not understand this. It has been fixed? Why do I still gets
> this error?

This bug is a native GTK bug. With GTK3.16 some of the GtkStyleContext internal machinery was changed, often breaking things. This applies for most "manual" theme functions like gtk_widget_override_*_color(), which we use in SWT to set backgrounds and foregrounds. The GTK team is pushing hard for developers to use CSS styled theming for everything, and is deprecating the "old style" theme functions.

While deprecation usually means these functions will work until GTK4, this hasn't been the case. Because of it we have seen lots of test failures for GTK3.16 and GTK3.18 (at one point we had 24 failing test cases). Many of these have been fixed in SWT, but some (like the test failure you are seeing here) was fixed on the GTK side in GTK3.18. This is why in GTK3.16 you will see some lingering test failures for things like set/get Foreground/Background.

All that being said, running these tests on GTK3.16 I see that the test failure starts happening after the fix to bug 478962. But again, this only happens on GTk3.16. I don't see any foreground/background test failures on GTK3.18.
Comment 5 Markus Keller CLA 2016-04-21 08:43:32 EDT
Test_org_eclipse_swt_widgets_Text.test_getTopIndex is the last test that is consistently failing in the official build on CentOS (GTK 3.14.13):

http://download.eclipse.org/eclipse/downloads/drops4/N20160420-2000/testresults/html/org.eclipse.swt.tests_ep46N-unit-cen64_linux.gtk.x86_64_8.0.html

java.lang.AssertionError: expected:<1> but was:<0>
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_getTopIndex(Test_org_eclipse_swt_widgets_Text.java:866)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:743)
...
Comment 6 Eric Williams CLA 2016-04-21 08:47:30 EDT
(In reply to Markus Keller from comment #5)
> Test_org_eclipse_swt_widgets_Text.test_getTopIndex is the last test that is
> consistently failing in the official build on CentOS (GTK 3.14.13):
> 
> http://download.eclipse.org/eclipse/downloads/drops4/N20160420-2000/
> testresults/html/org.eclipse.swt.tests_ep46N-unit-cen64_linux.gtk.x86_64_8.0.
> html
> 
> java.lang.AssertionError: expected:<1> but was:<0>
> at
> org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.
> test_getTopIndex(Test_org_eclipse_swt_widgets_Text.java:866)
> at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:743)
> ...

I have an open bug for this and hopefully the fix will land in master later this afternoon.

*** This bug has been marked as a duplicate of bug 487467 ***