Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325687 - Unit test failures in colors
Summary: Unit test failures in colors
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Scott Kovatch CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-18 16:15 EDT by Scott Kovatch CLA
Modified: 2010-10-21 17:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Kovatch CLA 2010-09-18 16:15:19 EDT
test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageData	Failure	:a: expected:<RGB {248, 16, 15}> but was:<RGB {255, 0, 0}>
junit.framework.AssertionFailedError: :a: expected:<RGB {248, 16, 15}> but was:<RGB {255, 0, 0}>
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageData(Test_org_eclipse_swt_graphics_Image.java:189)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.runTest(Test_org_eclipse_swt_graphics_Image.java:644)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:376)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:209)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
at org.eclipse.core.launcher.Main.main(Main.java:34)


test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageDataLorg_eclipse_swt_graphics_ImageData	Failure	:a: expected:<RGB {248, 16, 15}> but was:<RGB {255, 0, 0}>
junit.framework.AssertionFailedError: :a: expected:<RGB {248, 16, 15}> but was:<RGB {255, 0, 0}>
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageDataLorg_eclipse_swt_graphics_ImageData(Test_org_eclipse_swt_graphics_Image.java:257)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.runTest(Test_org_eclipse_swt_graphics_Image.java:645)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:376)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:209)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
at org.eclipse.core.launcher.Main.main(Main.java:34)


	Failure	rgb.equals(colorRGB)
junit.framework.AssertionFailedError: rgb.equals(colorRGB)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.getImageData2(Test_org_eclipse_swt_graphics_Image.java:710)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.test_getImageData(Test_org_eclipse_swt_graphics_Image.java:496)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.runTest(Test_org_eclipse_swt_graphics_Image.java:652)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:376)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:209)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Scott Kovatch CLA 2010-09-18 16:17:05 EDT
This is almost certainly due to the colorspace changes I checked in on Friday. I'll fix the tests ASAP, as the expected values are probably going to be wrong now.  Color.RED should have RGB values of  255, 0, 0, if the test is doing what I think it's doing.
Comment 2 Silenio Quarti CLA 2010-09-20 11:37:55 EDT
I believe the other platforms use device RGB space (including Carbon). We might have to revert the changes to use calibrared RGB colorspace.
Comment 3 Scott Kovatch CLA 2010-09-20 12:19:05 EDT
(In reply to comment #2)
> I believe the other platforms use device RGB space (including Carbon). We might
> have to revert the changes to use calibrared RGB colorspace.

Sigh... this is a 10.5 vs. 10.6 problem. I ran my tests on two 10.6 systems and everything ran fine, but the same tests fail on a G5 iMac running 10.5. Looks like similar issues I was finding with bug 272952.
Comment 4 Scott Kovatch CLA 2010-09-20 12:30:49 EDT
(In reply to comment #2)
> I believe the other platforms use device RGB space (including Carbon). 

BTW, carbon only looks like it's using the device RGB space. We use CGColorSpaceCreateDeviceRGB everywhere, but according to the docs:

"In Mac OS X v10.4 and later, this color space is no longer device-dependent and is replaced by the generic counterpart—kCGColorSpaceGenericRGB—described in “Color Space Names”. If you use this function in Mac OS X v10.4 and later, colors are mapped to the generic color spaces. If you want to bypass color matching, use the color space of the destination context."
Comment 5 Scott Kovatch CLA 2010-09-20 15:51:59 EDT
In GC.java, if I use colorWithCalibratedRed:... the tests pass on 10.6 but fail on 10.5. If I use colorWithDeviceRed:... they pass on 10.5 but fail on 10.6.  This is with NSCalibratedRGBColorSpace used to create the NSBitmapImageRep in Image.

Using NSDeviceRGBColorSpace and colorWithDeviceRed: works on both 10.5 and 10.6, so we'll stick with that in those classes only.
Comment 6 Scott Kovatch CLA 2010-09-20 15:53:11 EDT
Fixed > 20100920.
Comment 7 Scott Kovatch CLA 2010-09-20 15:53:26 EDT
.