Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2004-11-11 21:11:41 +0000
committerGrant Gayed2004-11-11 21:11:41 +0000
commit56727699830e2a01276525932d2217cd808d71f2 (patch)
treecaca788f663316721d46682a745debb76ceb6e0b
parent9159069ffcf0918b6b761e049d25cddc8ae6e9ad (diff)
downloadeclipse.platform.swt-56727699830e2a01276525932d2217cd808d71f2.tar.gz
eclipse.platform.swt-56727699830e2a01276525932d2217cd808d71f2.tar.xz
eclipse.platform.swt-56727699830e2a01276525932d2217cd808d71f2.zip
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_org_eclipse_swt_graphics_Image.java31
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_org_eclipse_swt_graphics_Image.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_org_eclipse_swt_graphics_Image.java
index 68ee4b7668..ba7a41a3f2 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_org_eclipse_swt_graphics_Image.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_org_eclipse_swt_graphics_Image.java
@@ -42,21 +42,21 @@ protected void setUp() throws Exception {
}
public void test_ConstructorLorg_eclipse_swt_graphics_DeviceII() {
- final int COUNT = 7000; // 8000 causes No More Handles error
-
- Image[] images = new Image[COUNT];
+ final int COUNT = 60000;
PerformanceMeter meter = createMeter("Image constr.(Device,II)");
meter.start();
for (int i = 0; i < COUNT; i++) {
- images[i] = new Image(display, 100, 100);
+ /*
+ * This test is not really valid since it's measuring both creation and
+ * disposal of the Images. This is necessary because attempting to defer
+ * the image disposal until the timer has been stopped causes a No More
+ * Handles error.
+ */
+ new Image(display, 100, 100).dispose();
}
meter.stop();
- for (int i = 0; i < COUNT; i++) {
- images[i].dispose();
- }
-
disposeMeter(meter);
}
@@ -121,22 +121,23 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_gra
}
public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_Rectangle() {
- final int COUNT = 6000;
+ final int COUNT = 60000;
- Image[] images = new Image[COUNT];
Rectangle rectangle = new Rectangle(0, 0, 100, 100);
PerformanceMeter meter = createMeter("Image constr.(Device,Rectangle)");
meter.start();
for (int i = 0; i < COUNT; i++) {
- images[i] = new Image(display, rectangle);
+ /*
+ * This test is not really valid since it's measuring both creation and
+ * disposal of the Images. This is necessary because attempting to defer
+ * the image disposal until the timer has been stopped causes a No More
+ * Handles error.
+ */
+ new Image(display, rectangle).dispose();
}
meter.stop();
- for (int i = 0; i < COUNT; i++) {
- images[i].dispose();
- }
-
disposeMeter(meter);
}

Back to the top