Hello,
I'm stuck with a SmPL problem:
@@
idexpression ret;
@@
ok(<... ret ...>, ...);
... when != ret
*ok
(<... ret ...>, ...);
spatch --parse-cocci accepts it but when running it I get:
Fatal error: exception Failure("only handling multi and no when code in
a nest expr")
<... ret ...> inside ok() is the culprit.
I'm trying for days to think of a workaround for this (e.g. splitting it
into different rules) but I'm drawing a blank on it.
ok() is the test function/macro in the Wine tests which evaluates its
first arg to see if the test succeeded. The rest of the varargs are the
printf style message in case the test fails. I'm trying to check that a
variable isn't tested in two ok() calls without being modified in
between. The expression in the first arg passed to ok() can be fairly
complex with "ret" showing up multiple times. I've attached some sample
code.
Any ideas?
thanks
bye
michael
void test_foo(void)
{
HRESULT hr;
hr = foo(-1);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %x\n", hr);
foo(0);
ok(hr == S_OK, "Expected S_OK got %x\n", hr);
}
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)