01: /*******************************************************************************
02: * Copyright (c) 2004, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.harness.util;
11:
12: import java.util.Arrays;
13:
14: import junit.framework.Assert;
15:
16: import org.eclipse.swt.graphics.Image;
17: import org.eclipse.swt.graphics.ImageData;
18:
19: /**
20: * @since 3.1
21: */
22: public final class ImageTests {
23:
24: /**
25: *
26: */
27: private ImageTests() {
28: super ();
29: }
30:
31: public static void assertEquals(Image i1, Image i2) {
32: ImageData data1 = i1.getImageData();
33: ImageData data2 = i2.getImageData();
34: Assert.assertTrue(Arrays.equals(data1.data, data2.data));
35: }
36:
37: public static void assertNotEquals(Image i1, Image i2) {
38: ImageData data1 = i1.getImageData();
39: ImageData data2 = i2.getImageData();
40: Assert.assertFalse(Arrays.equals(data1.data, data2.data));
41: }
42: }
|