lvc / api-sanity-checker

An automatic generator of basic unit tests for a C/C++ library
https://lvc.github.io/api-sanity-checker/
GNU Lesser General Public License v2.1
85 stars 13 forks source link

Is there any way to catch the return value of one function and assign it as a value for other function parameter by using specialized types attributes? #30

Open MARISETTI-LAVANYA opened 7 years ago

lvc commented 7 years ago

Hi,

It's possible by:

<spec_type>
    <kind>
        normal
    </kind>

    <data_type>
        Type
    </data_type>

    <value>
       init_param()
    </value>

    <global_code>
        Type init_param()
        {
            Type r = $[bar];
            return r;
        }
    </global_code>

    <associating>
        <interfaces>
            foo
        </interfaces>

        <links>
            param1
        </links>
    </associating>
</spec_type>

Please also try:

<spec_type>
    <kind>
        normal
    </kind>

    <data_type>
        Type
    </data_type>

    <value>
       $[bar]
    </value>

    <associating>
        <interfaces>
            foo
        </interfaces>

        <links>
            param1
        </links>
    </associating>
</spec_type>

If last case doesn't work then we should implement it in future.

I'll continue working on the tool this autumn.

Thank you.