Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 89105 - Test_org_eclipse_swt_widgets_Combo test_removeI() is problematic
Summary: Test_org_eclipse_swt_widgets_Combo test_removeI() is problematic
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-25 10:37 EST by Stef van Dijk CLA
Modified: 2019-02-26 15:41 EST (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 Stef van Dijk CLA 2005-03-25 10:37:28 EST
The referenced test is actually symbolic of a general problem in the Junit tests
which is that it tests for very platform-specific behavior.
It tries to allow for this by relying on platform flags like SwtJunit.isWindows
and SwtJunit.isGTK, but that only really works for the known platforms. If I
work on an implemention for a new platform, do I need to add a flag to SwtJunit
and then fix any and all affected tests thus having to mantain my own copy of
the test suite?
I understand the dilemma, but as much as possible I think the tests should be
written in a platform neutral way if at all possible, and I think this one can be.
Since we know the items being put into the list and what's being removed, would
it not be better to get the selection index and the entry text and make sure
that matches what we knew to be the list of items? And in the case where the
selection index is -1 (like happens on WIndows), the check would be that the
entry text is blank.

So is this a reasonable approach or am I being too wishful in my thinking?
Comment 1 Steve Northover CLA 2005-03-29 20:39:51 EST
Please submit a patch for any that you find.  Sometimes there are good reasons 
for platform tests but this one looks bogus.
Comment 2 Stef van Dijk CLA 2005-04-12 09:49:25 EDT
I haven't forgotten about this and do intend to help provide a patch. Just have
been busy with other priorities.
I do have one question however. In researching this, I was a bit confused by the
behavior of Combo on Gtk and I want to understand that before addressing the
testcase.
It seems SWT does not just do the platform thing. When removing the currently
selected item, native Gtk appears to replace the text field contents with an
adjacent item (though it's not clear if it issues a selection event in all
scenarios). However, SWT overtly clears the field which happens to match the
Windows behavior. Subsequently, the testcase expects Windows and Gtk to behave
one way and other platforms another way. But maybe this is affected by the way
SWT determines the selected index and how Gtk maintains it.
So why was SWT on Gtk implemented that way as opposed to sticking with the
platform behavior?
Comment 3 Alexander Kurtakov CLA 2019-02-26 15:41:33 EST
This test hasn't been failing for years.