[Laszlo-dev] For Review: Change 20080403-ptw-X Summary: More tweaks to instance classes

Henry Minsky henry.minsky at gmail.com
Thu Apr 3 19:47:16 PDT 2008


I get one test failure in smokecheck

Tests: 878 Failures: 2 Errors: 0
TestFailure: $lzc$class_bug_1304 >>> testTextWidth failed: Equals:
expected '1122' got '12'
TestFailure: $lzc$class_bug_1304 >>> testTextWidth failed: Equals:
expected '1122' got '12'

That test case is this:

    <class name="classWithText">
        <text name="me">some text here</text>
        <view bgcolor="yellow" width="20" height="${parent.me.height}"/>
        <simplelayout axis="x"/>
    </class>

    <class name="bug_1304" extends="TestCase">
        <classWithText name="goo"/>
        <view name="bo0">
            <text name="me">some text here</text>
            <view bgcolor="yellow" width="20" height="${parent.me.height}"/>
            <simplelayout axis="x"/>
        </view>

        <method name="testTextWidth">
            assertEquals(bo0.me.width, goo.me.width, "Width");
        </method>
    </class>

So the question would be why the two text fields come up with different widths.
I gave an id to the test case

    <bug_1304 id="bg"/>

and at runtime, in the debugger, asking for the two text widths gives
equal results, but they are both 91, not 12 or 1122.
In fact, if I put a debug.write in

         <method name="testTextWidth">
            Debug.write('bo0.me.width',bo0.me.width , 'goo.me.width',
goo.me.width);
            assertEquals(bo0.me.width, goo.me.width, "Width");
        </method>

It prints out equal values, but still fails the assertion!
bo0.me.width 91 goo.me.width 91
ERROR: Equals:  expected '1122' got '12'
ERROR: Equals:  expected '1122' got '12'


So the assertion failure message must be for some other test case, and
the thing that prints it
is getting mixed up as to which test failed?







On Thu, Apr 3, 2008 at 8:08 AM, P T Withington <ptw at pobox.com> wrote:
> Change 20080403-ptw-X by ptw at dueling-banjos.local on 2008-04-03 07:58:34 EDT
>     in /Users/ptw/OpenLaszlo/ringding-clean
>     for http://svn.openlaszlo.org/openlaszlo/trunk
>
>  Summary: More tweaks to instance classes
>
>  Bugs Fixed:
>  LPP-5625 'Implement instances with methods as singleton classes' (partial)
>
>  Technical Reviewer: henry.minsky at gmail.com (pending)
>  QA Reviewer: dda at ddanderson.com (pending)
>
>  Details:
>     ClassCompiler, ClassModel:  Move compling of class to ClassModel
>     so that in can be invoked on demand (e.g., when a class is
>     referenced).
>
>     ViewSchema:  Fix annotation of built-in classes to actually work.
>
>     NodeModel:  Leave non-method attributes of instance classes as
>     init args so they can be processed by construct methods.
>
>  Tests:
>     Amazon working a little better, smokecheck has one error
>
>  Files:
>  M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
>  M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
>  M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
>  M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
>
>
>  Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080403-ptw-X.tar
>



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com


More information about the Laszlo-dev mailing list