Mailingliste - Einträge 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Procedure parameters evaluation


  • Subject: Re: [qftestJUI] Procedure parameters evaluation
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 13 May 2006 22:00:38 +0200

Hello Kokoth,

the behavior you see is the intended one, thou I agree that it can be
surprising.

Currently, all variable bindings in qftestJUI are lazy, so when you
make the call from Procedure A to Procedure B, $(param) is _not_
expanded.

Only when $(param) is finally evaluated in Procedure B does qftestJUI
expand the value and then B's default binding has higher precedence.

It is moot to argue whether this is preferable to immediate expansion.
Both methods have their merits. If you really need immediate expansion
behavior you can use a temporary local variable to which you assign
the expanded value of $(param). This is inconvenient though, so a
future version will offer the choice of using immediate or lazy
expansion in Procedure call nodes for each parameter.

Best regards,
    Greg

kokoth <kokoth@?.cz> writes:

>    Hello,
>    I have this test suite:
>    Test-suite
>    - Test
>    - Procedures
>      - Procedure A
>    (param=A)
>       (1)
>        - Server script (rc.logMessage("$(param)")) -> A
>               (2)
>        - Call procedure
>    B($(param))
>    (3)
>      - Procedure B
>    (param=B)
>       (4)
>        - Server script (rc.logMessage("$(param)")) -> B, SHOULD BE A
>    (5)
>    - Extras
>      - Call procedure
>    A()
>          (7)
>    - Windows and components
>    (1) procedure A has variable param with default value A
>    (2) script prints value of $(param) -> A
>    (3) procedure A calls procedure B with param=$(param)
>    (4) procedure B has variable param with default value B
>    (5) script prints value of $(param) -> B
>    Im not sure, but I think, that in step (5) I should get value A insted
>    of B.
>    run-log (compact)
>    - Call procedure A()
>      - Procedure A
>        - Server script
>          - xxx Expansion of code: 'rc.logMessage("$(param)")' =>
>    'rc.logMessage("A")'
>          - xxx A
>        - Call procedure B($(param))
>          - Procedure B
>            - Server script
>              - xxx Expansion of code: 'rc.logMessage("$(param)") =>
>    'rc.logMessage("B")'
>              - xxx B
> 
> _______________________________________________
> qftestJUI-list mailing list
> qftestJUI-list@?.de
> http://www.qfs.de/mailman/listinfo/qftestjui-list

-- 
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen