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

Re: [PATCH RFC] Implement vector test functions

> thank you very much for your contribution. I need to think about that

Sure thing.  There is no rush and I am open to any suggestions you might

> and I 
> wonder if we couldn't reuse the prestate here (cmocka_unit_test_prestate).

That was one of the approaches I initially considered but if by "reusing
the prestate" you mean passing a vector element to the test function
through the 'initial_state' member, then the challenging part about that
for me was keeping the definition of the input data vector clean and
concise while still allowing arbitrary structures to be used as input
data.  Plus, IIUC, this practically eliminates the possibility to have a
variant of a "vector test function" which takes group setup/teardown
functions as arguments since if these functions set state for a given
unit test, the prestate (i.e. a vector element) will be overridden.

If you come to the conclusion that this is a feasible solution, I would
appreciate some sample code, to make sure we are on the same page.


Best regards,
Michał Kępień

[PATCH RFC] Implement vector test functionsMichał Kępień <michal@xxxxxxx>
Re: [PATCH RFC] Implement vector test functionsAndreas Schneider <asn@xxxxxxxxxxxxxx>