diff --git a/tests/automation.js b/tests/automation.js index 9ecae7c0..a6bbe376 100644 --- a/tests/automation.js +++ b/tests/automation.js @@ -37,6 +37,7 @@ var gfxTests = [ { name: "gfx/ClippingTest", maxDifferent: 0 }, { name: "gfx/ImageProcessingTest", maxDifferent: 6184 }, { name: "gfx/CreateImageWithRegionTest", maxDifferent: 0 }, + { name: "gfx/DrawSubstringTest", maxDifferent: 0 }, ]; casper.test.begin("unit tests", 7 + gfxTests.length, function(test) { diff --git a/tests/gfx/DrawSubstringTest.java b/tests/gfx/DrawSubstringTest.java new file mode 100644 index 00000000..f86d9f03 --- /dev/null +++ b/tests/gfx/DrawSubstringTest.java @@ -0,0 +1,36 @@ +package gfx; + +import javax.microedition.lcdui.*; +import javax.microedition.midlet.*; + +public class DrawSubstringTest extends MIDlet { + private Command quitCommand; + private Display display; + + class TestCanvas extends Canvas { + protected void paint(Graphics g) { + g.setColor(0x00FFFFFF); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(0); + g.setStrokeStyle(Graphics.SOLID); + g.drawSubstring("Faber est suae quisque fortunae", 23, 7, 0, 0, Graphics.TOP | Graphics.LEFT); + System.out.println("PAINTED"); + } + } + + public DrawSubstringTest() { + display = Display.getDisplay(this); + } + + public void startApp() { + TestCanvas test = new TestCanvas(); + display.setCurrent(test); + } + + public void pauseApp() { + } + + public void destroyApp(boolean unconditional) { + } +} + diff --git a/tests/gfx/DrawSubstringTest.png b/tests/gfx/DrawSubstringTest.png new file mode 100644 index 00000000..b987de5a Binary files /dev/null and b/tests/gfx/DrawSubstringTest.png differ