|
1 | 1 | /******************************************************************************* |
2 | | - * Copyright (c) 2000, 2016 IBM Corporation and others. |
| 2 | + * Copyright (c) 2000, 2026 IBM Corporation and others. |
3 | 3 | * |
4 | 4 | * This program and the accompanying materials |
5 | 5 | * are made available under the terms of the Eclipse Public License 2.0 |
|
16 | 16 |
|
17 | 17 | import static org.eclipse.swt.internal.DPIUtil.pointToPixel; |
18 | 18 | import static org.eclipse.swt.tests.junit.SwtTestUtil.assertSWTProblem; |
| 19 | +import static org.junit.jupiter.api.Assertions.assertAll; |
19 | 20 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; |
21 | 22 | import static org.junit.jupiter.api.Assertions.assertFalse; |
@@ -793,40 +794,24 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() { |
793 | 794 |
|
794 | 795 | @Test |
795 | 796 | public void test_setClippingIIII() { |
796 | | - // intermittently fails on XP for reasons unknown, comment out the test case |
797 | | - // until the problem is figured out |
798 | | -// Canvas canvas = new Canvas(shell, SWT.BORDER); |
799 | | -// shell.setSize(110,110); |
800 | | -// canvas.setSize(100,100); |
801 | | -// shell.open(); |
802 | | -// GC testGc = new GC(canvas); |
803 | | -// testGc.setClipping(0,5,10,20); |
804 | | -// Rectangle rect = testGc.getClipping(); |
805 | | -// assertTrue(rect.x == 0); |
806 | | -// assertTrue(rect.y == 5); |
807 | | -// assertTrue(rect.width == 10); |
808 | | -// assertTrue(rect.height == 20); |
809 | | -// testGc.dispose(); |
810 | | -// canvas.dispose(); |
| 797 | + gc.setClipping(0,5,10,20); |
| 798 | + Rectangle rect = gc.getClipping(); |
| 799 | + assertAll( |
| 800 | + () -> assertEquals(0,rect.x), |
| 801 | + () -> assertEquals(5, rect.y), |
| 802 | + () -> assertEquals(10,rect.width), |
| 803 | + () -> assertEquals(20,rect.height)); |
811 | 804 | } |
812 | 805 |
|
813 | 806 | @Test |
814 | 807 | public void test_setClippingLorg_eclipse_swt_graphics_Rectangle() { |
815 | | - // intermittently fails on XP for reasons unknown, comment out the test case |
816 | | - // until the problem is figured out |
817 | | -// Canvas canvas = new Canvas(shell, SWT.BORDER); |
818 | | -// shell.setSize(110,110); |
819 | | -// canvas.setSize(100,100); |
820 | | -// shell.open(); |
821 | | -// GC testGc = new GC(canvas); |
822 | | -// testGc.setClipping(new Rectangle(0,5,10,20)); |
823 | | -// Rectangle rect = testGc.getClipping(); |
824 | | -// assertTrue(rect.x == 0); |
825 | | -// assertTrue(rect.y == 5); |
826 | | -// assertTrue(rect.width == 10); |
827 | | -// assertTrue(rect.height == 20); |
828 | | -// testGc.dispose(); |
829 | | -// canvas.dispose(); |
| 808 | + gc.setClipping(new Rectangle(0,5,10,20)); |
| 809 | + Rectangle rect = gc.getClipping(); |
| 810 | + assertAll( |
| 811 | + () -> assertEquals(0,rect.x), |
| 812 | + () -> assertEquals(5, rect.y), |
| 813 | + () -> assertEquals(10,rect.width), |
| 814 | + () -> assertEquals(20,rect.height)); |
830 | 815 | } |
831 | 816 |
|
832 | 817 | @Test |
|
0 commit comments