Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2004-02-11 20:46:24 +0000
committerCarolyn MacLeod2004-02-11 20:46:24 +0000
commit617f4eac36cf474c709ffc521a16e01b9e1eb515 (patch)
tree99fa1ff73945d774847b26140fcfd9e06e06467d
parentb50cc2afcc26fcae4fe9849e4cba03e1408eb9b7 (diff)
downloadeclipse.platform.swt-617f4eac36cf474c709ffc521a16e01b9e1eb515.tar.gz
eclipse.platform.swt-617f4eac36cf474c709ffc521a16e01b9e1eb515.tar.xz
eclipse.platform.swt-617f4eac36cf474c709ffc521a16e01b9e1eb515.zip
*** empty log message ***
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java39
1 files changed, 35 insertions, 4 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
index 71c12d2215..b12ab5b2de 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
@@ -124,11 +124,11 @@ public void test_getChecked() {
}
public void test_getFont() {
- warnUnimpl("Test test_getFont not written");
+ // tested in test_setFontLorg_eclipse_swt_graphics_Font
}
public void test_getFontI() {
- warnUnimpl("Test test_getFontI not written");
+ // tested in test_setFontILorg_eclipse_swt_graphics_Font
}
public void test_getForeground() {
@@ -265,12 +265,43 @@ public void test_setCheckedZ() {
assertEquals(false, ti.getChecked());
t.dispose();
}
+
public void test_setFontLorg_eclipse_swt_graphics_Font() {
- warnUnimpl("Test test_setFontLorg_eclipse_swt_graphics_Font not written");
+ Font font = tableItem.getFont();
+ tableItem.setFont(font);
+ assertEquals(font, tableItem.getFont());
+
+ font = new Font(tableItem.getDisplay(), SwtJunit.testFontName, 10, SWT.NORMAL);
+ tableItem.setFont(font);
+ assertEquals(font, tableItem.getFont());
+
+ tableItem.setFont(null);
+ font.dispose();
+ try {
+ tableItem.setFont(font);
+ tableItem.setFont(null);
+ fail("No exception thrown for disposed font");
+ } catch (IllegalArgumentException e) {
+ }
}
public void test_setFontILorg_eclipse_swt_graphics_Font() {
- warnUnimpl("Test test_setFontILorg_eclipse_swt_graphics_Font not written");
+ Font font = tableItem.getFont(0);
+ tableItem.setFont(0, font);
+ assertEquals(font, tableItem.getFont(0));
+
+ font = new Font(tableItem.getDisplay(), SwtJunit.testFontName, 10, SWT.NORMAL);
+ tableItem.setFont(0, font);
+ assertEquals(font, tableItem.getFont(0));
+
+ tableItem.setFont(0, null);
+ font.dispose();
+ try {
+ tableItem.setFont(0, font);
+ tableItem.setFont(0, null);
+ fail("No exception thrown for disposed font");
+ } catch (IllegalArgumentException e) {
+ }
}
public void test_setForegroundILorg_eclipse_swt_graphics_Color() {

Back to the top