From ce6ae23d60a412924771ce18bf8769c51191de49 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 12 Nov 2014 18:50:08 +0100 Subject: [PATCH] Add DrawSubstring test --- tests/automation.js | 1 + tests/gfx/DrawSubstringTest.java | 36 +++++++++++++++++++++++++++++++ tests/gfx/DrawSubstringTest.png | Bin 0 -> 4639 bytes 3 files changed, 37 insertions(+) create mode 100644 tests/gfx/DrawSubstringTest.java create mode 100644 tests/gfx/DrawSubstringTest.png 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 0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