javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java
changeset 78 71ad690e91f5
parent 23 98ccebc37403
--- a/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java	Mon Oct 04 11:29:25 2010 +0300
@@ -198,6 +198,23 @@
         };
         testPaint("paint with translation and clip",
                   canvas, image, imageGraphics, compare4);
+
+        // Test paint when graphics is null
+        MyGameCanvas gameCvs1 = new MyGameCanvas(false);
+        Graphics g = null;
+        String msg = "";
+
+        try
+        {
+            gameCvs1.paint(g);
+            msg = " NullPointerException wa not thrown when graphics was set to null";
+            msg = "FAILED \n" + msg;
+            fail(msg);
+        }
+        catch (NullPointerException ne)
+        {
+            //test pass
+        }
     }
 
     /**
@@ -327,4 +344,17 @@
         }
     }
 
+    class MyGameCanvas extends GameCanvas 
+    {
+
+        public MyGameCanvas(boolean s) 
+        {
+            super(s);
+        }
+
+        public Graphics getGraphics() 
+        {
+            return super.getGraphics();
+        }
+    }
 }