tau icon indicating copy to clipboard operation
tau copied to clipboard

docs: TEST blocks require that there is no return value

Open matu3ba opened this issue 2 years ago • 3 comments

From a little toy project https://github.com/matu3ba/pbcd/blob/4ffd0dfe6006c5342302d4099c02d537facf4ffe/runTest.sh

^
test.c:28:3: error: void function '_TAU_TEST_FUNC_foo_bar1' should not return a value [-Wreturn-type]
  return status;

Alternatively (but probably more cumbersome): support custom return values.

matu3ba avatar Apr 11 '22 08:04 matu3ba

Why would you want to return anything within a testing block?

jasmcaus avatar Apr 11 '22 13:04 jasmcaus

Why would you want to return anything within a testing block?

To copy paste main and not being forced to wrap the to be tested method within another method ie for return codes (say one wants to simulate allocation failures or other stuff). This is probably more of an edge case, so I phrased the issue as "docs".

matu3ba avatar Apr 11 '22 14:04 matu3ba

I agree it's more of an edge case, so unless there's significant user traction for this feature, I'll defer this for a later stage.

jasmcaus avatar Apr 11 '22 14:04 jasmcaus