On 3/8/21 3:41 PM, Thomas Huth wrote:
On 08/03/2021 15.13, Pierre Morel wrote:
On 3/1/21 4:00 PM, Janosch Frank wrote:
On 3/1/21 12:47 PM, Pierre Morel wrote:
In order to ease the writing of tests based on:
...snip...
-static void test_sense(void)
+static bool do_test_sense(void)
{
struct ccw1 *ccw;
+ bool success = false;
That is a very counter-intuitive name, something like "retval" might be
better.
You're free to use the normal int returns but unfortunately you can't
use the E* error constants like ENOMEM.
hum, I had retval and changed it to success on a proposition of Thomas...
I find it more intuitive as a bool since this function succeed or
fail, no half way and is used for the reporting.
other opinion?
I'd say either "static int ..." + retval (with 0 for success), or
"static bool ..." and "success" (with true for success) ... but "bool" +
"retval" sounds confusing to me.
Thomas
OK, thanks, then I keep bool success :)
Thanks
Pierre
--
Pierre Morel
IBM Lab Boeblingen