assertEquals(":a:", new RGB(255, 0, 0), gcImageData.palette.getRGB(redPixel));
assertEquals(":a:", getRealRGB(display.getSystemColor(SWT.COLOR_RED)), gcImageData.palette.getRGB(redPixel));
public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageDataLorg_eclipse_swt_graphics_ImageData() {	ImageData data = null;	ImageData data1 = new ImageData(10, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	Image image = null;		try {		image = new Image(display, data, data1);		image.dispose();		fail("No exception thrown for ImageData source == null");	} catch (IllegalArgumentException e) {		assertEquals("Incorrect exception thrown for ImageData source == null", SWT.ERROR_NULL_ARGUMENT, e);	}	data = new ImageData(10, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	data1 = null;	try {		image = new Image(display, data, data1);		image.dispose();		fail("No exception thrown for ImageData mask == null");	} catch (IllegalArgumentException e) {		assertEquals("Incorrect exception thrown for ImageData mask == null", SWT.ERROR_NULL_ARGUMENT, e);	}	data = new ImageData(10, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	data1 = new ImageData(1, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	try {		image = new Image(display, data, data1);		image.dispose();		fail("No exception thrown for ImageData source width != ImageData mask width");	} catch (IllegalArgumentException e) {		assertEquals("Incorrect exception thrown for ImageData source width != ImageData mask width", SWT.ERROR_INVALID_ARGUMENT, e);	}	data = new ImageData(10, 1, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	data1 = new ImageData(10, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	try {		image = new Image(display, data, data1);		image.dispose();		fail("No exception thrown for ImageData source height != ImageData mask height");	} catch (IllegalArgumentException e) {		assertEquals("Incorrect exception thrown for ImageData source height != ImageData mask height", SWT.ERROR_INVALID_ARGUMENT, e);	}	data = new ImageData(10, 10, 8, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	data1 = new ImageData(10, 10, 8, new PaletteData(new RGB[] {new RGB(0, 0, 0)}));	try {		image = new Image(display, data, data1);		image.dispose();		fail("No exception thrown for ImageData mask color depth != 1");	} catch (IllegalArgumentException e) {		assertEquals("Incorrect exception thrown for ImageData mask color depth != 1", SWT.ERROR_INVALID_ARGUMENT, e);	}	data = new ImageData(10, 10, 8, new PaletteData(0x30, 0x0C, 0x03));	// set opaque red pixel at x=9, y=9	data.setPixel(9, 9, 0x30);	data1 = new ImageData(10, 10, 1, new PaletteData(new RGB[] {new RGB(0, 0, 0), new RGB(255, 255, 255)}));	data1.setPixel(9, 9, 1);	image = new Image(display, data, data1);	Image gcImage = new Image(display, 10, 10);	GC gc = new GC(gcImage);	Color backgroundColor = display.getSystemColor(SWT.COLOR_BLUE); 	gc.setBackground(backgroundColor);	gc.fillRectangle(0, 0, 10, 10);	gc.drawImage(image, 0, 0);	ImageData gcImageData = gcImage.getImageData();	int redPixel = gcImageData.getPixel(9, 9);	assertEquals(":a:", new RGB(255, 0, 0), gcImageData.palette.getRGB(redPixel));	int bluePixel = gcImageData.getPixel(0, 0);	assertEquals(":b:", backgroundColor.getRGB(), gcImageData.palette.getRGB(bluePixel));	gc.dispose();	gcImage.dispose();	image.dispose();}