javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java
changeset 78 71ad690e91f5
parent 23 98ccebc37403
equal deleted inserted replaced
72:1f0034e370aa 78:71ad690e91f5
   196             0xFFFFFFFF, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF,
   196             0xFFFFFFFF, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF,
   197             0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
   197             0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
   198         };
   198         };
   199         testPaint("paint with translation and clip",
   199         testPaint("paint with translation and clip",
   200                   canvas, image, imageGraphics, compare4);
   200                   canvas, image, imageGraphics, compare4);
       
   201 
       
   202         // Test paint when graphics is null
       
   203         MyGameCanvas gameCvs1 = new MyGameCanvas(false);
       
   204         Graphics g = null;
       
   205         String msg = "";
       
   206 
       
   207         try
       
   208         {
       
   209             gameCvs1.paint(g);
       
   210             msg = " NullPointerException wa not thrown when graphics was set to null";
       
   211             msg = "FAILED \n" + msg;
       
   212             fail(msg);
       
   213         }
       
   214         catch (NullPointerException ne)
       
   215         {
       
   216             //test pass
       
   217         }
   201     }
   218     }
   202 
   219 
   203     /**
   220     /**
   204     * Checks the painted image against provided rgb array.
   221     * Checks the painted image against provided rgb array.
   205     *
   222     *
   325         {
   342         {
   326             return getGraphics();
   343             return getGraphics();
   327         }
   344         }
   328     }
   345     }
   329 
   346 
       
   347     class MyGameCanvas extends GameCanvas 
       
   348     {
       
   349 
       
   350         public MyGameCanvas(boolean s) 
       
   351         {
       
   352             super(s);
       
   353         }
       
   354 
       
   355         public Graphics getGraphics() 
       
   356         {
       
   357             return super.getGraphics();
       
   358         }
       
   359     }
   330 }
   360 }