Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 405018

Summary: ToolBar getRowCount() returns 1 failing Unit Test (AllTests)
Product: [Eclipse Project] Platform Reporter: Anatoly Spektor <spektor.anatoly>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, ericwill
Version: 4.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anatoly Spektor CLA 2013-04-05 12:06:48 EDT
After running Unit tests (AllTests) one of the failures I see is:

 Test_org_eclipse_swt_widgets_ToolBar .getRowCount() public void test_getRowCount() {
	toolBar = new ToolBar(shell, SWT.WRAP);
	int number = 5;
	ToolItem[] items = new ToolItem[number];
	for (int i = 0; i<number ; i++){
	  	items[i] = new ToolItem(toolBar, 0);
	}
	assertTrue(":a:" + toolBar.getRowCount(), toolBar.getRowCount()==number);  //????  because of Size(0, 0);

 .....
}

 Assert is failing due to getRowCount always return 1:

  ToolBar.getRowCount():

public int getRowCount () {
	checkWidget();
	 /* On GTK, toolbars cannot wrap */
	return 1;
}

I think either Assert should be "== 1" or getRowCount() should have some  kind of implementation for Wrap.

Would be great to get feedback on this.

Thanks!
Comment 1 Alexander Kurtakov CLA 2013-04-05 12:26:03 EDT
Anatoly, the thing is on other platforms Toolbars can wrap and the test is good there.
Comment 2 Anatoly Spektor CLA 2013-04-05 12:29:51 EDT
(In reply to comment #1)
> Anatoly, the thing is on other platforms Toolbars can wrap and the test is
> good there.

Ok got it, thanks! But shouldn't the Assert method be guarded with  flag defining on what platform it should run ?
Comment 3 Eric Williams CLA 2017-01-03 14:15:31 EST
Any update on this, can I close this bug?
Comment 4 Eric Williams CLA 2018-07-06 14:35:01 EDT
(In reply to Eric Williams from comment #3)
> Any update on this, can I close this bug?

Closing.