[Laszlo-dev] two lzunit questions

John Sundman jsundman at laszlosystems.com
Wed Nov 9 09:22:59 PST 2005


Hello Friends,

1) In the following example (from the LzUnit chapter of the Dguide, 
which I'm overhauling) can anybody tell me why the debugger always 
shows up way down at the bottom?  No matter what I try (for example 
positioning the debugger, changing the canvas size), the debugger shows 
up with just the tip of its head showing.  It appears to be 
disregarding the y argument to debug.

<canvas debug="true" height="500">
   <include href="lzunit"/>
   <debug y="10"/>

   <TestSuite>
     <TestCase>
       <attribute name="prop1" value="'foo'" when="once"/>
       <text name="mytext" width="200" bgcolor="blue" text="LzUnit 
example"/>

       <method name="testsuccess">
         assertEquals(prop1, 'foo')
       </method>
       <method name="testfailure">
         assertTrue(mytext.multiline, "This is not a multiline text 
field")
       </method>
       <method name="testerror">
         callFoo()
       </method>
     </TestCase>
   </TestSuite>
</canvas>

2) In this example I'm getting the error:

WARNING: lzunit-$5.lzx:15: reference to undefined variable 
'animatorsuite'
WARNING: lzunit-$5.lzx:16: reference to undefined variable 
'animatorcase'
ERROR: Class TestSuite used before defined

I'm sure this one is something obvious, but I can't see it  :^)

<canvas height ="300" width="400" debug="true">
   <debug y="40"/>
   <view>
     <view id="bluebox" bgcolor="blue" width="30" height="30">
       <animatorgroup name="AG1" attribute="x" process="sequential" 
start="false" relative="false">
         <animator from="0" to="100" duration="2000"
             
onstop="canvas.animatorsuite.animatorcase.checkSimpleXAnim()"/>
         <animator from="0" to="200" duration="3000"
             
onstop="canvas.animatorsuite.animatorcase.checkSimpleXAnim2()"/>
       </animatorgroup>
     </view>
   </view>

   <TestSuite name="animatorsuite">
    <TestCase name="animatorcase">
      <method name="testSimpleXAnim">
        bluebox.AG1.doStart()
      </method>
      <method name="checkSimpleXAnim">
        assertEquals(100, bluebox.x);
      </method>
      <method name="checkSimpleXAnim2">
        assertEquals(200, bluebox.x);
        Debug.write('--- test complete ---');
      </method>
    </TestCase>
   </TestSuite>
</canvas>


Any help appreciated.

jrs




More information about the Laszlo-dev mailing list